diff options
| author | Chong Yidong <cyd@gnu.org> | 2014-01-03 13:37:58 +0800 |
|---|---|---|
| committer | Chong Yidong <cyd@gnu.org> | 2014-01-03 13:37:58 +0800 |
| commit | 0d53f628be877abf2da4693df620d91d474ec058 (patch) | |
| tree | 338b0147ef2192cb087849636437d287ea032012 /lisp/emacs-lisp/nadvice.el | |
| parent | 6ef9aed822746c3daf05313bbc0df7dfa9f08171 (diff) | |
| download | emacs-0d53f628be877abf2da4693df620d91d474ec058.tar.gz | |
Remove the dynamic-docstring-function feature.
* emacs-lisp/advice.el (ad--make-advised-docstring): Change args.
Ignore function-documentation property when getting documentation.
(ad-activate-advised-definition): Use function-documentation
generate the docstring.
(ad-make-advised-definition): Don't call
ad-make-advised-definition-docstring.
(ad-make-advised-definition-docstring, ad-advised-definition-p):
Delete functions.
* emacs-lisp/nadvice.el (advice--make-docstring): Change args.
(advice--docstring): Delete variable.
(advice--make-1): Leave the docstring empty.
(advice-add): Use function-documentation for advised docstring.
* progmodes/sql.el (sql-help): Use function-documentation instead
of dynamic-docstring-function property. No need to autoload now.
(sql--help-docstring): New variable.
(sql--make-help-docstring): Use it.
* doc.c (Fdocumentation): Remove dynamic-docstring-function.
Diffstat (limited to 'lisp/emacs-lisp/nadvice.el')
| -rw-r--r-- | lisp/emacs-lisp/nadvice.el | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index 97b7eec686a..3dfeb04a9b3 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -67,8 +67,8 @@ Each element has the form (WHERE BYTECODE STACK) where: (defsubst advice--cdr (f) (aref (aref f 2) 2)) (defsubst advice--props (f) (aref (aref f 2) 3)) -(defun advice--make-docstring (_string function) - "Build the raw doc-string of SYMBOL, presumably advised." +(defun advice--make-docstring (function) + "Build the raw docstring for FUNCTION, presumably advised." (let ((flist (indirect-function function)) (docstring nil)) (if (eq 'macro (car-safe flist)) (setq flist (cdr flist))) @@ -105,13 +105,6 @@ Each element has the form (WHERE BYTECODE STACK) where: (setq origdoc (cdr usage)) (car usage))) (help-add-fundoc-usage (concat docstring origdoc) usage)))) -(defvar advice--docstring - ;; Can't eval-when-compile nor use defconst because it then gets pure-copied, - ;; which drops the text-properties. - ;;(eval-when-compile - (propertize "Advised function" - 'dynamic-docstring-function #'advice--make-docstring)) ;; ) - (defun advice-eval-interactive-spec (spec) "Evaluate the interactive spec SPEC." (cond @@ -144,7 +137,7 @@ Each element has the form (WHERE BYTECODE STACK) where: (advice (apply #'make-byte-code 128 byte-code (vector #'apply function main props) stack-depth - advice--docstring + nil (and (or (commandp function) (commandp main)) (not (and (symbolp main) ;; Don't autoload too eagerly! (autoloadp (symbol-function main)))) @@ -370,7 +363,6 @@ of the piece of advice." (unless (eq oldadv (get symbol 'advice--pending)) (put symbol 'advice--pending (advice--subst-main oldadv nil))) (funcall fsetfun symbol newdef)))) - ;;;###autoload (defun advice-add (symbol where function &optional props) @@ -398,6 +390,7 @@ is defined as a macro, alias, command, ..." (get symbol 'advice--pending)) (t (symbol-function symbol))) function props) + (put symbol 'function-documentation `(advice--make-docstring ',symbol)) (add-function :around (get symbol 'defalias-fset-function) #'advice--defalias-fset)) nil) |
