(mapc (lambda (arg) (define-key stgit-mode-map (car arg) (cdr arg)))
'((" " . stgit-mark)
("m" . stgit-mark)
- ("\d" . stgit-unmark)
+ ("\d" . stgit-unmark-up)
+ ("u" . stgit-unmark-down)
("?" . stgit-help)
("h" . stgit-help)
("p" . previous-line)
"Run stg init"
(interactive)
(stgit-capture-output nil
- (stgit-run "init"))
+ (stgit-run "init"))
(stgit-reload))
(defun stgit-mark ()
(stgit-reload))
(next-line))
-(defun stgit-unmark ()
- "Mark the patch on the previous line"
+(defun stgit-unmark-up ()
+ "Remove mark from the patch on the previous line"
(interactive)
(forward-line -1)
- (let ((patch (stgit-patch-at-point)))
- (stgit-remove-mark patch)
- (stgit-reload)))
+ (stgit-remove-mark (stgit-patch-at-point))
+ (stgit-reload))
+
+(defun stgit-unmark-down ()
+ "Remove mark from the patch on the current line"
+ (interactive)
+ (stgit-remove-mark (stgit-patch-at-point))
+ (forward-line)
+ (stgit-reload))
(defun stgit-rename (name)
"Rename the patch under point"
"Run stg repair"
(interactive)
(stgit-capture-output nil
- (stgit-run "repair"))
+ (stgit-run "repair"))
(stgit-reload))
(defun stgit-commit ()
(let ((patch (stgit-patch-at-point))
(applied (stgit-applied-at-point)))
(stgit-capture-output nil
- (stgit-run (if applied "pop" "push") patch))
+ (stgit-run (if applied "pop" "push") patch))
(stgit-reload)))
(defun stgit-goto ()
(interactive)
(let ((patch (stgit-patch-at-point)))
(stgit-capture-output nil
- (stgit-run "goto" patch))
+ (stgit-run "goto" patch))
(stgit-reload)))
(defun stgit-show ()
With prefix argument, refresh the patch under point."
(interactive "P")
(let ((patchargs (if arg
- (let ((patches (stgit-patches-marked-or-at-point)))
- (cond ((null patches)
- (error "no patch to update"))
- ((> (length patches) 1)
- (error "too many patches selected"))
- (t
- (cons "-p" patches))))
- nil)))
+ (let ((patches (stgit-patches-marked-or-at-point)))
+ (cond ((null patches)
+ (error "no patch to update"))
+ ((> (length patches) 1)
+ (error "too many patches selected"))
+ (t
+ (cons "-p" patches))))
+ nil)))
(stgit-capture-output nil
(apply 'stgit-run "refresh" patchargs)))
(stgit-reload))