comparison lisp/help-macro.el @ 3128:2417a8dc0f14

(make-help-screen): Handle mouse events. Be smart about window configurations--when and whether to restore.
author Richard M. Stallman <rms@gnu.org>
date Wed, 26 May 1993 19:12:18 +0000
parents 479c78c63f89
children 32a291ab0c5f
comparison
equal deleted inserted replaced
3127:dfbada800489 3128:2417a8dc0f14
79 (, help-text) 79 (, help-text)
80 (interactive) 80 (interactive)
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
111 126