Display help for Git mode after pressing `h' or `?' in *git-status*
authorJakub Narebski <jnareb@gmail.com>
Thu, 13 Jul 2006 20:22:14 +0000 (22:22 +0200)
committerJunio C Hamano <junkio@cox.net>
Fri, 14 Jul 2006 04:21:34 +0000 (21:21 -0700)
Add bindings for "h" and "?" in git-status-mode to display help about the mode,
including keymap via (describe-function 'git-status-mode), like in PCL-CVS.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/emacs/git.el
index 83a845dd942144f408f6f0a81474f174fa8fcd2b..34c995046d8cd783cf165e8d2e40cb0d11f85f59 100644 (file)
@@ -943,6 +943,8 @@ and returns the process output as a string."
   (let ((map (make-keymap))
         (diff-map (make-sparse-keymap)))
     (suppress-keymap map)
+    (define-key map "?"   'git-help)
+    (define-key map "h"   'git-help)
     (define-key map " "   'git-next-file)
     (define-key map "a"   'git-add-file)
     (define-key map "c"   'git-commit-file)
@@ -1012,5 +1014,10 @@ Commands:
         (goto-char (point-min)))
     (message "%s is not a git working tree." dir)))
 
+(defun git-help ()
+  "Display help for Git mode."
+  (interactive)
+  (describe-function 'git-status-mode))
+
 (provide 'git)
 ;;; git.el ends here