From b15b1cd746bbfb8828167923818c3496f6da2945 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Sun, 11 May 2008 20:23:30 -0700 Subject: [PATCH] fixed describe-command --- user.lisp | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/user.lisp b/user.lisp index c3b3f89..3625577 100644 --- a/user.lisp +++ b/user.lisp @@ -1035,7 +1035,7 @@ string between them." finally (return c)))) (defun call-interactively (command &optional (input "")) - "Parse the command's arguments from inputgiven the command's + "Parse the command's arguments from input given the command's argument specifications then execute it. Returns a string or nil if user aborted." (declare (type (or string symbol) command) @@ -1203,9 +1203,11 @@ is using the number, then the windows swap numbers. Defaults to current group." (mapcar 'print-key-seq (search-kmap kmap-var *top-map*)) (columnize data cols)))) -(defcommand help () () +(defcommand help (&optional com) (:rest) "Display all the bindings in @var{*root-map*}." - (display-keybinding '*root-map*)) + (if com + (describe-command com) + (display-keybinding '*root-map*))) (defcommand commands () () (let* ((screen (current-screen)) @@ -1945,8 +1947,11 @@ command prints the command bound to the specified key sequence." (defcommand describe-command (com) ((:command "Describe Command: ")) "Print the online help associated with the specified command." - (message-no-timeout "Command \"~a\":~%~a" com - (documentation (get-command-structure com) 'function))) + ; Is it really a command, not just a function? + (if (get-command-structure com) + (message-no-timeout "Command \"~a\":~%~a" com + (documentation (get-command-symbol com) 'function)) + (message-no-timeout "Error: Command \"~\" not found." com))) (defcommand where-is (cmd) ((:rest "Where is command: ")) "Print the key sequences bound to the specified command." -- 1.5.5.1