diff options
| author | Lars Ingebrigtsen | 2019-10-30 20:54:44 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-30 20:54:44 +0100 |
| commit | 4650aa3523068b83c3d9e6276fe89eb3955ca1e3 (patch) | |
| tree | 219c09341822f32c019e538088ca629047105d49 | |
| parent | f8134d2753e4abb7a12d87af731d2ad213bb5bd1 (diff) | |
| download | emacs-4650aa3523068b83c3d9e6276fe89eb3955ca1e3.tar.gz emacs-4650aa3523068b83c3d9e6276fe89eb3955ca1e3.zip | |
Bind vc-git-stash to a key
* lisp/vc/vc-git.el (vc-git-stash-map): Give `vc-git-stash' a
keystroke, because it's a useful command.
When there are no stashes, there's no way to use that keystroke (since
it's only bound on the stash lines), so perhaps that should also be
fixed somehow.
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 3 |
2 files changed, 5 insertions, 1 deletions
| @@ -876,6 +876,9 @@ This new user option allows customizing the default arguments passed to | |||
| 876 | When some files are marked, only those are stashed. | 876 | When some files are marked, only those are stashed. |
| 877 | When no files are marked, all modified files are stashed, as before. | 877 | When no files are marked, all modified files are stashed, as before. |
| 878 | 878 | ||
| 879 | *** 'vc-git-stash' has now been bound to the 'C' keystroke in the | ||
| 880 | stash headers. | ||
| 881 | |||
| 879 | *** The new hook 'vc-retrieve-tag-hook' runs after retrieving a tag. | 882 | *** The new hook 'vc-retrieve-tag-hook' runs after retrieving a tag. |
| 880 | 883 | ||
| 881 | --- | 884 | --- |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index ce8e57df768..e0b3b094626 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -648,6 +648,7 @@ or an empty string if none." | |||
| 648 | (define-key map "A" 'vc-git-stash-apply-at-point) | 648 | (define-key map "A" 'vc-git-stash-apply-at-point) |
| 649 | (define-key map "P" 'vc-git-stash-pop-at-point) | 649 | (define-key map "P" 'vc-git-stash-pop-at-point) |
| 650 | (define-key map "S" 'vc-git-stash-snapshot) | 650 | (define-key map "S" 'vc-git-stash-snapshot) |
| 651 | (define-key map "C" 'vc-git-stash) | ||
| 651 | map)) | 652 | map)) |
| 652 | 653 | ||
| 653 | (defun vc-git--make-button-text (show count1 count2) | 654 | (defun vc-git--make-button-text (show count1 count2) |
| @@ -1596,7 +1597,7 @@ This command shares argument histories with \\[rgrep] and \\[grep]." | |||
| 1596 | (autoload 'vc-dir-marked-files "vc-dir") | 1597 | (autoload 'vc-dir-marked-files "vc-dir") |
| 1597 | 1598 | ||
| 1598 | (defun vc-git-stash (name) | 1599 | (defun vc-git-stash (name) |
| 1599 | "Create a stash." | 1600 | "Create a stash given the name NAME." |
| 1600 | (interactive "sStash name: ") | 1601 | (interactive "sStash name: ") |
| 1601 | (let ((root (vc-git-root default-directory))) | 1602 | (let ((root (vc-git-root default-directory))) |
| 1602 | (when root | 1603 | (when root |