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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Teach the emacs mode to delete patches.

Signed-off-by: Karl Hasselström <kha@xxxxxxxxxxx>

---

David, could you have a look at this as well? In addition to me being
elisp challenged, there are the following issues:

  * Is "d" a reasonable binding? Any better suggestion?

  * Currently, this command requires you to mark one or more patches
    before deleting. This is convenient when deleting more than one
    patch, but one could argue that it should be possible to delete
    the patch at point without having to select it.

  * We should probably ask for confirmation before deleting.

 contrib/stgit.el |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)


diff --git a/contrib/stgit.el b/contrib/stgit.el
index 30c1cd1..7468fcd 100644
--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -150,7 +150,8 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map "<"   'stgit-pop-next)
   (define-key stgit-mode-map "P"   'stgit-push-or-pop)
   (define-key stgit-mode-map "G"   'stgit-goto)
-  (define-key stgit-mode-map "="   'stgit-show))
+  (define-key stgit-mode-map "="   'stgit-show)
+  (define-key stgit-mode-map "d"   'stgit-delete))
 
 (defun stgit-mode ()
   "Major mode for interacting with StGit.
@@ -341,6 +342,13 @@ Commands:
            (substring patch 0 20))
           (t patch))))
 
+(defun stgit-delete (patch-names)
+  "Delete the named patches"
+  (interactive (list (stgit-marked-patches)))
+  (stgit-capture-output nil
+    (apply 'stgit-run "delete" patch-names))
+  (stgit-refresh))
+
 (defun stgit-coalesce (patch-names)
   "Run stg coalesce on the named patches"
   (interactive (list (stgit-marked-patches)))

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux