emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c12838c73e: * lisp/help-fns.el: Minor fixes


From: Stefan Monnier
Subject: master c12838c73e: * lisp/help-fns.el: Minor fixes
Date: Fri, 2 Sep 2022 09:54:40 -0400 (EDT)

branch: master
commit c12838c73ef161850a081f9ccea6e375b7c2f93b
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * 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 1ccf9bb428..88e553c1a0 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]