[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select 91bdd5a 157/218: Provide completion in
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select 91bdd5a 157/218: Provide completion in vc-git-stash-* commands |
Date: |
Fri, 14 Dec 2018 03:35:21 -0500 (EST) |
branch: feature/gnus-select
commit 91bdd5a4f087b6b264ba8e1bba8cd5b077df387b
Author: Charles A. Roelli <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Provide completion in vc-git-stash-* commands
* lisp/vc/vc-git.el (vc-git-stash-read-history)
(vc-git-stash-read): New history variable and function.
(vc-git-stash-show, vc-git-stash-apply, vc-git-stash-pop): Update
their interactive specifications.
---
lisp/vc/vc-git.el | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 5456467..bf1b050 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1481,9 +1481,24 @@ This command shares argument histories with \\[rgrep]
and \\[grep]."
(vc-git--call nil "stash" "save" name)
(vc-resynch-buffer root t t))))
+(defvar vc-git-stash-read-history nil
+ "History for `vc-git-stash-read'.")
+
+(defun vc-git-stash-read (prompt)
+ "Read a Git stash. PROMPT is a string to prompt with."
+ (let ((stash (completing-read
+ prompt
+ (split-string
+ (or (vc-git--run-command-string nil "stash" "list") "") "\n")
+ nil :require-match nil 'vc-git-stash-read-history)))
+ (if (string-equal stash "")
+ (user-error "Not a stash")
+ (string-match "address@hidden:digit:]]+}" stash)
+ (match-string 0 stash))))
+
(defun vc-git-stash-show (name)
"Show the contents of stash NAME."
- (interactive "sStash name: ")
+ (interactive (list (vc-git-stash-read "Show stash: ")))
(vc-setup-buffer "*vc-git-stash*")
(vc-git-command "*vc-git-stash*" 'async nil "stash" "show" "-p" name)
(set-buffer "*vc-git-stash*")
@@ -1493,13 +1508,13 @@ This command shares argument histories with \\[rgrep]
and \\[grep]."
(defun vc-git-stash-apply (name)
"Apply stash NAME."
- (interactive "sApply stash: ")
+ (interactive (list (vc-git-stash-read "Apply stash: ")))
(vc-git-command "*vc-git-stash*" 0 nil "stash" "apply" "-q" name)
(vc-resynch-buffer (vc-git-root default-directory) t t))
(defun vc-git-stash-pop (name)
"Pop stash NAME."
- (interactive "sPop stash: ")
+ (interactive (list (vc-git-stash-read "Pop stash: ")))
(vc-git-command "*vc-git-stash*" 0 nil "stash" "pop" "-q" name)
(vc-resynch-buffer (vc-git-root default-directory) t t))
- [Emacs-diffs] feature/gnus-select 06a984e 138/218: Improve documentation of 'with-help-window', (continued)
- [Emacs-diffs] feature/gnus-select 06a984e 138/218: Improve documentation of 'with-help-window', Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 4523701 147/218: * lisp/isearch.el (isearch-pre-command-hook): Replace cl-lib function., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 751ecf3 135/218: Set gnus-newsgroup-selection in the summary buffer, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 16fc857 142/218: ; Rewrap doc string, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 118f691 103/218: cedet: remove obsolete name args to constructors, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select aa16566 168/218: Fix Bug#30904, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 8671f03 166/218: Adjust eieio persistence tests for expected failure, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 9d4baa3 165/218: Let eieio-persistent-read read what object-write has written, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select a1b7a1e 163/218: Add new tests for eieio persistence, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 267b827 170/218: Fix commit c24c5dc4a4, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 91bdd5a 157/218: Provide completion in vc-git-stash-* commands,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select 8d80db1 154/218: Quieten eieio-test compilation, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 5502f96 161/218: * lisp/ibuf-ext.el (ibuffer-never-search-content-mode): Fix type., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 6dbf88e 171/218: Fix the MSDOS build, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select d5a07be 172/218: * etc/NEWS: Add an entry for auth-source-pass., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select c1d88db 173/218: Document DEFUN attributes, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 0d04cb6 176/218: Fix byte-opt lists of pure functions etc., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select b36a2f9 178/218: * lisp/org/ob-lisp.el (org-babel-lisp-eval-fn): Tweak type., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 4fdc730 177/218: sql.el defcustom fixes, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select fe87972 186/218: * doc/emacs/trouble.texi: Fix location of `emacs-version' index., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 21aa752 184/218: Make update_autogen work in git worktrees, Andrew G Cohen, 2018/12/14