comparison lisp/ehelp.el @ 36240:5432010ffe02

(with-electric-help): Doc fix.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 20 Feb 2001 19:20:11 +0000
parents bad7093b5361
children ca2938d86ae9
comparison
equal deleted inserted replaced
36239:d575589dbcf8 36240:5432010ffe02
124 124
125 If THUNK returns nil, we display BUFFER starting at the top, and 125 If THUNK returns nil, we display BUFFER starting at the top, and
126 shrink the window to fit if `electric-help-shrink-window' is non-nil. 126 shrink the window to fit if `electric-help-shrink-window' is non-nil.
127 If THUNK returns non-nil, we don't do those things. 127 If THUNK returns non-nil, we don't do those things.
128 128
129 When the user exits (with `electric-help-exit', or otherwise) the help 129 When the user exits (with `electric-help-exit', or otherwise), the help
130 buffer's window disappears (i.e., we use `save-window-excursion') 130 buffer's window disappears (i.e., we use `save-window-excursion'), and
131 BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit." 131 BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit."
132 (setq buffer (get-buffer-create (or buffer "*Help*"))) 132 (setq buffer (get-buffer-create (or buffer "*Help*")))
133 (let ((one (one-window-p t)) 133 (let ((one (one-window-p t))
134 (config (current-window-configuration)) 134 (config (current-window-configuration))
135 (bury nil) 135 (bury nil)
168 (set-buffer buffer) 168 (set-buffer buffer)
169 (setq buffer-read-only nil) 169 (setq buffer-read-only nil)
170 170
171 ;; We should really get a usable *Help* buffer when retaining 171 ;; We should really get a usable *Help* buffer when retaining
172 ;; the electric one with `r'. The problem is that a simple 172 ;; the electric one with `r'. The problem is that a simple
173 ;; call to help-mode won't cut it; at least RET is vound wrong 173 ;; call to help-mode won't cut it; at least RET is bound wrong
174 ;; afterwards. It's also not clear that `help-mode' is always 174 ;; afterwards. It's also not clear that `help-mode' is always
175 ;; the right thing, maybe we should add an optional parameter. 175 ;; the right thing, maybe we should add an optional parameter.
176 (condition-case () 176 (condition-case ()
177 (funcall (or default-major-mode 'fundamental-mode)) 177 (funcall (or default-major-mode 'fundamental-mode))
178 (error nil)) 178 (error nil))
179 179
180 (set-window-configuration config) 180 (set-window-configuration config)
181 (when bury 181 (when bury
182 ;;>> Perhaps this shouldn't be done. 182 ;;>> Perhaps this shouldn't be done,
183 ;; so that when we say "Press space to bury" we mean it 183 ;; so that when we say "Press space to bury" we mean it
184 (replace-buffer-in-windows buffer) 184 (replace-buffer-in-windows buffer)
185 ;; must do this outside of save-window-excursion 185 ;; must do this outside of save-window-excursion
186 (bury-buffer buffer)) 186 (bury-buffer buffer))
187 (eval electric-help-form-to-execute)))) 187 (eval electric-help-form-to-execute))))