diff options
| author | Lars Ingebrigtsen | 2021-11-02 16:20:15 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-11-02 16:20:19 +0100 |
| commit | cd73ec72a6c864a8979fa1041df8618fe67cf480 (patch) | |
| tree | 87e4dc90a0061bb509969683c47640cc7f977bb1 | |
| parent | 4f851c2357cb8a09024432f2c6e061907311ce43 (diff) | |
| download | emacs-cd73ec72a6c864a8979fa1041df8618fe67cf480.tar.gz emacs-cd73ec72a6c864a8979fa1041df8618fe67cf480.zip | |
Make lambdas/closures/byte code in `C-h b' clickable
* lisp/help.el (help--describe-command): Add links for
lambdas/closures/byte code (bug#24235).
* lisp/emacs-lisp/pp.el (pp-display-expression): Autoload.
| -rw-r--r-- | lisp/emacs-lisp/pp.el | 1 | ||||
| -rw-r--r-- | lisp/help.el | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 0bf774dffd8..4ff2cd59eba 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el | |||
| @@ -85,6 +85,7 @@ can handle, whenever this is possible. | |||
| 85 | Output stream is STREAM, or value of `standard-output' (which see)." | 85 | Output stream is STREAM, or value of `standard-output' (which see)." |
| 86 | (princ (pp-to-string object) (or stream standard-output))) | 86 | (princ (pp-to-string object) (or stream standard-output))) |
| 87 | 87 | ||
| 88 | ;;;###autoload | ||
| 88 | (defun pp-display-expression (expression out-buffer-name) | 89 | (defun pp-display-expression (expression out-buffer-name) |
| 89 | "Prettify and display EXPRESSION in an appropriate way, depending on length. | 90 | "Prettify and display EXPRESSION in an appropriate way, depending on length. |
| 90 | If a temporary buffer is needed for representation, it will be named | 91 | If a temporary buffer is needed for representation, it will be named |
diff --git a/lisp/help.el b/lisp/help.el index 77c5d124deb..9f7e1a90cf4 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -1352,10 +1352,16 @@ Return nil if the key sequence is too long." | |||
| 1352 | ((keymapp definition) | 1352 | ((keymapp definition) |
| 1353 | (insert "Prefix Command\n")) | 1353 | (insert "Prefix Command\n")) |
| 1354 | ((byte-code-function-p definition) | 1354 | ((byte-code-function-p definition) |
| 1355 | (insert "[byte-code]\n")) | 1355 | (insert "[%s]\n" |
| 1356 | (button-buttonize "byte-code" #'disassemble definition))) | ||
| 1356 | ((and (consp definition) | 1357 | ((and (consp definition) |
| 1357 | (memq (car definition) '(closure lambda))) | 1358 | (memq (car definition) '(closure lambda))) |
| 1358 | (insert (format "[%s]\n" (car definition)))) | 1359 | (insert (format "[%s]\n" |
| 1360 | (button-buttonize | ||
| 1361 | (symbol-name (car definition)) | ||
| 1362 | (lambda (_) | ||
| 1363 | (pp-display-expression | ||
| 1364 | definition "*Help Source*")))))) | ||
| 1359 | (t | 1365 | (t |
| 1360 | (insert "??\n")))) | 1366 | (insert "??\n")))) |
| 1361 | 1367 | ||