From: "David Kågedal" <davidk@lysator.liu.se>
To: kha@treskal.com, catalin.marinas@gmail.com
Cc: git@vger.kernel.org
Subject: [StGit PATCH 1/3] stgit.el: Added undo command
Date: Thu, 30 Oct 2008 10:52:48 +0100 [thread overview]
Message-ID: <20081030095248.10290.81253.stgit@krank> (raw)
In-Reply-To: <20081030095221.10290.58637.stgit@krank>
Bound it to the two standard bindings C-/ and C-_.
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---
contrib/stgit.el | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/contrib/stgit.el b/contrib/stgit.el
index aafefaf..e6b7d70 100644
--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -165,7 +165,9 @@ Argument DIR is the repository path."
(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 "D" 'stgit-delete))
+ (define-key stgit-mode-map "D" 'stgit-delete)
+ (define-key stgit-mode-map [(control ?/)] 'stgit-undo)
+ (define-key stgit-mode-map "\C-_" 'stgit-undo))
(defun stgit-mode ()
"Major mode for interacting with StGit.
@@ -408,4 +410,14 @@ Commands:
(interactive)
(describe-function 'stgit-mode))
+(defun stgit-undo (&optional arg)
+ "Run stg undo.
+With prefix argument, run it with the --hard flag."
+ (interactive "P")
+ (stgit-capture-output nil
+ (if arg
+ (stgit-run "undo" "--hard")
+ (stgit-run "undo")))
+ (stgit-refresh))
+
(provide 'stgit)
next prev parent reply other threads:[~2008-10-30 10:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 9:52 [StGit PATCH 0/3] stgit.el patches David Kågedal
2008-10-30 9:52 ` David Kågedal [this message]
2008-10-30 11:57 ` [StGit PATCH 1/3] stgit.el: Added undo command Karl Hasselström
2008-10-30 14:57 ` David Kågedal
2008-10-30 9:52 ` [StGit PATCH 2/3] stgit.el: Added numeric prefix argument to push and pop commands David Kågedal
2008-10-30 9:52 ` [StGit PATCH 3/3] stgit.el: Adapt to new output from stg series David Kågedal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081030095248.10290.81253.stgit@krank \
--to=davidk@lysator.liu.se \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
--cc=kha@treskal.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).