Mercurial > emacs
comparison lisp/ehelp.el @ 14943:2c44547d2364
(electric-help-mode): Use add-hook mouse-leave-buffer-hook.
(electric-help-retain): Use remove-hook.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 05 Apr 1996 16:05:03 +0000 |
parents | b4879ed5b5c3 |
children | f1e444468043 |
comparison
equal
deleted
inserted
replaced
14942:3432e5570488 | 14943:2c44547d2364 |
---|---|
86 (setq buffer-read-only t) | 86 (setq buffer-read-only t) |
87 (setq mode-name "Help") | 87 (setq mode-name "Help") |
88 (setq major-mode 'help) | 88 (setq major-mode 'help) |
89 (setq mode-line-buffer-identification '(" Help: %b")) | 89 (setq mode-line-buffer-identification '(" Help: %b")) |
90 (use-local-map electric-help-map) | 90 (use-local-map electric-help-map) |
91 (setq mouse-leave-buffer-hook '(electric-help-retain)) | 91 (add-hook 'mouse-leave-buffer-hook 'electric-help-retain) |
92 (view-mode -1) | 92 (view-mode -1) |
93 ;; this is done below in with-electric-help | 93 ;; this is done below in with-electric-help |
94 ;(run-hooks 'electric-help-mode-hook) | 94 ;(run-hooks 'electric-help-mode-hook) |
95 ) | 95 ) |
96 | 96 |
230 \(The *Help* buffer will not be selected, but \\[switch-to-buffer-other-window] RET | 230 \(The *Help* buffer will not be selected, but \\[switch-to-buffer-other-window] RET |
231 will select it.)" | 231 will select it.)" |
232 (interactive) | 232 (interactive) |
233 ;; Make sure that we don't throw twice, even if two events cause | 233 ;; Make sure that we don't throw twice, even if two events cause |
234 ;; calling this function: | 234 ;; calling this function: |
235 (if mouse-leave-buffer-hook | 235 (if (memq 'electric-help-retain mouse-leave-buffer-hook) |
236 (progn | 236 (progn |
237 (setq mouse-leave-buffer-hook nil) | 237 (remove-hook 'mouse-leave-buffer-hook 'electric-help-retain) |
238 (throw 'exit '(retain))))) | 238 (throw 'exit '(retain))))) |
239 | 239 |
240 | 240 |
241 (defun electric-help-undefined () | 241 (defun electric-help-undefined () |
242 (interactive) | 242 (interactive) |
243 (error "%s is undefined -- Press %s to exit" | 243 (error "%s is undefined -- Press %s to exit" |