{"thread":{"id":"16092","subject":"[StGit PATCH 1/3] stgit.el: Added undo command","startedAt":"2008-10-30T09:52:43Z","lastAt":"2008-10-30T14:57:38Z","messageCount":6,"participants":["David Kågedal","Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"94268","messageId":"20081030095221.10290.58637.stgit@krank","threadId":"16092","inReplyTo":null,"subject":"[StGit PATCH 0/3] stgit.el patches","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2008-10-30T09:52:43Z","receivedAt":"2008-10-30T09:52:43Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"These three patches updates stgit.el. They don't depend on each other\nand can be applied independently.\n\n---\n\nDavid Kågedal (3):\n      stgit.el: Adapt to new output from stg series.\n      stgit.el: Added numeric prefix argument to push and pop commands.\n      stgit.el: Added undo command\n\n\n contrib/stgit.el |   36 ++++++++++++++++++++++++++----------\n 1 files changed, 26 insertions(+), 10 deletions(-)\n\n-- \nSignature\n"},{"id":"94267","messageId":"20081030095248.10290.81253.stgit@krank","threadId":"16092","inReplyTo":"20081030095221.10290.58637.stgit@krank","subject":"[StGit PATCH 1/3] stgit.el: Added undo command","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2008-10-30T09:52:48Z","receivedAt":"2008-10-30T09:52:48Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Bound it to the two standard bindings C-/ and C-_.\n\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n contrib/stgit.el |   14 +++++++++++++-\n 1 files changed, 13 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex aafefaf..e6b7d70 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -165,7 +165,9 @@ Argument DIR is the repository path.\"\n   (define-key stgit-mode-map \"P\"   'stgit-push-or-pop)\n   (define-key stgit-mode-map \"G\"   'stgit-goto)\n   (define-key stgit-mode-map \"=\"   'stgit-show)\n-  (define-key stgit-mode-map \"D\"   'stgit-delete))\n+  (define-key stgit-mode-map \"D\"   'stgit-delete)\n+  (define-key stgit-mode-map [(control ?/)] 'stgit-undo)\n+  (define-key stgit-mode-map \"\\C-_\" 'stgit-undo))\n \n (defun stgit-mode ()\n   \"Major mode for interacting with StGit.\n@@ -408,4 +410,14 @@ Commands:\n   (interactive)\n   (describe-function 'stgit-mode))\n \n+(defun stgit-undo (&optional arg)\n+  \"Run stg undo.\n+With prefix argument, run it with the --hard flag.\"\n+  (interactive \"P\")\n+  (stgit-capture-output nil\n+    (if arg\n+        (stgit-run \"undo\" \"--hard\")\n+      (stgit-run \"undo\")))\n+  (stgit-refresh))\n+\n (provide 'stgit)\n"},{"id":"94269","messageId":"20081030095253.10290.43869.stgit@krank","threadId":"16092","inReplyTo":"20081030095221.10290.58637.stgit@krank","subject":"[StGit PATCH 2/3] stgit.el: Added numeric prefix argument to push and pop commands.","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2008-10-30T09:52:54Z","receivedAt":"2008-10-30T09:52:54Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"By using a numerical prefix (or simply C-u) it is possible to push or\npop more than one patch.\n\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n contrib/stgit.el |   19 +++++++++++--------\n 1 files changed, 11 insertions(+), 8 deletions(-)\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex e6b7d70..9907952 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -276,16 +276,19 @@ Commands:\n   (stgit-capture-output nil (stgit-run \"uncommit\" \"-n\" (number-to-string arg)))\n   (stgit-refresh))\n \n-(defun stgit-push-next ()\n-  \"Push the first unapplied patch\"\n-  (interactive)\n-  (stgit-capture-output nil (stgit-run \"push\"))\n+(defun stgit-push-next (npatches)\n+  \"Push the first unapplied patch.\n+With numeric prefix argument, push that many patches.\"\n+  (interactive \"p\")\n+  (stgit-capture-output nil (stgit-run \"push\" \"-n\"\n+                                       (number-to-string npatches)))\n   (stgit-refresh))\n \n-(defun stgit-pop-next ()\n-  \"Pop the topmost applied patch\"\n-  (interactive)\n-  (stgit-capture-output nil (stgit-run \"pop\"))\n+(defun stgit-pop-next (npatches)\n+  \"Pop the topmost applied patch.\n+With numeric prefix argument, pop that many patches.\"\n+  (interactive \"p\")\n+  (stgit-capture-output nil (stgit-run \"pop\" \"-n\" (number-to-string npatches)))\n   (stgit-refresh))\n \n (defun stgit-applied-at-point ()\n"},{"id":"94270","messageId":"20081030095259.10290.67051.stgit@krank","threadId":"16092","inReplyTo":"20081030095221.10290.58637.stgit@krank","subject":"[StGit PATCH 3/3] stgit.el: Adapt to new output from stg series.","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2008-10-30T09:52:59Z","receivedAt":"2008-10-30T09:52:59Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Signed-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n contrib/stgit.el |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 9907952..d0f19c3 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -131,7 +131,8 @@ Argument DIR is the repository path.\"\n                  (when (memq patchsym stgit-marked-patches)\n                    (replace-match \"*\" nil nil nil 2)\n                    (setq marked (cons patchsym marked)))))\n-              ((looking-at \"stg series: Branch \\\".*\\\" not initialised\")\n+              ((or (looking-at \"stg series: Branch \\\".*\\\" not initialised\")\n+                   (looking-at \"stg series: .*: branch not initialized\"))\n                (forward-line 1)\n                (insert \"Run M-x stgit-init to initialise\")))\n         (forward-line 1))\n"},{"id":"94276","messageId":"20081030115716.GA19360@diana.vm.bytemark.co.uk","threadId":"16092","inReplyTo":"20081030095248.10290.81253.stgit@krank","subject":"Re: [StGit PATCH 1/3] stgit.el: Added undo command","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-10-30T11:57:16Z","receivedAt":"2008-10-30T11:57:16Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-10-30 10:52:48 +0100, David Kågedal wrote:\n\n> Bound it to the two standard bindings C-/ and C-_.\n\n> +  (define-key stgit-mode-map [(control ?/)] 'stgit-undo)\n> +  (define-key stgit-mode-map \"\\C-_\" 'stgit-undo))\n\nHmm, why do you spell control in two different ways?\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"94295","messageId":"87skqe9llp.fsf@krank.kagedal.org","threadId":"16092","inReplyTo":"20081030115716.GA19360@diana.vm.bytemark.co.uk","subject":"Re: [StGit PATCH 1/3] stgit.el: Added undo command","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2008-10-30T14:57:38Z","receivedAt":"2008-10-30T14:57:38Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Karl Hasselström <kha@treskal.com> writes:\n\n> On 2008-10-30 10:52:48 +0100, David Kågedal wrote:\n>\n>> Bound it to the two standard bindings C-/ and C-_.\n>\n>> +  (define-key stgit-mode-map [(control ?/)] 'stgit-undo)\n>> +  (define-key stgit-mode-map \"\\C-_\" 'stgit-undo))\n>\n> Hmm, why do you spell control in two different ways?\n\nI usually use the \"\\C-x\" syntax, but for some reason that didn't work\nwith \"\\C-/\", so I used another syntax. I'm not sure how compatible\nthat is with XEmacs, though.\n\n-- \nDavid Kågedal\n"}]}