X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d7a0267c8d6be2a9885de797b25ec8f4a61b8895..62b84d364597b0bd88864fc5e1ed689ef0b3e866:/lisp/help.el diff --git a/lisp/help.el b/lisp/help.el index 8aa9ba6c46..4a94fd35bc 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -491,6 +491,7 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer." "Where is command: ") obarray 'commandp t)) (list (if (equal val "") fn (intern val)) current-prefix-arg))) + (unless definition (error "No command")) (let ((func (indirect-function definition)) (defs nil) (standard-output (if insert (current-buffer) t))) @@ -641,7 +642,7 @@ temporarily enables it to allow getting help on disabled items and buttons." (list key (prefix-numeric-value current-prefix-arg) - ;; If KEY is a down-event, read and discard the + ;; If KEY is a down-event, read and include the ;; corresponding up-event. Note that there are also ;; down-events on scroll bars and mode lines: the actual ;; event then is in the second element of the vector. @@ -957,14 +958,14 @@ This applies to `help', `apropos' and `completion' buffers, and some others." (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window))) (defun resize-temp-buffer-window () - "Resize the current window to fit its contents. + "Resize the selected window to fit its contents. Will not make it higher than `temp-buffer-max-height' nor smaller than `window-min-height'. Do nothing if it is the only window on its frame, if it is not as wide as the frame or if some of the window's contents are scrolled out of view." (unless (or (one-window-p 'nomini) (not (pos-visible-in-window-p (point-min))) - (/= (frame-width) (window-width))) + (not (window-full-width-p))) (fit-window-to-buffer (selected-window) (if (functionp temp-buffer-max-height)