login
Header Space

 
 

Re: [StGit PATCH 2/2] Emacs mode: delete patches

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Catalin Marinas <catalin.marinas@...>, Karl <kha@...>
Cc: <git@...>
Date: Monday, February 11, 2008 - 5:42 am

Karl Hasselström <kha@treskal.com> writes:


We could reserve "d" for moving a patch "down", maybe.  The more
destructive commands could be on less accessible keys. Maybe "D" or
"C-d".


You need something like this:

--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -187,6 +187,15 @@ Commands:
         (match-string-no-properties 1)
       nil)))
 
+(defun stgit-selected-patches ()
+  "Return the names of the marked patches, or the patch on the current line."
+  (if stgit-marked-patches
+      (stgit-marked-patches)
+    (let ((patch (stgit-patch-at-point)))
+      (if patch
+          (list patch)
+        '()))))
+
 (defun stgit-goto-patch (patch)
   "Move point to the line containing PATCH"
   (let ((p (point)))


Absolutely. Something like this (untested):

(defun stgit-delete (patch-names)
  "Delete the named patches"
  (interactive (list (stgit-selected-patches)))
  (if (zerop (length patch-names))
      (error "No patches to delete")
    (when (yes-or-no-p (format "Really delete %d patches? "
                               (length patch-names)))
      (stgit-capture-output nil
        (apply 'stgit-run "delete" patch-names))
      (stgit-refresh))


-- 
David Kågedal
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
StGit: kha/safe and kha/experimental updated, Karl , (Sun Feb 10, 4:36 pm)
Re: StGit: kha/safe and kha/experimental updated, Catalin Marinas, (Tue Feb 12, 1:54 pm)
[StGit PATCH 2/2] Emacs mode: delete patches, Karl , (Sun Feb 10, 4:54 pm)
Re: [StGit PATCH 2/2] Emacs mode: delete patches, David Kågedal, (Mon Feb 11, 5:42 am)
Re: [StGit PATCH 2/2] Emacs mode: delete patches, David Kågedal, (Mon Feb 11, 6:12 am)
Re: [StGit PATCH 5/5] Emacs mode: use "stg new --file", David Kågedal, (Mon Feb 11, 5:25 am)
Subject: [PATCH] fix stg edit command, Peter Oberndorfer, (Tue Feb 12, 6:05 pm)
Re: Subject: [PATCH] fix stg edit command, Karl , (Tue Feb 12, 6:47 pm)
speck-geostationary