diff --git a/core/core-lib.el b/core/core-lib.el index cbd77d4d8..8fed37ce4 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -368,11 +368,15 @@ DOCSTRING and BODY are as in `defun'." (push places body) (setq places where where docstring - docstring (format "%s advice for %s." where places))) + docstring nil)) `(progn - (defun ,symbol ,arglist - ,docstring - ,@body) + (fset ',symbol (lambda ,arglist ,@body)) + (put ',symbol 'function-documentation + (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)) (if (eq ,where :remove) (advice-remove target #',symbol)