helpful

a fork of Wilfred's helpful
git clone https://git.trogloxene.org/helpful.git
Log | Files | Refs | README

commit 06fe2ad9c777a6e8c92776d3d6e6e43a513dc1d2
parent 9fc4fa1f9d334e255c820e64d5aa56daeeb83375
Author: Wilfred Hughes <me@wilfred.me.uk>
Date:   Sun, 31 Dec 2017 12:30:51 +0000

Minor refactoring

Diffstat:
Mhelpful.el | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/helpful.el b/helpful.el @@ -1308,15 +1308,17 @@ escapes that are used by `substitute-command-keys'." (interactive (list (read-key-sequence "Press key: "))) (let ((sym (key-binding key-sequence))) - (unless sym + (cond + ((null sym) (user-error "No command is bound to %s" (key-description key-sequence))) - (unless (commandp sym) + ((commandp sym) + (pop-to-buffer (helpful--buffer sym t)) + (helpful-update)) + (t (user-error "%s is bound to symbol %s which is not a command" (key-description key-sequence) - sym)) - (pop-to-buffer (helpful--buffer sym t)) - (helpful-update))) + sym))))) ;;;###autoload (defun helpful-macro (symbol)