diff options
| author | Richard M. Stallman | 1997-03-28 22:58:58 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-03-28 22:58:58 +0000 |
| commit | 9201fa0683b880f1ff0101f471b4b2243449ea51 (patch) | |
| tree | 1cea0f3e6a29c3236f9a4768cebd0a8827a69a30 | |
| parent | 4b1434c2cac71fa1099a609b2ea96c2809422e69 (diff) | |
| download | emacs-9201fa0683b880f1ff0101f471b4b2243449ea51.tar.gz emacs-9201fa0683b880f1ff0101f471b4b2243449ea51.zip | |
(with-electric-help): Remove hook on exit.
(electric-help-exit): Add doc string. Remove hook before exit.
| -rw-r--r-- | lisp/ehelp.el | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ehelp.el b/lisp/ehelp.el index c469c3d10f9..3656521f686 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el | |||
| @@ -150,7 +150,10 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit." | |||
| 150 | (if (eq (car-safe (electric-help-command-loop)) | 150 | (if (eq (car-safe (electric-help-command-loop)) |
| 151 | 'retain) | 151 | 'retain) |
| 152 | (setq config (current-window-configuration)) | 152 | (setq config (current-window-configuration)) |
| 153 | (setq bury t))) | 153 | (setq bury t)) |
| 154 | ;; Remove the hook. | ||
| 155 | (if (memq 'electric-help-retain mouse-leave-buffer-hook) | ||
| 156 | (remove-hook 'mouse-leave-buffer-hook 'electric-help-retain))) | ||
| 154 | (message "") | 157 | (message "") |
| 155 | (set-buffer buffer) | 158 | (set-buffer buffer) |
| 156 | (setq buffer-read-only nil) | 159 | (setq buffer-read-only nil) |
| @@ -221,9 +224,15 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit." | |||
| 221 | ; (scroll-up arg))) | 224 | ; (scroll-up arg))) |
| 222 | 225 | ||
| 223 | (defun electric-help-exit () | 226 | (defun electric-help-exit () |
| 224 | ">>>Doc" | 227 | "Exit `electric-help', restoring the previous window/buffer configuration. |
| 228 | \(The *Help* buffer will be buried.)" | ||
| 225 | (interactive) | 229 | (interactive) |
| 226 | (throw 'exit t)) | 230 | ;; Make sure that we don't throw twice, even if two events cause |
| 231 | ;; calling this function: | ||
| 232 | (if (memq 'electric-help-retain mouse-leave-buffer-hook) | ||
| 233 | (progn | ||
| 234 | (remove-hook 'mouse-leave-buffer-hook 'electric-help-retain) | ||
| 235 | (throw 'exit t)))) | ||
| 227 | 236 | ||
| 228 | (defun electric-help-retain () | 237 | (defun electric-help-retain () |
| 229 | "Exit `electric-help', retaining the current window/buffer configuration. | 238 | "Exit `electric-help', retaining the current window/buffer configuration. |