diff options
| -rw-r--r-- | lisp/emacs-lisp/pcase.el | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index ce148c9e1a9..6e8f08e699a 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el | |||
| @@ -199,15 +199,30 @@ Emacs Lisp manual for more information and examples." | |||
| 199 | (require 'help-fns) | 199 | (require 'help-fns) |
| 200 | (with-temp-buffer | 200 | (with-temp-buffer |
| 201 | (insert (or (cdr ud) main)) | 201 | (insert (or (cdr ud) main)) |
| 202 | (mapatoms | 202 | ;; Presentation Note: For conceptual continuity, we guarantee |
| 203 | (lambda (symbol) | 203 | ;; that backquote doc immediately follows main pcase doc. |
| 204 | (let ((me (get symbol 'pcase-macroexpander))) | 204 | ;; (The order of the other extensions is unimportant.) |
| 205 | (when me | 205 | (let (more) |
| 206 | (insert "\n\n-- ") | 206 | ;; Collect all the extensions. |
| 207 | (let* ((doc (documentation me 'raw))) | 207 | (mapatoms (lambda (symbol) |
| 208 | (setq doc (help-fns--signature symbol doc me | 208 | (let ((me (get symbol 'pcase-macroexpander))) |
| 209 | (indirect-function me) nil)) | 209 | (when me |
| 210 | (insert "\n" (or doc "Not documented."))))))) | 210 | (push (cons symbol me) |
| 211 | more))))) | ||
| 212 | ;; Ensure backquote is first. | ||
| 213 | (let ((x (assq '\` more))) | ||
| 214 | (setq more (cons x (delq x more)))) | ||
| 215 | ;; Do the output. | ||
| 216 | (while more | ||
| 217 | (let* ((pair (pop more)) | ||
| 218 | (symbol (car pair)) | ||
| 219 | (me (cdr pair)) | ||
| 220 | (doc (documentation me 'raw))) | ||
| 221 | (insert "\n\n-- ") | ||
| 222 | (setq doc (help-fns--signature symbol doc me | ||
| 223 | (indirect-function me) | ||
| 224 | nil)) | ||
| 225 | (insert "\n" (or doc "Not documented."))))) | ||
| 211 | (let ((combined-doc (buffer-string))) | 226 | (let ((combined-doc (buffer-string))) |
| 212 | (if ud (help-add-fundoc-usage combined-doc (car ud)) combined-doc))))) | 227 | (if ud (help-add-fundoc-usage combined-doc (car ud)) combined-doc))))) |
| 213 | 228 | ||