Improve docstring for def-advice! functions
Now lists linked functions that the advice was defined with.
This commit is contained in:
parent
76cacb5bfe
commit
83763414fb
1 changed files with 8 additions and 4 deletions
|
@ -368,11 +368,15 @@ DOCSTRING and BODY are as in `defun'."
|
||||||
(push places body)
|
(push places body)
|
||||||
(setq places where
|
(setq places where
|
||||||
where docstring
|
where docstring
|
||||||
docstring (format "%s advice for %s." where places)))
|
docstring nil))
|
||||||
`(progn
|
`(progn
|
||||||
(defun ,symbol ,arglist
|
(fset ',symbol (lambda ,arglist ,@body))
|
||||||
,docstring
|
(put ',symbol 'function-documentation
|
||||||
,@body)
|
(format "%sThis is %s advice for the following functions: %s"
|
||||||
|
,(if docstring (concat docstring "\n\n") "")
|
||||||
|
,where
|
||||||
|
(mapconcat (lambda (p) (format "`%s'" p))
|
||||||
|
(doom-enlist ,places) ", ")))
|
||||||
(dolist (target (doom-enlist ,places))
|
(dolist (target (doom-enlist ,places))
|
||||||
(if (eq ,where :remove)
|
(if (eq ,where :remove)
|
||||||
(advice-remove target #',symbol)
|
(advice-remove target #',symbol)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue