From: Gustav Hållberg Date: Fri, 13 Mar 2009 03:44:13 +0000 (+0100) Subject: stgit.el: Manually draw/erase the mark in stgit-{add,remove}-mark X-Git-Tag: v0.15-rc1~40 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/980ccd21077134fa02716115cb457f6954b3cc42 stgit.el: Manually draw/erase the mark in stgit-{add,remove}-mark This significantly reduces the time stgit-mark and similar takes. Signed-off-by: Gustav Hållberg Signed-off-by: Karl Hasselström --- diff --git a/contrib/stgit.el b/contrib/stgit.el index 02e43e1..de466db 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -562,11 +562,23 @@ (defun stgit-mode () (defun stgit-add-mark (patchsym) "Mark the patch PATCHSYM." - (setq stgit-marked-patches (cons patchsym stgit-marked-patches))) + (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))))) (defun stgit-remove-mark (patchsym) "Unmark the patch PATCHSYM." - (setq stgit-marked-patches (delq patchsym stgit-marked-patches))) + (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))))) (defun stgit-clear-marks () "Unmark all patches." @@ -636,22 +648,19 @@ (defun stgit-mark () "Mark the patch under point." (interactive) (let ((patch (stgit-patch-at-point t))) - (stgit-add-mark patch) - (stgit-reload)) + (stgit-add-mark patch)) (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-at-point t)) - (stgit-reload)) + (stgit-remove-mark (stgit-patch-at-point t))) (defun stgit-unmark-down () "Remove mark from the patch on the current line." (interactive) (stgit-remove-mark (stgit-patch-at-point t)) - (stgit-reload) (stgit-next-patch)) (defun stgit-rename (name)