branch: externals/inspector
commit 88ac725f24fc7bfb957a6ce725da1cc5f0ea4273
Merge: 536f6397a5 f5e486882e
Author: Mariano Montone <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #39 from krisbalintona/push-qpsyltxnmtkt
Define command to inspect Help buffer's symbol
---
README.md | 4 ++++
inspector.el | 16 ++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/README.md b/README.md
index 8f6fd5645d..f8b49c3cf7 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,10 @@ When on an Emacs debugging backtrace, press letter `i` to
inspect the pointed fr
When on edebug-mode, use `C-c C-i` for inspecting expressions in the debugger.
+### From Help buffers
+
+When in a *Help* buffer, such as the ones created from `describe-function`,
`describe-variable`, `describe-keymap`, and `describe-symbol`, you can use M-x
`inspector-inspect-help-buffer-expression` to inspect the symbol associated
with that Help buffer.
+
### Setup evaluation commands using prefix arguments
Instead of bothering setting up different key bindings for elisp evaluation
and inspection, it can be handy to have both in the same command, and use
prefix arguments to differenciate, like this:
diff --git a/inspector.el b/inspector.el
index 363294e472..215bb69412 100644
--- a/inspector.el
+++ b/inspector.el
@@ -47,6 +47,12 @@
;; When on an Emacs debugging backtrace, press letter i to inspect the pointed
frame and its local variables.
;;
;; When on edebug-mode, use C-c C-i for inspecting expressions in the debugger.
+;;
+;; From *Help* buffers:
+;;
+;; When in a *Help* buffer, such as the ones created from `describe-function',
`describe-variable',
+;; `describe-keymap', and `describe-symbol', you can use M-x
`inspector-inspect-help-buffer-expression'
+;; to inspect the symbol associated with that Help buffer.
;;; Code:
@@ -1014,6 +1020,16 @@ The environment used is the one when entering the
activation frame at point."
;; Press 'C-c C-i' to inspect expression in edebug-mode
(define-key edebug-mode-map (kbd "C-c C-i")
#'inspector-inspect-edebug-expression)
+;; ----- help-mode---------------------------------------
+
+;;;###autoload
+(defun inspector-inspect-help-buffer-expression ()
+ "Inspect the current *Help* buffer\\='s symbol."
+ (interactive)
+ (if-let* ((expr (plist-get help-mode--current-data :symbol)))
+ (inspector-inspect (eval expr t))
+ (message "No symbol to inspect in Help buffer")))
+
;;--------- Inspector mode ---------------------------------
(defvar inspector-mode-map