{"thread":{"id":"16196","subject":"[StGit PATCH] stgit.el: Try to make the point stay on the coalesced patch.","startedAt":"2008-11-06T10:27:14Z","lastAt":"2008-11-06T10:27:14Z","messageCount":1,"participants":["David Kågedal"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"95042","messageId":"20081106102655.32048.21145.stgit@krank","threadId":"16196","inReplyTo":null,"subject":"[StGit PATCH] stgit.el: Try to make the point stay on the coalesced patch.","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2008-11-06T10:27:14Z","receivedAt":"2008-11-06T10:27:14Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"It might not be spot on if all the coalesced patches were unapplied.\n---\n\nThis fixes a small annoyance with the 'c' command.\n\n contrib/stgit.el |   12 +++++++++++-\n 1 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex d0f19c3..971ecd1 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -193,6 +193,9 @@ Commands:\n   (let ((patchsym (intern patch)))\n     (setq stgit-marked-patches (delq patchsym stgit-marked-patches))))\n \n+(defun stgit-clear-marks ()\n+  (setq stgit-marked-patches '()))\n+\n (defun stgit-marked-patches ()\n   \"Return the names of the marked patches.\"\n   (mapcar 'symbol-name stgit-marked-patches))\n@@ -406,8 +409,15 @@ With numeric prefix argument, pop that many patches.\"\n     (write-region (point-min) (point-max) file)\n     (stgit-capture-output nil\n       (apply 'stgit-run \"coalesce\" \"-f\" file stgit-patches))\n+    (stgit-clear-marks)\n     (with-current-buffer log-edit-parent-buffer\n-      (stgit-refresh))))\n+      ;; Go to first marked patch and stay there\n+      (goto-char (point-min))\n+      (re-search-forward (concat \"^[>+-]\\\\*\") nil t)\n+      (move-to-column goal-column)\n+      (let ((pos (point)))\n+        (stgit-refresh)\n+        (goto-char pos)))))\n \n (defun stgit-help ()\n   \"Display help for the StGit mode.\"\n"}]}