]> git.eshelyaron.com Git - emacs.git/commitdiff
(electric-help-mode): Use add-hook mouse-leave-buffer-hook.
authorRichard M. Stallman <rms@gnu.org>
Fri, 5 Apr 1996 16:05:03 +0000 (16:05 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 5 Apr 1996 16:05:03 +0000 (16:05 +0000)
(electric-help-retain): Use remove-hook.

lisp/ehelp.el

index 5964157d748c4aa6047fefb8860e7f082b94db60..14401f7c9a50da7d9f1cf7e9e3b4de3c9d608852 100644 (file)
@@ -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 ()