git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGit PATCH] stgit.el: Try to make the point stay on the coalesced patch.

From
David Kågedal <davidk@lysator.liu.se>
Date
Nov 6, 2008, 10:27 UTC
Message-ID
<20081106102655.32048.21145.stgit@krank>

It might not be spot on if all the coalesced patches were unapplied. ---

This fixes a small annoyance with the 'c' command.
 contrib/stgit.el |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/contrib/stgit.el b/contrib/stgit.el
index d0f19c3..971ecd1 100644
--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -193,6 +193,9 @@ Commands:
   (let ((patchsym (intern patch)))
     (setq stgit-marked-patches (delq patchsym stgit-marked-patches))))
 
+(defun stgit-clear-marks ()
+  (setq stgit-marked-patches '()))
+
 (defun stgit-marked-patches ()
   "Return the names of the marked patches."
   (mapcar 'symbol-name stgit-marked-patches))
@@ -406,8 +409,15 @@ With numeric prefix argument, pop that many patches."
     (write-region (point-min) (point-max) file)
     (stgit-capture-output nil
       (apply 'stgit-run "coalesce" "-f" file stgit-patches))
+    (stgit-clear-marks)
     (with-current-buffer log-edit-parent-buffer
-      (stgit-refresh))))
+      ;; Go to first marked patch and stay there
+      (goto-char (point-min))
+      (re-search-forward (concat "^[>+-]\\*") nil t)
+      (move-to-column goal-column)
+      (let ((pos (point)))
+        (stgit-refresh)
+        (goto-char pos)))))
 
 (defun stgit-help ()
   "Display help for the StGit mode."
Message 1 of 1 in “stgit.el: Try to make the point stay on the coalesced patch.”
  1. stgit.el: Try to make the point stay on the coalesced patch.David Kågedal, Nov 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.