comparison lisp/prim/help.el @ 44:8d2a9b52c682 r19-15prefinal

Import from CVS: tag r19-15prefinal
author cvs
date Mon, 13 Aug 2007 08:55:10 +0200
parents 1a767b41a199
children 131b0175ea99
comparison
equal deleted inserted replaced
43:23cafc5d2038 44:8d2a9b52c682
345 (defvar help-selects-help-window t 345 (defvar help-selects-help-window t
346 "*If nil, use the \"old Emacs\" behavior for Help buffers. 346 "*If nil, use the \"old Emacs\" behavior for Help buffers.
347 This just displays the buffer in another window, rather than selecting 347 This just displays the buffer in another window, rather than selecting
348 the window.") 348 the window.")
349 349
350 (defvar help-window-max-height .5
351 "*Proportion of frame to use for help windows.")
352 ;; Use this function for displaying help when C-h something is pressed 350 ;; Use this function for displaying help when C-h something is pressed
353 ;; or in similar situations. Do *not* use it when you are displaying 351 ;; or in similar situations. Do *not* use it when you are displaying
354 ;; a help message and then prompting for input in the minibuffer -- 352 ;; a help message and then prompting for input in the minibuffer --
355 ;; this macro usually selects the help buffer, which is not what you 353 ;; this macro usually selects the help buffer, which is not what you
356 ;; want in those situations. 354 ;; want in those situations.
388 (was-one-window 386 (was-one-window
389 (message 387 (message
390 (substitute-command-keys "Type \\[delete-other-windows] to remove help window, \\[scroll-other-window] to scroll the help."))) 388 (substitute-command-keys "Type \\[delete-other-windows] to remove help window, \\[scroll-other-window] to scroll the help.")))
391 (t 389 (t
392 (message 390 (message
393 (substitute-command-keys "Type \\[switch-to-buffer-other-window] to restore the other window, \\[scroll-other-window] to scroll the help.")))) 391 (substitute-command-keys "Type \\[switch-to-buffer-other-window] to restore the other window, \\[scroll-other-window] to scroll the help."))))))))))
394 (when temp-buffer-shrink-to-fit
395 (let* ((help-window-size (round (* help-window-max-height
396 (frame-height (window-frame helpwin)))))
397 (size (window-displayed-height helpwin)))
398 (if (< size help-window-size)
399 (enlarge-window (- help-window-size size) nil helpwin)))
400 (shrink-window-if-larger-than-buffer helpwin))))))))
401 392
402 (defun describe-key (key) 393 (defun describe-key (key)
403 "Display documentation of the function invoked by KEY. 394 "Display documentation of the function invoked by KEY.
404 KEY is a string, or vector of events. 395 KEY is a string, or vector of events.
405 When called interactively, KEY may also be a menu selection." 396 When called interactively, KEY may also be a menu selection."