chiark / gitweb /
stgit.el: Invalidate ewoc node when marking or unmarking instead of modifying buffer...
authorDavid Kågedal <david@virtutech.com>
Fri, 22 May 2009 23:09:32 +0000 (01:09 +0200)
committerDavid Kågedal <david@virtutech.com>
Thu, 30 Jul 2009 15:03:09 +0000 (17:03 +0200)
Signed-off-by: David Kågedal <david@virtutech.com>
contrib/stgit.el

index 5ed8f4e6a0aeba3e3fda7bc86f44f84feb76faf3..0201098ddae2c3bb4a5512c124052c2873a26a04 100644 (file)
@@ -567,23 +567,11 @@ (defun stgit-mode ()
 
 (defun stgit-add-mark (patchsym)
   "Mark the patch PATCHSYM."
-  (setq stgit-marked-patches (cons patchsym stgit-marked-patches))
-  (save-excursion
-    (when (stgit-goto-patch patchsym)
-      (move-to-column 1)
-      (let ((inhibit-read-only t))
-        (insert-and-inherit ?*)
-        (delete-char 1)))))
+  (setq stgit-marked-patches (cons patchsym stgit-marked-patches)))
 
 (defun stgit-remove-mark (patchsym)
   "Unmark the patch PATCHSYM."
-  (setq stgit-marked-patches (delq patchsym stgit-marked-patches))
-  (save-excursion
-    (when (stgit-goto-patch patchsym)
-      (move-to-column 1)
-      (let ((inhibit-read-only t))
-        (insert-and-inherit ? )
-        (delete-char 1)))))
+  (setq stgit-marked-patches (delq patchsym stgit-marked-patches)))
 
 (defun stgit-clear-marks ()
   "Unmark all patches."
@@ -653,20 +641,29 @@ (defun stgit-init ()
 (defun stgit-mark ()
   "Mark the patch under point."
   (interactive)
-  (let ((patch (stgit-patch-name-at-point t)))
-    (stgit-add-mark patch))
+  (let* ((node (ewoc-locate stgit-ewoc))
+         (patch (ewoc-data node)))
+    (stgit-add-mark (stgit-patch-name patch))
+    (ewoc-invalidate stgit-ewoc node))
   (stgit-next-patch))
 
 (defun stgit-unmark-up ()
   "Remove mark from the patch on the previous line."
   (interactive)
   (stgit-previous-patch)
-  (stgit-remove-mark (stgit-patch-name-at-point t)))
+  (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)))
 
 (defun stgit-unmark-down ()
   "Remove mark from the patch on the current line."
   (interactive)
-  (stgit-remove-mark (stgit-patch-name-at-point t))
+  (let* ((node (ewoc-locate stgit-ewoc))
+         (patch (ewoc-data node)))
+    (stgit-remove-mark (stgit-patch-name patch))
+    (ewoc-invalidate stgit-ewoc node))
   (stgit-next-patch))
 
 (defun stgit-rename (name)