]> git.eshelyaron.com Git - emacs.git/commitdiff
(advice--make-nadvice-docstring): Rename
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Mar 2025 03:18:02 +0000 (22:18 -0500)
committerEshel Yaron <me@eshelyaron.com>
Tue, 4 Mar 2025 21:05:24 +0000 (22:05 +0100)
* lisp/emacs-lisp/nadvice.el (advice--make-nadvice-docstring): Rename
from `nadvice--make-docstring`, to stick to the `advice-` namespace.
Update all callers.

(cherry picked from commit 035077febe34b0df871bb3b6e1c81fc2bfdc4059)

lisp/emacs-lisp/nadvice.el

index 14a0cacad24e13be961844ecf7c6e3fd92543c0f..6d50a646a7fe3d1fa09f58aa329f2a1d0177dbce 100644 (file)
@@ -151,7 +151,8 @@ DOC is a string where \"FUNCTION\" and \"OLDFUN\" are expected.")
                         ;; definition is loaded]", bug#21299
                         (if (stringp arglist) t
                           (help--make-usage-docstring function arglist)))
-                    (setq origdoc (cdr usage)) (car usage)))
+                    (setq origdoc (cdr usage))
+                    (car usage)))
       (help-add-fundoc-usage
        (with-temp-buffer
          (when before
@@ -319,7 +320,10 @@ These functions act like the t special value in buffer-local hooks.")
           ((symbolp place)              `(default-value ',place))
           (t place))))
 
-(defun nadvice--make-docstring (sym)
+(defun advice--make-nadvice-docstring (sym)
+  "Make docstring for a nadvice function.
+Modifies the function's docstring by replacing \"<<>>\" with the
+description of the possible HOWs."
   (let* ((main (documentation (symbol-function sym) 'raw))
          (ud (help-split-fundoc main 'pcase))
          (doc (or (cdr ud) main))
@@ -340,7 +344,7 @@ These functions act like the t special value in buffer-local hooks.")
     (if ud (help-add-fundoc-usage combined-doc (car ud)) combined-doc)))
 
 (put 'add-function 'function-documentation
-     '(nadvice--make-docstring 'add-function))
+     '(advice--make-nadvice-docstring 'add-function))
 
 ;;;###autoload
 (defmacro add-function (how place function &optional props)
@@ -498,7 +502,7 @@ of the piece of advice."
       (funcall fsetfun symbol newdef))))
 
 (put 'advice-add 'function-documentation
-     '(nadvice--make-docstring 'advice-add))
+     '(advice--make-nadvice-docstring 'advice-add))
 
 ;;;###autoload
 (defun advice-add (symbol how function &optional props)