Emacs mode: Show keybindings when user presses "h" or "?"
authorKarl Hasselström <kha@treskal.com>
Wed, 19 Dec 2007 18:00:07 +0000 (18:00 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 19 Dec 2007 23:13:28 +0000 (23:13 +0000)
These are the same keys the git emacs mode uses.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
contrib/stgit.el

index 1bdc0a5..09dec8b 100644 (file)
@@ -65,6 +65,8 @@ Argument DIR is the repository path."
 (unless stgit-mode-map
   (setq stgit-mode-map (make-keymap))
   (suppress-keymap stgit-mode-map)
+  (define-key stgit-mode-map "?"   'stgit-help)
+  (define-key stgit-mode-map "h"   'stgit-help)
   (define-key stgit-mode-map "g"   'stgit-refresh)
   (define-key stgit-mode-map "r"   'stgit-rename)
   (define-key stgit-mode-map ">"   'stgit-push-next)
@@ -139,3 +141,8 @@ Commands:
     (with-current-buffer standard-output
       (goto-char (point-min))
       (diff-mode))))
+
+(defun stgit-help ()
+  "Display help for the StGit mode."
+  (interactive)
+  (describe-function 'stgit-mode))