[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 61323c6 3/3: Put advice documentation at the end of the displayed
From: |
Lars Ingebrigtsen |
Subject: |
master 61323c6 3/3: Put advice documentation at the end of the displayed doc string |
Date: |
Fri, 27 Aug 2021 11:15:24 -0400 (EDT) |
branch: master
commit 61323c6d765a478ffd8c659fe0e805814d9fecb1
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Put advice documentation at the end of the displayed doc string
* lisp/emacs-lisp/nadvice.el (advice--make-docstring): Put the
advice things at the end of the documentation (bug#50222). It's
important to have the first line of the original documentation
remain the first line, because it's used when doing one-line
summaries of the function.
---
lisp/emacs-lisp/nadvice.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index 4804e85..bb86fa1 100644
--- a/lisp/emacs-lisp/nadvice.el
+++ b/lisp/emacs-lisp/nadvice.el
@@ -119,7 +119,6 @@ Each element has the form (WHERE BYTECODE STACK) where:
(or doc "No documentation")))))
"\n")))
(setq flist (advice--cdr flist)))
- (if docstring (setq docstring (concat docstring "\n")))
(unless docfun (setq docfun flist))
(let* ((origdoc (unless (eq function docfun) ;Avoid inf-loops.
(documentation docfun t)))
@@ -131,7 +130,12 @@ Each element has the form (WHERE BYTECODE STACK) where:
(if (stringp arglist) t
(help--make-usage-docstring function arglist)))
(setq origdoc (cdr usage)) (car usage)))
- (help-add-fundoc-usage (concat docstring origdoc) usage))))
+ (help-add-fundoc-usage (concat origdoc
+ (if (string-suffix-p "\n" origdoc)
+ "\n"
+ "\n\n")
+ docstring)
+ usage))))
(defun advice-eval-interactive-spec (spec)
"Evaluate the interactive spec SPEC."