Skip to content

Commit 5716e79

Browse files
jnarebJunio C Hamano
authored andcommitted
Display help for Git mode after pressing h' or ?' in *git-status*
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>
1 parent 1b3a667 commit 5716e79

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

contrib/emacs/git.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,8 @@ and returns the process output as a string."
943943
(let ((map (make-keymap))
944944
(diff-map (make-sparse-keymap)))
945945
(suppress-keymap map)
946+
(define-key map "?" 'git-help)
947+
(define-key map "h" 'git-help)
946948
(define-key map " " 'git-next-file)
947949
(define-key map "a" 'git-add-file)
948950
(define-key map "c" 'git-commit-file)
@@ -1012,5 +1014,10 @@ Commands:
10121014
(goto-char (point-min)))
10131015
(message "%s is not a git working tree." dir)))
10141016

1017+
(defun git-help ()
1018+
"Display help for Git mode."
1019+
(interactive)
1020+
(describe-function 'git-status-mode))
1021+
10151022
(provide 'git)
10161023
;;; git.el ends here

0 commit comments

Comments
 (0)