From: Richard M. Stallman Date: Fri, 5 Apr 1996 16:05:03 +0000 (+0000) Subject: (electric-help-mode): Use add-hook mouse-leave-buffer-hook. X-Git-Tag: emacs-19.34~917 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2e8174d2ce85484aa095f151ca4dac06648c97cf;p=emacs.git (electric-help-mode): Use add-hook mouse-leave-buffer-hook. (electric-help-retain): Use remove-hook. --- diff --git a/lisp/ehelp.el b/lisp/ehelp.el index 5964157d748..14401f7c9a5 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -88,7 +88,7 @@ (setq major-mode 'help) (setq mode-line-buffer-identification '(" Help: %b")) (use-local-map electric-help-map) - (setq mouse-leave-buffer-hook '(electric-help-retain)) + (add-hook 'mouse-leave-buffer-hook 'electric-help-retain) (view-mode -1) ;; this is done below in with-electric-help ;(run-hooks 'electric-help-mode-hook) @@ -232,10 +232,10 @@ will select it.)" (interactive) ;; Make sure that we don't throw twice, even if two events cause ;; calling this function: - (if mouse-leave-buffer-hook - (progn - (setq mouse-leave-buffer-hook nil) - (throw 'exit '(retain))))) + (if (memq 'electric-help-retain mouse-leave-buffer-hook) + (progn + (remove-hook 'mouse-leave-buffer-hook 'electric-help-retain) + (throw 'exit '(retain))))) (defun electric-help-undefined ()