diff options
| author | Lars Ingebrigtsen | 2019-07-13 17:48:53 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-13 17:48:53 +0200 |
| commit | 196ea8c4b3ff20c41b8202a1cce746ca54232cbd (patch) | |
| tree | 20e905667363849ba0b641945cdb9920f08527ab | |
| parent | 6c6e4e822847b148b759a4725ae46ad832c52882 (diff) | |
| download | emacs-196ea8c4b3ff20c41b8202a1cce746ca54232cbd.tar.gz emacs-196ea8c4b3ff20c41b8202a1cce746ca54232cbd.zip | |
Tweak output of doc in advice--make-docstring
* lisp/emacs-lisp/nadvice.el (advice--make-docstring): Make the
bit about the function/macro having an advice into a complete
sentence (bug#31063) and make it less dramatic.
| -rw-r--r-- | lisp/emacs-lisp/nadvice.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index b0dd03edfd5..b7c2dab0980 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el | |||
| @@ -87,8 +87,9 @@ Each element has the form (WHERE BYTECODE STACK) where: | |||
| 87 | "Build the raw docstring for FUNCTION, presumably advised." | 87 | "Build the raw docstring for FUNCTION, presumably advised." |
| 88 | (let* ((flist (indirect-function function)) | 88 | (let* ((flist (indirect-function function)) |
| 89 | (docfun nil) | 89 | (docfun nil) |
| 90 | (macrop (eq 'macro (car-safe flist))) | ||
| 90 | (docstring nil)) | 91 | (docstring nil)) |
| 91 | (if (eq 'macro (car-safe flist)) (setq flist (cdr flist))) | 92 | (if macrop (setq flist (cdr flist))) |
| 92 | (while (advice--p flist) | 93 | (while (advice--p flist) |
| 93 | (let ((doc (aref flist 4)) | 94 | (let ((doc (aref flist 4)) |
| 94 | (where (advice--where flist))) | 95 | (where (advice--where flist))) |
| @@ -100,10 +101,11 @@ Each element has the form (WHERE BYTECODE STACK) where: | |||
| 100 | (setq docstring | 101 | (setq docstring |
| 101 | (concat | 102 | (concat |
| 102 | docstring | 103 | docstring |
| 103 | (propertize (format "%s advice: " where) | 104 | (format "This %s has %s advice: " |
| 104 | 'face 'warning) | 105 | (if macrop "macro" "function") |
| 106 | where) | ||
| 105 | (let ((fun (advice--car flist))) | 107 | (let ((fun (advice--car flist))) |
| 106 | (if (symbolp fun) (format-message "`%S'" fun) | 108 | (if (symbolp fun) (format-message "`%S'." fun) |
| 107 | (let* ((name (cdr (assq 'name (advice--props flist)))) | 109 | (let* ((name (cdr (assq 'name (advice--props flist)))) |
| 108 | (doc (documentation fun t)) | 110 | (doc (documentation fun t)) |
| 109 | (usage (help-split-fundoc doc function))) | 111 | (usage (help-split-fundoc doc function))) |