git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2] Display help for Git mode after pressing `h' or `?' in *git-status*

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 13, 2006, 20:22 UTC
Message-ID
<11528221341063-git-send-email-jnareb@gmail.com>
In-Reply-To
<11528217463561-git-send-email-jnareb@gmail.com>

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>
---
 contrib/emacs/git.el |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 83a845d..34c9950 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -943,6 +943,8 @@ (unless git-status-mode-map
   (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 @@ (defun git-status (dir)
         (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
-- 
1.4.0
Previous: Jakub Narebski
Message 3 of 3 in “A few improvements to Emacs interface to Git”
  1. A few improvements to Emacs interface to GitJakub Narebski, Jul 13, 2006
  2. Wrap long lines in docstrings in contrib/emacs/git.elJakub Narebski, Jul 13, 2006
  3. Display help for Git mode after pressing `h' or `?' in *git-status*Jakub Narebski, Jul 13, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.