From: ueno Date: Sat, 27 Aug 2005 04:37:03 +0000 (+0000) Subject: Remove hooks local to dialog buffers. X-Git-Tag: channel-coding-branchpoint~32 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4f13332ebf6a8e58bc9924bab9f12557c58837dc;p=elisp%2Friece.git Remove hooks local to dialog buffers. --- diff --git a/lisp/riece-highlight.el b/lisp/riece-highlight.el index 4955a47..1164918 100644 --- a/lisp/riece-highlight.el +++ b/lisp/riece-highlight.el @@ -218,7 +218,7 @@ (font-lock-set-defaults) (make-local-hook 'after-change-functions) (add-hook 'after-change-functions - 'riece-highlight-hide-prefix nil 'local) + 'riece-highlight-hide-prefix nil t) (if riece-highlight-enabled (font-lock-mode 1))) @@ -264,12 +264,8 @@ (defun riece-highlight-insinuate () (put 'riece-channel-mode 'font-lock-defaults '(riece-dialogue-font-lock-keywords t)) - (add-hook 'riece-channel-mode-hook - 'riece-highlight-setup-dialogue) (put 'riece-others-mode 'font-lock-defaults '(riece-dialogue-font-lock-keywords t)) - (add-hook 'riece-others-mode-hook - 'riece-highlight-setup-dialogue) (put 'riece-dialogue-mode 'font-lock-defaults '(riece-dialogue-font-lock-keywords t)) (add-hook 'riece-dialogue-mode-hook @@ -284,12 +280,17 @@ 'riece-highlight-put-overlay-faces)) (defun riece-highlight-uninstall () + (let ((buffers riece-buffer-list)) + (save-excursion + (while buffers + (set-buffer (car buffers)) + (if (eq (derived-mode-class major-mode) + 'riece-dialogue-mode) + (remove-hook 'after-change-functions + 'riece-highlight-hide-prefix t)) + (setq buffers (cdr buffers))))) (remprop 'riece-channel-mode 'font-lock-defaults) - (remove-hook 'riece-channel-mode-hook - 'riece-highlight-setup-dialogue) (remprop 'riece-others-mode 'font-lock-defaults) - (remove-hook 'riece-others-mode-hook - 'riece-highlight-setup-dialogue) (remprop 'riece-dialogue-mode 'font-lock-defaults) (remove-hook 'riece-dialogue-mode-hook 'riece-highlight-setup-dialogue)