diff options
| author | Richard M. Stallman | 1993-05-26 19:12:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-26 19:12:18 +0000 |
| commit | c968e96c800fcbb89609bfcbe33689919eca3ae5 (patch) | |
| tree | 70e47a0a21e281f9d4a1c0f75e8a7013666cf965 | |
| parent | bc2ada626ab5102f645c23d755e4754988fced4b (diff) | |
| download | emacs-c968e96c800fcbb89609bfcbe33689919eca3ae5.tar.gz emacs-c968e96c800fcbb89609bfcbe33689919eca3ae5.zip | |
(make-help-screen): Handle mouse events.
Be smart about window configurations--when and whether to restore.
| -rw-r--r-- | lisp/help-macro.el | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/lisp/help-macro.el b/lisp/help-macro.el index 04699ae3875..d12db10a270 100644 --- a/lisp/help-macro.el +++ b/lisp/help-macro.el | |||
| @@ -81,30 +81,45 @@ from the HELPED-MAP and the corresponding interactive function is executed." | |||
| 81 | (let ((line-prompt | 81 | (let ((line-prompt |
| 82 | (substitute-command-keys (, help-line)))) | 82 | (substitute-command-keys (, help-line)))) |
| 83 | (message line-prompt) | 83 | (message line-prompt) |
| 84 | (let ((char (read-char))) | 84 | (let ((char (read-event)) |
| 85 | (if (or (= char ??) (= char help-char)) | 85 | config) |
| 86 | (save-window-excursion | 86 | (unwind-protect |
| 87 | (switch-to-buffer-other-window "*Help*") | 87 | (progn |
| 88 | (erase-buffer) | 88 | (if (or (eq char ??) (eq char help-char)) |
| 89 | (insert (documentation (quote (, fname)))) | 89 | (progn |
| 90 | (goto-char (point-min)) | 90 | (setq config (current-window-configuration)) |
| 91 | (while (memq char (cons help-char '(?? ?\C-v ?\ ?\177 ?\M-v))) | 91 | (switch-to-buffer-other-window "*Help*") |
| 92 | (if (memq char '(?\C-v ?\ )) | 92 | (erase-buffer) |
| 93 | (scroll-up)) | 93 | (insert (documentation (quote (, fname)))) |
| 94 | (if (memq char '(?\177 ?\M-v)) | 94 | (goto-char (point-min)) |
| 95 | (scroll-down)) | 95 | (while (memq char (cons help-char '(?? ?\C-v ?\ ?\177 ?\M-v))) |
| 96 | (message "%s%s: " | 96 | (if (memq char '(?\C-v ?\ )) |
| 97 | line-prompt | 97 | (scroll-up)) |
| 98 | (if (pos-visible-in-window-p (point-max)) | 98 | (if (memq char '(?\177 ?\M-v)) |
| 99 | "" " or Space to scroll")) | 99 | (scroll-down)) |
| 100 | (let ((cursor-in-echo-area t)) | 100 | (message "%s%s: " |
| 101 | (setq char (read-char)))))) | 101 | line-prompt |
| 102 | (let ((defn (cdr (assq (downcase char) (, helped-map))))) | 102 | (if (pos-visible-in-window-p (point-max)) |
| 103 | (if defn | 103 | "" " or Space to scroll")) |
| 104 | (if (keymapp defn) | 104 | (let ((cursor-in-echo-area t)) |
| 105 | (error "sorry, this command cannot be run from the help screen. Start over.") | 105 | (setq char (read-event)))))) |
| 106 | (call-interactively defn)) | 106 | |
| 107 | (ding)))))) | 107 | (let ((defn (cdr (assq (if (integerp char) (downcase char) char) (, helped-map))))) |
| 108 | (if defn | ||
| 109 | (if (keymapp defn) | ||
| 110 | (error "sorry, this command cannot be run from the help screen. Start over.") | ||
| 111 | (if config | ||
| 112 | (progn | ||
| 113 | (set-window-configuration config) | ||
| 114 | (setq config nil))) | ||
| 115 | (call-interactively defn)) | ||
| 116 | (if (listp char) | ||
| 117 | (setq unread-command-events | ||
| 118 | (cons char unread-command-events) | ||
| 119 | config nil) | ||
| 120 | (ding))))) | ||
| 121 | (if config | ||
| 122 | (set-window-configuration config)))))) | ||
| 108 | )) | 123 | )) |
| 109 | 124 | ||
| 110 | ;;; help-macro.el | 125 | ;;; help-macro.el |