chiark
/
gitweb
/
~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stgit.el: Add stgit-toggle-mark
[stgit]
/
contrib
/
stgit.el
diff --git
a/contrib/stgit.el
b/contrib/stgit.el
index 27b17442dfaf960054b420fbc8ca24e837c23698..81222f664c1e12c3db3a67ffbe41aa7e1d607f9b 100644
(file)
--- a/
contrib/stgit.el
+++ b/
contrib/stgit.el
@@
-812,8
+812,8
@@
(unless stgit-mode-map
(setq stgit-mode-map (make-keymap))
(suppress-keymap stgit-mode-map)
(mapc (lambda (arg) (define-key stgit-mode-map (car arg) (cdr arg)))
(setq stgit-mode-map (make-keymap))
(suppress-keymap stgit-mode-map)
(mapc (lambda (arg) (define-key stgit-mode-map (car arg) (cdr arg)))
- `((" " . stgit-mark)
- ("m" . stgit-mark)
+ `((" " . stgit-mark
-down
)
+ ("m" . stgit-mark
-down
)
("\d" . stgit-unmark-up)
("u" . stgit-unmark-down)
("?" . stgit-help)
("\d" . stgit-unmark-up)
("u" . stgit-unmark-down)
("?" . stgit-help)
@@
-885,7
+885,7
@@
(defun stgit-mode ()
\\[stgit-previous-patch] Move to previous patch
\\[stgit-next-patch] Move to next patch
\\[stgit-previous-patch] Move to previous patch
\\[stgit-next-patch] Move to next patch
-\\[stgit-mark
] Mark patch
+\\[stgit-mark
-down] Mark patch and move down
\\[stgit-unmark-up] Unmark patch and move up
\\[stgit-unmark-down] Unmark patch and move down
\\[stgit-unmark-up] Unmark patch and move up
\\[stgit-unmark-down] Unmark patch and move down
@@
-1057,6
+1057,14
@@
(defun stgit-init ()
(stgit-run "init"))
(stgit-reload))
(stgit-run "init"))
(stgit-reload))
+(defun stgit-toggle-mark ()
+ "Toggle mark on the patch under point."
+ (interactive)
+ (stgit-assert-mode)
+ (if (memq (stgit-patch-name-at-point t t) stgit-marked-patches)
+ (stgit-unmark)
+ (stgit-mark)))
+
(defun stgit-mark ()
"Mark the patch under point."
(interactive)
(defun stgit-mark ()
"Mark the patch under point."
(interactive)
@@
-1069,28
+1077,39
@@
(defun stgit-mark ()
(when (eq name :index)
(error "Cannot mark the index"))
(stgit-add-mark (stgit-patch-name patch))
(when (eq name :index)
(error "Cannot mark the index"))
(stgit-add-mark (stgit-patch-name patch))
- (ewoc-invalidate stgit-ewoc node))
+ (let ((column (current-column)))
+ (ewoc-invalidate stgit-ewoc node)
+ (move-to-column column))))
+
+(defun stgit-mark-down ()
+ "Mark the patch under point and move to the next patch."
+ (interactive)
+ (stgit-mark)
(stgit-next-patch))
(stgit-next-patch))
-(defun stgit-unmark
-up
()
- "Remove mark from the patch on the
previous
line."
+(defun stgit-unmark ()
+ "Remove mark from the patch on the
current
line."
(interactive)
(stgit-assert-mode)
(interactive)
(stgit-assert-mode)
- (stgit-previous-patch)
(let* ((node (ewoc-locate stgit-ewoc))
(patch (ewoc-data node)))
(stgit-remove-mark (stgit-patch-name patch))
(let* ((node (ewoc-locate stgit-ewoc))
(patch (ewoc-data node)))
(stgit-remove-mark (stgit-patch-name patch))
- (ewoc-invalidate stgit-ewoc node))
- (move-to-column (stgit-goal-column)))
+ (let ((column (current-column)))
+ (ewoc-invalidate stgit-ewoc node)
+ (move-to-column column))))
+
+(defun stgit-unmark-up ()
+ "Remove mark from the patch on the previous line."
+ (interactive)
+ (stgit-assert-mode)
+ (stgit-previous-patch)
+ (stgit-unmark))
(defun stgit-unmark-down ()
"Remove mark from the patch on the current line."
(interactive)
(stgit-assert-mode)
(defun stgit-unmark-down ()
"Remove mark from the patch on the current line."
(interactive)
(stgit-assert-mode)
- (let* ((node (ewoc-locate stgit-ewoc))
- (patch (ewoc-data node)))
- (stgit-remove-mark (stgit-patch-name patch))
- (ewoc-invalidate stgit-ewoc node))
+ (stgit-unmark)
(stgit-next-patch))
(defun stgit-rename (name)
(stgit-next-patch))
(defun stgit-rename (name)