chiark / gitweb /
Emacs mode: Bind "G" to "stg goto"
authorKarl Hasselström <kha@treskal.com>
Wed, 19 Dec 2007 18:00:08 +0000 (18:00 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 19 Dec 2007 23:13:29 +0000 (23:13 +0000)
Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
contrib/stgit.el

index d371e71f0f8cfb0c03a35158ea1a86ef17116cba..78e9520f2d601ee9b96dafd9e060a210251e8c40 100644 (file)
@@ -83,6 +83,7 @@   (define-key stgit-mode-map "r"   'stgit-rename)
   (define-key stgit-mode-map ">"   'stgit-push-next)
   (define-key stgit-mode-map "<"   'stgit-pop-next)
   (define-key stgit-mode-map "P"   'stgit-push-or-pop)
   (define-key stgit-mode-map ">"   'stgit-push-next)
   (define-key stgit-mode-map "<"   'stgit-pop-next)
   (define-key stgit-mode-map "P"   'stgit-push-or-pop)
+  (define-key stgit-mode-map "G"   'stgit-goto)
   (define-key stgit-mode-map "="   'stgit-show))
 
 (defun stgit-mode ()
   (define-key stgit-mode-map "="   'stgit-show))
 
 (defun stgit-mode ()
@@ -154,6 +155,14 @@ (defun stgit-push-or-pop ()
        (stgit-run (if applied "pop" "push") patch))
     (stgit-refresh)))
 
        (stgit-run (if applied "pop" "push") patch))
     (stgit-refresh)))
 
+(defun stgit-goto ()
+  "Go to the patch on the current line"
+  (interactive)
+  (let ((patch (stgit-patch-at-point)))
+    (stgit-capture-output nil
+       (stgit-run "goto" patch))
+    (stgit-refresh)))
+
 (defun stgit-show ()
   "Show the patch on the current line"
   (interactive)
 (defun stgit-show ()
   "Show the patch on the current line"
   (interactive)