Bound it to the two standard bindings C-/ and C-_.
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
(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)
(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)
- (define-key stgit-mode-map "D" 'stgit-delete))
+ (define-key stgit-mode-map "D" 'stgit-delete)
+ (define-key stgit-mode-map [(control ?/)] 'stgit-undo)
+ (define-key stgit-mode-map "\C-_" 'stgit-undo))
(defun stgit-mode ()
"Major mode for interacting with StGit.
(defun stgit-mode ()
"Major mode for interacting with StGit.
(interactive)
(describe-function 'stgit-mode))
(interactive)
(describe-function 'stgit-mode))
+(defun stgit-undo (&optional arg)
+ "Run stg undo.
+With prefix argument, run it with the --hard flag."
+ (interactive "P")
+ (stgit-capture-output nil
+ (if arg
+ (stgit-run "undo" "--hard")
+ (stgit-run "undo")))
+ (stgit-refresh))
+