From c12838c73ef161850a081f9ccea6e375b7c2f93b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 2 Sep 2022 09:54:13 -0400 Subject: [PATCH] * lisp/help-fns.el: Minor fixes (describe-mode--minor-modes): Don't burp on minor modes that lack a docstring. (describe-mode--minor-modes): Simplify eta-redex. (find-lisp-object-file-name): Use `autoload-file`. (help-fns--describe-function-or-command-prompt): Allow the user to insist on choosing a function even if it appears not to exist. --- lisp/help-fns.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1ccf9bb4281..88e553c1a05 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -229,7 +229,7 @@ interactive command." (lambda (f) (if want-command (commandp f) (or (fboundp f) (get f 'function-documentation)))) - t nil nil + 'confirm nil nil (and fn (symbol-name fn))))) (unless (equal val "") (setq fn (intern val))) @@ -424,7 +424,7 @@ If ALSO-C-SOURCE is non-nil, instead of returning `C-source', this function will attempt to locate the definition of OBJECT in the C sources, too." (let* ((autoloaded (autoloadp type)) - (file-name (or (and autoloaded (nth 1 type)) + (file-name (or (and autoloaded (autoload-file type)) (symbol-file ;; FIXME: Why do we have this weird "If TYPE is the ;; value returned by `symbol-function' for a function @@ -2179,8 +2179,7 @@ documentation for the major and minor modes of that buffer." ;; Document the minor modes fully. (insert (buttonize (propertize pretty-minor-mode 'help-minor-mode mode) - (lambda (mode) - (describe-function mode)) + #'describe-function mode)) (let ((indicator (format-mode-line (assq mode minor-mode-alist)))) @@ -2189,7 +2188,8 @@ documentation for the major and minor modes of that buffer." "no indicator" (format "indicator%s" indicator))))) - (insert (help-split-fundoc (documentation mode) nil 'doc))))) + (insert (or (help-split-fundoc (documentation mode) nil 'doc) + "No docstring"))))) (forward-line -1) (fill-paragraph nil) (forward-paragraph 1) -- 2.39.2