chiark / gitweb /
Emacs mode: Show keybindings when user presses "h" or "?"
[stgit] / contrib / stgit.el
index 1bdc0a564b2982beeed64f6a414b96d7b8b49ab3..09dec8b1845d7fd8cc9eea77e0d520067ba23dd9 100644 (file)
@@ -65,6 +65,8 @@ (defvar stgit-mode-map nil
 (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 @@ (defun stgit-show ()
     (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))