emacs-diffs
[Top][All Lists]
Advanced

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

master 53edc2b 2/2: Move the indented *Help* block to after the doc stri


From: Lars Ingebrigtsen
Subject: master 53edc2b 2/2: Move the indented *Help* block to after the doc string
Date: Wed, 8 Sep 2021 02:50:36 -0400 (EDT)

branch: master
commit 53edc2ba8ec9bf13706cd99ae00107d38bec00cc
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Move the indented *Help* block to after the doc string
    
    * lisp/help-fns.el (describe-function-1): Move indented admin
    block to the end (bug#50463).
    (describe-variable): Ditto (bug#50463).
---
 etc/NEWS         |  6 ++++++
 lisp/help-fns.el | 28 ++++++++++++++--------------
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 2275fa4..f43fa74 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -513,6 +513,12 @@ built without SVG support, the old icons will be used 
instead.
 
 ** Help
 
+---
+*** The order things are displayed in the *Help* buffer has been changed.
+The indented "administrative" block (containing the "probably
+introduced" and "other relevant functions" (and similar things) has
+been moved to after the doc string.
+
 +++
 *** New command 'describe-command' shows help for a command.
 This can be used instead of 'describe-function' for interactive
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 3eefdd1..756eb83 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -960,10 +960,9 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED 
REAL-DEF)."
                    ;; E.g. an alias for a not yet defined function.
                    ((invalid-function void-function) doc-raw))))
         (help-fns--ensure-empty-line)
+        (insert (or doc "Not documented."))
         (help-fns--run-describe-functions
-         help-fns-describe-function-functions function)
-        (help-fns--ensure-empty-line)
-        (insert (or doc "Not documented.")))
+         help-fns-describe-function-functions function))
       ;; Avoid asking the user annoying questions if she decides
       ;; to save the help buffer, when her locale's codeset
       ;; isn't UTF-8.
@@ -1197,10 +1196,6 @@ it is displayed along with the global value."
                ;; of a symbol.
                (set-syntax-table emacs-lisp-mode-syntax-table)
                (goto-char val-start-pos)
-               ;; The line below previously read as
-               ;; (delete-region (point) (progn (end-of-line) (point)))
-               ;; which suppressed display of the buffer local value for
-               ;; large values.
                (when (looking-at "value is") (replace-match ""))
                (save-excursion
                  (insert "\n\nValue:")
@@ -1221,27 +1216,32 @@ it is displayed along with the global value."
                             (documentation-property
                              alias 'variable-documentation))))
 
+             (with-current-buffer standard-output
+               (insert (or doc "Not documented as a variable.")))
+
+              ;; Output the indented administrative bits.
               (with-current-buffer buffer
                 (help-fns--run-describe-functions
-                 help-fns-describe-variable-functions variable))
-
-              (with-current-buffer standard-output
-                (help-fns--ensure-empty-line))
-             (with-current-buffer standard-output
-               (insert (or doc "Not documented as a variable."))))
+                 help-fns-describe-variable-functions variable)))
 
            (with-current-buffer standard-output
              ;; Return the text we displayed.
              (buffer-string))))))))
 
 (defun help-fns--run-describe-functions (functions &rest args)
+  (with-current-buffer standard-output
+    (unless (bolp)
+      (insert "\n"))
+    (help-fns--ensure-empty-line))
   (let ((help-fns--activated-functions nil))
     (dolist (func functions)
       (let ((size (buffer-size standard-output)))
         (apply func args)
         ;; This function inserted something, so register it.
         (when (> (buffer-size) size)
-          (push func help-fns--activated-functions))))))
+          (push func help-fns--activated-functions)))))
+  (with-current-buffer standard-output
+    (help-fns--ensure-empty-line)))
 
 (add-hook 'help-fns-describe-variable-functions #'help-fns--customize-variable)
 (defun help-fns--customize-variable (variable &optional text)



reply via email to

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