diff options
Diffstat (limited to 'lisp/vc')
-rw-r--r-- | lisp/vc/add-log.el | 14 | ||||
-rw-r--r-- | lisp/vc/diff-mode.el | 4 | ||||
-rw-r--r-- | lisp/vc/ediff-mult.el | 26 | ||||
-rw-r--r-- | lisp/vc/ediff.el | 11 | ||||
-rw-r--r-- | lisp/vc/emerge.el | 2 | ||||
-rw-r--r-- | lisp/vc/vc-annotate.el | 30 | ||||
-rw-r--r-- | lisp/vc/vc-bzr.el | 24 | ||||
-rw-r--r-- | lisp/vc/vc-dir.el | 16 | ||||
-rw-r--r-- | lisp/vc/vc-git.el | 57 | ||||
-rw-r--r-- | lisp/vc/vc-hg.el | 11 | ||||
-rw-r--r-- | lisp/vc/vc-hooks.el | 57 |
11 files changed, 115 insertions, 137 deletions
diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index e02d84f1f56..d710578ffff 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el @@ -568,14 +568,12 @@ Compatibility function for \\[next-error] invocations." ;; Select window displaying source file. (select-window change-log-find-window))))) -(defvar change-log-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [?\C-c ?\C-p] #'add-log-edit-prev-comment) - (define-key map [?\C-c ?\C-n] #'add-log-edit-next-comment) - (define-key map [?\C-c ?\C-f] #'change-log-find-file) - (define-key map [?\C-c ?\C-c] #'change-log-goto-source) - map) - "Keymap for Change Log major mode.") +(defvar-keymap change-log-mode-map + :doc "Keymap for Change Log major mode." + "C-c C-p" #'add-log-edit-prev-comment + "C-c C-n" #'add-log-edit-next-comment + "C-c C-f" #'change-log-find-file + "C-c C-c" #'change-log-goto-source) (easy-menu-define change-log-mode-menu change-log-mode-map "Menu for Change Log major mode." diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index aa426446d73..e4a1996c1bb 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -27,8 +27,8 @@ ;; to the corresponding source file. ;; Inspired by Pavel Machek's patch-mode.el (<pavel@@atrey.karlin.mff.cuni.cz>) -;; Some efforts were spent to have it somewhat compatible with XEmacs's -;; diff-mode as well as with compilation-minor-mode +;; Some efforts were spent to have it somewhat compatible with +;; `compilation-minor-mode'. ;; Bugs: diff --git a/lisp/vc/ediff-mult.el b/lisp/vc/ediff-mult.el index 7e15060f8c4..52e356d8e9b 100644 --- a/lisp/vc/ediff-mult.el +++ b/lisp/vc/ediff-mult.el @@ -144,20 +144,18 @@ Useful commands (type ? to hide them and free up screen): (ediff-defvar-local ediff-meta-buffer-map nil "The keymap for the meta buffer.") -(defvar ediff-dir-diffs-buffer-map - (let ((map (make-sparse-keymap))) - (suppress-keymap map) - (define-key map "q" #'ediff-bury-dir-diffs-buffer) - (define-key map " " #'next-line) - (define-key map "n" #'next-line) - (define-key map "\C-?" #'previous-line) - (define-key map "p" #'previous-line) - (define-key map "C" #'ediff-dir-diff-copy-file) - (define-key map [mouse-2] #'ediff-dir-diff-copy-file) - (define-key map [delete] #'previous-line) - (define-key map [backspace] #'previous-line) - map) - "Keymap for buffer showing differences between directories.") +(defvar-keymap ediff-dir-diffs-buffer-map + :doc "Keymap for buffer showing differences between directories." + :suppress t + "q" #'ediff-bury-dir-diffs-buffer + "SPC" #'next-line + "n" #'next-line + "DEL" #'previous-line + "p" #'previous-line + "C" #'ediff-dir-diff-copy-file + "<mouse-2>" #'ediff-dir-diff-copy-file + "<delete>" #'previous-line + "<backspace>" #'previous-line) ;; Variable specifying the action to take when the use invokes ediff in the ;; meta buffer. This is usually ediff-registry-action or ediff-filegroup-action diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index 84ad5cef90f..94e3fc6d7fe 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -89,12 +89,11 @@ ;; underlining. However, if the region is already underlined by some other ;; overlays, there is no simple way to temporarily remove that residual ;; underlining. This problem occurs when a buffer is highlighted with -;; hilit19.el or font-lock.el packages. If this residual highlighting gets -;; in the way, you can do the following. Both font-lock.el and hilit19.el -;; provide commands for unhighlighting buffers. You can either place these -;; commands in `ediff-prepare-buffer-hook' (which will unhighlight every -;; buffer used by Ediff) or you can execute them interactively, at any time -;; and on any buffer. +;; font-lock.el packages. If this residual highlighting gets in the way, you +;; can do the following. font-lock.el provides commands for unhighlighting +;; buffers. You can either place these commands in `ediff-prepare-buffer-hook' +;; (which will unhighlight every buffer used by Ediff) or you can execute +;; them interactively, at any time and in any buffer. ;;; Acknowledgments: diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el index 422ed5c0a4d..de09be80e7c 100644 --- a/lisp/vc/emerge.el +++ b/lisp/vc/emerge.el @@ -2942,6 +2942,7 @@ If some prefix of KEY has a non-prefix definition, it is redefined." ;; Define a key if it (or a prefix) is not already defined in the map. (defun emerge-define-key-if-possible (keymap key definition) + (declare (obsolete keymap-set "29.1")) ;; look up the present definition of the key (let ((present (lookup-key keymap key))) (if (integerp present) @@ -2959,6 +2960,7 @@ If some prefix of KEY has a non-prefix definition, it is redefined." If the name won't fit on one line, the minibuffer is expanded to hold it, and the command waits for a keystroke from the user. If the keystroke is SPC, it is ignored; if it is anything else, it is processed as a command." + (declare (obsolete nil "29.1")) (interactive) (let ((name (buffer-file-name))) (or name diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el index 1f19c4cfe26..a15cf417de3 100644 --- a/lisp/vc/vc-annotate.el +++ b/lisp/vc/vc-annotate.el @@ -162,22 +162,20 @@ List of factors, used to expand/compress the time scale. See `vc-annotate'." :type '(repeat number) :group 'vc) -(defvar vc-annotate-mode-map - (let ((m (make-sparse-keymap))) - (define-key m "a" #'vc-annotate-revision-previous-to-line) - (define-key m "d" #'vc-annotate-show-diff-revision-at-line) - (define-key m "=" #'vc-annotate-show-diff-revision-at-line) - (define-key m "D" #'vc-annotate-show-changeset-diff-revision-at-line) - (define-key m "f" #'vc-annotate-find-revision-at-line) - (define-key m "j" #'vc-annotate-revision-at-line) - (define-key m "l" #'vc-annotate-show-log-revision-at-line) - (define-key m "n" #'vc-annotate-next-revision) - (define-key m "p" #'vc-annotate-prev-revision) - (define-key m "w" #'vc-annotate-working-revision) - (define-key m "v" #'vc-annotate-toggle-annotation-visibility) - (define-key m "\C-m" #'vc-annotate-goto-line) - m) - "Local keymap used for VC-Annotate mode.") +(defvar-keymap vc-annotate-mode-map + :doc "Local keymap used for VC-Annotate mode." + "a" #'vc-annotate-revision-previous-to-line + "d" #'vc-annotate-show-diff-revision-at-line + "=" #'vc-annotate-show-diff-revision-at-line + "D" #'vc-annotate-show-changeset-diff-revision-at-line + "f" #'vc-annotate-find-revision-at-line + "j" #'vc-annotate-revision-at-line + "l" #'vc-annotate-show-log-revision-at-line + "n" #'vc-annotate-next-revision + "p" #'vc-annotate-prev-revision + "w" #'vc-annotate-working-revision + "v" #'vc-annotate-toggle-annotation-visibility + "RET" #'vc-annotate-goto-line) ;;; Annotate functionality diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 072bd72b441..f6b17d4ce09 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -1008,19 +1008,17 @@ stream. Standard error output is discarded." ;; frob the results accordingly. (file-relative-name dir (vc-bzr-root dir))))) -(defvar vc-bzr-shelve-map - (let ((map (make-sparse-keymap))) - ;; Turn off vc-dir marking - (define-key map [mouse-2] #'ignore) - - (define-key map [down-mouse-3] #'vc-bzr-shelve-menu) - (define-key map "\C-k" #'vc-bzr-shelve-delete-at-point) - (define-key map "=" #'vc-bzr-shelve-show-at-point) - (define-key map "\C-m" #'vc-bzr-shelve-show-at-point) - (define-key map "A" #'vc-bzr-shelve-apply-and-keep-at-point) - (define-key map "P" #'vc-bzr-shelve-apply-at-point) - (define-key map "S" #'vc-bzr-shelve-snapshot) - map)) +(defvar-keymap vc-bzr-shelve-map + ;; Turn off vc-dir marking + "<mouse-2>" #'ignore + + "<down-mouse-3>" #'vc-bzr-shelve-menu + "C-k" #'vc-bzr-shelve-delete-at-point + "=" #'vc-bzr-shelve-show-at-point + "RET" #'vc-bzr-shelve-show-at-point + "A" #'vc-bzr-shelve-apply-and-keep-at-point + "P" #'vc-bzr-shelve-apply-at-point + "S" #'vc-bzr-shelve-snapshot) (defvar vc-bzr-shelve-menu-map (let ((map (make-sparse-keymap "Bzr Shelve"))) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 9335da10065..068a66b25b8 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1467,17 +1467,13 @@ These are the commands available for use in the file status buffer: (propertize "Please add backend specific headers here. It's easy!" 'face 'vc-dir-status-warning))) -(defvar vc-dir-status-mouse-map - (let ((map (make-sparse-keymap))) - (define-key map [mouse-2] #'vc-dir-toggle-mark) - map) - "Local keymap for toggling mark.") +(defvar-keymap vc-dir-status-mouse-map + :doc "Local keymap for toggling mark." + "<mouse-2>" #'vc-dir-toggle-mark) -(defvar vc-dir-filename-mouse-map - (let ((map (make-sparse-keymap))) - (define-key map [mouse-2] #'vc-dir-find-file-other-window) - map) - "Local keymap for visiting a file.") +(defvar-keymap vc-dir-filename-mouse-map + :doc "Local keymap for visiting a file." + "<mouse-2>" #'vc-dir-find-file-other-window) (defun vc-default-dir-printer (_backend fileentry) "Pretty print FILEENTRY." diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 8937454d111..46a486a46c3 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -664,32 +664,26 @@ or an empty string if none." :files files :update-function update-function))) -(defvar vc-git-stash-shared-map - (let ((map (make-sparse-keymap))) - (define-key map "S" #'vc-git-stash-snapshot) - (define-key map "C" #'vc-git-stash) - map)) - -(defvar vc-git-stash-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map vc-git-stash-shared-map) - ;; Turn off vc-dir marking - (define-key map [mouse-2] #'ignore) - - (define-key map [down-mouse-3] #'vc-git-stash-menu) - (define-key map "\C-k" #'vc-git-stash-delete-at-point) - (define-key map "=" #'vc-git-stash-show-at-point) - (define-key map "\C-m" #'vc-git-stash-show-at-point) - (define-key map "A" #'vc-git-stash-apply-at-point) - (define-key map "P" #'vc-git-stash-pop-at-point) - map)) - -(defvar vc-git-stash-button-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map vc-git-stash-shared-map) - (define-key map [mouse-2] #'push-button) - (define-key map "\C-m" #'push-button) - map)) +(defvar-keymap vc-git-stash-shared-map + "S" #'vc-git-stash-snapshot + "C" #'vc-git-stash) + +(defvar-keymap vc-git-stash-map + :parent vc-git-stash-shared-map + ;; Turn off vc-dir marking + "<mouse-2>" #'ignore + + "<down-mouse-3>" #'vc-git-stash-menu + "C-k" #'vc-git-stash-delete-at-point + "=" #'vc-git-stash-show-at-point + "RET" #'vc-git-stash-show-at-point + "A" #'vc-git-stash-apply-at-point + "P" #'vc-git-stash-pop-at-point) + +(defvar-keymap vc-git-stash-button-map + :parent vc-git-stash-shared-map + "<mouse-2>" #'push-button + "RET" #'push-button) (defconst vc-git-stash-shared-help "\\<vc-git-stash-shared-map>\\[vc-git-stash]: Create named stash\n\\[vc-git-stash-snapshot]: Snapshot stash") @@ -910,12 +904,11 @@ If toggling on, also insert its message into the buffer." standard-output 1 nil "log" "--max-count=1" "--pretty=format:%B" "HEAD"))))) -(defvar vc-git-log-edit-mode-map - (let ((map (make-sparse-keymap "Git-Log-Edit"))) - (define-key map "\C-c\C-s" #'vc-git-log-edit-toggle-signoff) - (define-key map "\C-c\C-n" #'vc-git-log-edit-toggle-no-verify) - (define-key map "\C-c\C-e" #'vc-git-log-edit-toggle-amend) - map)) +(defvar-keymap vc-git-log-edit-mode-map + :name "Git-Log-Edit" + "C-c C-s" #'vc-git-log-edit-toggle-signoff + "C-c C-n" #'vc-git-log-edit-toggle-no-verify + "C-c C-e" #'vc-git-log-edit-toggle-amend) (define-derived-mode vc-git-log-edit-mode log-edit-mode "Log-Edit/git" "Major mode for editing Git log messages. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 5fba2b3908a..61976288e35 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1177,10 +1177,9 @@ If toggling on, also insert its message into the buffer." standard-output 1 nil "log" "--limit=1" "--template" "{desc}"))))) -(defvar vc-hg-log-edit-mode-map - (let ((map (make-sparse-keymap "Hg-Log-Edit"))) - (define-key map "\C-c\C-e" #'vc-hg-log-edit-toggle-amend) - map)) +(defvar-keymap vc-hg-log-edit-mode-map + :name "Hg-Log-Edit" + "C-c C-e" #'vc-hg-log-edit-toggle-amend) (define-derived-mode vc-hg-log-edit-mode log-edit-mode "Log-Edit/hg" "Major mode for editing Hg log messages. @@ -1262,9 +1261,7 @@ REV is the revision to check out into WORKFILE." ;;; Hg specific functionality. -(defvar vc-hg-extra-menu-map - (let ((map (make-sparse-keymap))) - map)) +(defvar-keymap vc-hg-extra-menu-map) (defun vc-hg-extra-menu () vc-hg-extra-menu-map) diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 405c9bc2ca4..1f0eeb7e18a 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -855,38 +855,37 @@ In the latter case, VC mode is deactivated for this buffer." ;; Autoloading works fine, but it prevents shortcuts from appearing ;; in the menu because they don't exist yet when the menu is built. ;; (autoload 'vc-prefix-map "vc" nil nil 'keymap) -(defvar vc-prefix-map - (let ((map (make-sparse-keymap))) - (define-key map "a" #'vc-update-change-log) - (with-suppressed-warnings ((obsolete vc-switch-backend)) - (define-key map "b" #'vc-switch-backend)) - (define-key map "d" #'vc-dir) - (define-key map "g" #'vc-annotate) - (define-key map "G" #'vc-ignore) - (define-key map "h" #'vc-region-history) - (define-key map "i" #'vc-register) - (define-key map "l" #'vc-print-log) - (define-key map "L" #'vc-print-root-log) - (define-key map "I" #'vc-log-incoming) - (define-key map "O" #'vc-log-outgoing) - (define-key map "ML" #'vc-log-mergebase) - (define-key map "MD" #'vc-diff-mergebase) - (define-key map "m" #'vc-merge) - (define-key map "r" #'vc-retrieve-tag) - (define-key map "s" #'vc-create-tag) - (define-key map "u" #'vc-revert) - (define-key map "v" #'vc-next-action) - (define-key map "+" #'vc-update) - ;; I'd prefer some kind of symmetry with vc-update: - (define-key map "P" #'vc-push) - (define-key map "=" #'vc-diff) - (define-key map "D" #'vc-root-diff) - (define-key map "~" #'vc-revision-other-window) - (define-key map "x" #'vc-delete-file) - map)) +(defvar-keymap vc-prefix-map + "a" #'vc-update-change-log + "d" #'vc-dir + "g" #'vc-annotate + "G" #'vc-ignore + "h" #'vc-region-history + "i" #'vc-register + "l" #'vc-print-log + "L" #'vc-print-root-log + "I" #'vc-log-incoming + "O" #'vc-log-outgoing + "M L" #'vc-log-mergebase + "M D" #'vc-diff-mergebase + "m" #'vc-merge + "r" #'vc-retrieve-tag + "s" #'vc-create-tag + "u" #'vc-revert + "v" #'vc-next-action + "+" #'vc-update + ;; I'd prefer some kind of symmetry with vc-update: + "P" #'vc-push + "=" #'vc-diff + "D" #'vc-root-diff + "~" #'vc-revision-other-window + "x" #'vc-delete-file) (fset 'vc-prefix-map vc-prefix-map) (define-key ctl-x-map "v" 'vc-prefix-map) +(with-suppressed-warnings ((obsolete vc-switch-backend)) + (keymap-set vc-prefix-map "b" #'vc-switch-backend)) + (defvar vc-menu-map (let ((map (make-sparse-keymap "Version Control"))) ;;(define-key map [show-files] |