aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2025-03-03 22:18:02 -0500
committerStefan Monnier2025-03-03 22:18:02 -0500
commit035077febe34b0df871bb3b6e1c81fc2bfdc4059 (patch)
treefb77431f8f73b3ea13f85d661e9df9ba8311aaba
parent93c3a269ca45f6165b4181de2386517e95d07116 (diff)
downloademacs-035077febe34b0df871bb3b6e1c81fc2bfdc4059.tar.gz
emacs-035077febe34b0df871bb3b6e1c81fc2bfdc4059.zip
(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.
-rw-r--r--lisp/emacs-lisp/nadvice.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
index 150332c4c5d..1172338e7ca 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.")
151 ;; definition is loaded]", bug#21299 151 ;; definition is loaded]", bug#21299
152 (if (stringp arglist) t 152 (if (stringp arglist) t
153 (help--make-usage-docstring function arglist))) 153 (help--make-usage-docstring function arglist)))
154 (setq origdoc (cdr usage)) (car usage))) 154 (setq origdoc (cdr usage))
155 (car usage)))
155 (help-add-fundoc-usage 156 (help-add-fundoc-usage
156 (with-temp-buffer 157 (with-temp-buffer
157 (when before 158 (when before
@@ -319,7 +320,10 @@ These functions act like the t special value in buffer-local hooks.")
319 ((symbolp place) `(default-value ',place)) 320 ((symbolp place) `(default-value ',place))
320 (t place)))) 321 (t place))))
321 322
322(defun nadvice--make-docstring (sym) 323(defun advice--make-nadvice-docstring (sym)
324 "Make docstring for a nadvice function.
325Modifies the function's docstring by replacing \"<<>>\" with the
326description of the possible HOWs."
323 (let* ((main (documentation (symbol-function sym) 'raw)) 327 (let* ((main (documentation (symbol-function sym) 'raw))
324 (ud (help-split-fundoc main 'pcase)) 328 (ud (help-split-fundoc main 'pcase))
325 (doc (or (cdr ud) main)) 329 (doc (or (cdr ud) main))
@@ -340,7 +344,7 @@ These functions act like the t special value in buffer-local hooks.")
340 (if ud (help-add-fundoc-usage combined-doc (car ud)) combined-doc))) 344 (if ud (help-add-fundoc-usage combined-doc (car ud)) combined-doc)))
341 345
342(put 'add-function 'function-documentation 346(put 'add-function 'function-documentation
343 '(nadvice--make-docstring 'add-function)) 347 '(advice--make-nadvice-docstring 'add-function))
344 348
345;;;###autoload 349;;;###autoload
346(defmacro add-function (how place function &optional props) 350(defmacro add-function (how place function &optional props)
@@ -498,7 +502,7 @@ of the piece of advice."
498 (funcall fsetfun symbol newdef)))) 502 (funcall fsetfun symbol newdef))))
499 503
500(put 'advice-add 'function-documentation 504(put 'advice-add 'function-documentation
501 '(nadvice--make-docstring 'advice-add)) 505 '(advice--make-nadvice-docstring 'advice-add))
502 506
503;;;###autoload 507;;;###autoload
504(defun advice-add (symbol how function &optional props) 508(defun advice-add (symbol how function &optional props)