;; 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."
(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
: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
;; 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")))
(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."
: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")
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.
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.
;;; 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)
;; 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]