commit d3874a62d74eead00d2be4d3dc5d848241a36235 parent 88bcdbfe7713270bb3fdff56201d9404d3056e48 Author: Wilfred Hughes <me@wilfred.me.uk> Date: Sun, 2 Apr 2017 20:39:33 +0100 Factor out reading symbols, and only offer functions/macros Diffstat:
| M | helpful.el | | | 11 | ++++++++--- |
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/helpful.el b/helpful.el @@ -171,12 +171,17 @@ state of the current symbol." (setq docstring (helpful--skip-advice docstring)))) docstring)) +(defun helpful--read-fn-symbol () + (let ((sym-here (symbol-at-point))) + (read (completing-read "Symbol: " obarray + nil nil nil nil + (when (fboundp sym-here) + (symbol-name sym-here)))))) + (defun helpful (symbol) "Show Help for SYMBOL." (interactive - (list (read (completing-read "Symbol: " obarray - nil nil nil nil - (symbol-name (symbol-at-point)))))) + (list (helpful--read-fn-symbol))) (switch-to-buffer (helpful--buffer symbol)) (helpful-update))