From: Stefan Monnier Date: Tue, 4 Mar 2025 03:18:02 +0000 (-0500) Subject: (advice--make-nadvice-docstring): Rename X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d92aa6bc9aaa4a65d54d92c641aeb5158923bae6;p=emacs.git (advice--make-nadvice-docstring): Rename * 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) --- diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index 14a0cacad24..6d50a646a7f 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -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)