;; The following is to take care of any minor modes which override
;; a Calc command.
-(defvar calc-override-minor-modes-map
- (make-sparse-keymap)
- "A list of keybindings that might be overwritten by minor modes.")
+(defvar-keymap calc-override-minor-modes-map
+ :doc "A list of keybindings that might be overwritten by minor modes.")
;; Add any keys that might be overwritten here.
(define-key calc-override-minor-modes-map "`" 'calc-edit)
(backward-char 1)
(calc-set-command-flag 'do-edit))
-(defvar calc-edit-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\n" #'calc-edit-finish)
- (define-key map "\r" #'calc-edit-return)
- (define-key map "\C-c\C-c" #'calc-edit-finish)
- map)
- "Keymap for use by the `calc-edit' command.")
+(defvar-keymap calc-edit-mode-map
+ :doc "Keymap for use by the `calc-edit' command."
+ "C-j" #'calc-edit-finish
+ "RET" #'calc-edit-return
+ "C-c C-c" #'calc-edit-finish)
(defvar calc-original-buffer nil)
(defvar calc-return-buffer nil)
(calc-check-defines))
(setplist 'calc-define nil)))))
-(defvar calc-trail-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map calc-mode-map)
- map))
+(defvar-keymap calc-trail-mode-map
+ :parent calc-mode-map)
(defun calc--header-line (long short width &optional fudge)
"Return a Calc header line appropriate for the buffer WIDTH.
:group 'semantic
:type 'hook)
-(defvar semantic-mru-bookmark-mode-map
- (let ((km (make-sparse-keymap)))
- (define-key km "\C-xB" #'semantic-mrub-switch-tags)
- km)
- "Keymap for mru-bookmark minor mode.")
+(defvar-keymap semantic-mru-bookmark-mode-map
+ :doc "Keymap for mru-bookmark minor mode."
+ "C-x B" #'semantic-mrub-switch-tags)
(define-minor-mode semantic-mru-bookmark-mode
"Minor mode for tracking tag-based bookmarks automatically.
This function will set the face property on this overlay."
(overlay-put overlay 'face 'semantic-highlight-edits-face))
-(defvar semantic-highlight-edits-mode-map
- (let ((km (make-sparse-keymap)))
- km)
- "Keymap for highlight-edits minor mode.")
+(defvar-keymap semantic-highlight-edits-mode-map
+ :doc "Keymap for highlight-edits minor mode.")
;;;###autoload
(define-minor-mode semantic-highlight-edits-mode
(setq ol (cdr ol))))))
ol)))
-(defvar semantic-show-unmatched-syntax-mode-map
- (let ((km (make-sparse-keymap)))
- (define-key km "\C-c,`" #'semantic-show-unmatched-syntax-next)
- km)
- "Keymap for command `semantic-show-unmatched-syntax-mode'.")
+(defvar-keymap semantic-show-unmatched-syntax-mode-map
+ :doc "Keymap for command `semantic-show-unmatched-syntax-mode'."
+ "C-c , `" #'semantic-show-unmatched-syntax-next)
;;;###autoload
(define-minor-mode semantic-show-unmatched-syntax-mode
:group 'semantic
:type 'hook)
-(defvar semantic-show-parser-state-mode-map
- (let ((km (make-sparse-keymap)))
- km)
- "Keymap for show-parser-state minor mode.")
+(defvar-keymap semantic-show-parser-state-mode-map
+ :doc "Keymap for show-parser-state minor mode.")
;;;###autoload
(define-minor-mode semantic-show-parser-state-mode
:group 'semantic
:type 'hook)
-(defvar semantic-stickyfunc-mode-map
- (let ((km (make-sparse-keymap)))
- (define-key km [ header-line down-mouse-1 ] #'semantic-stickyfunc-menu)
- km)
- "Keymap for stickyfunc minor mode.")
+(defvar-keymap semantic-stickyfunc-mode-map
+ :doc "Keymap for stickyfunc minor mode."
+ "<header-line> <down-mouse-1>" #'semantic-stickyfunc-menu)
(defvar semantic-stickyfunc-popup-menu nil
"Menu used if the user clicks on the header line used by stickyfunc mode.")
:group 'semantic
:type 'hook)
-(defvar semantic-highlight-func-mode-map
- (let ((km (make-sparse-keymap)))
- (define-key km [mouse-3] #'semantic-highlight-func-menu)
- km)
- "Keymap for highlight-func minor mode.")
+(defvar-keymap semantic-highlight-func-mode-map
+ :doc "Keymap for highlight-func minor mode."
+ "<mouse-3>" #'semantic-highlight-func-menu)
(defvar semantic-highlight-func-popup-menu nil
"Menu used if the user clicks on the header line.
Once the escape_start, and escape_end sequences are known, then
we can tell font lock about them.")
-(defvar srecode-template-mode-map
- (let ((km (make-sparse-keymap)))
- (define-key km "\C-c\C-c" #'srecode-compile-templates)
- (define-key km "\C-c\C-m" #'srecode-macro-help)
- (define-key km "/" #'srecode-self-insert-complete-end-macro)
- km)
- "Keymap used in srecode mode.")
+(defvar-keymap srecode-template-mode-map
+ :doc "Keymap used in srecode mode."
+ "C-c C-c" #'srecode-compile-templates
+ "C-c C-m" #'srecode-macro-help
+ "/" #'srecode-self-insert-complete-end-macro)
;;;###autoload
(define-derived-mode srecode-template-mode fundamental-mode "SRecode"
(defvar gnus-next-page-line-format "%{%(Next page...%)%}\n")
(defvar gnus-prev-page-line-format "%{%(Previous page...%)%}\n")
-(defvar gnus-prev-page-map
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-2] #'gnus-button-prev-page)
- (define-key map "\r" #'gnus-button-prev-page)
- map))
+(defvar-keymap gnus-prev-page-map
+ "<mouse-2>" #'gnus-button-prev-page
+ "RET" #'gnus-button-prev-page)
-(defvar gnus-next-page-map
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-2] #'gnus-button-next-page)
- (define-key map "\r" #'gnus-button-next-page)
- map))
+(defvar-keymap gnus-next-page-map
+ "<mouse-2>" #'gnus-button-next-page
+ "RET" #'gnus-button-next-page)
(defun gnus-insert-prev-page-button ()
(let ((b (point)) e
(forward-line)))))
groups))
-(defvar gnus-search-minibuffer-map
- (let ((km (make-sparse-keymap)))
- (set-keymap-parent km minibuffer-local-map)
- (define-key km (kbd "TAB") #'completion-at-point)
- km))
+(defvar-keymap gnus-search-minibuffer-map
+ :parent minibuffer-local-map
+ "TAB" #'completion-at-point)
(defun gnus-search--complete-key-data ()
"Potentially return completion data for a search key or value."
(defvar gnus-score-edit-exit-function nil
"Function run on exit from the score buffer.")
-(defvar gnus-score-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map emacs-lisp-mode-map)
- (define-key map "\C-c\C-c" 'gnus-score-edit-exit)
- (define-key map "\C-c\C-d" 'gnus-score-edit-insert-date)
- (define-key map "\C-c\C-p" 'gnus-score-pretty-print)
- map))
+(defvar-keymap gnus-score-mode-map
+ :parent emacs-lisp-mode-map
+ "C-c C-c" #'gnus-score-edit-exit
+ "C-c C-d" #'gnus-score-edit-insert-date
+ "C-c C-p" #'gnus-score-pretty-print)
(defvar score-mode-syntax-table
(let ((table (copy-syntax-table lisp-mode-syntax-table)))
(defvar smime-buffer "*SMIME*")
-(defvar smime-mode-map
- (let ((map (make-sparse-keymap)))
- (suppress-keymap map)
- (define-key map "q" 'smime-exit)
- (define-key map "f" 'smime-certificate-info)
- map))
+(defvar-keymap smime-mode-map
+ :suppress t
+ "q" #'smime-exit
+ "f" #'smime-certificate-info)
(autoload 'gnus-completing-read "gnus-util")
:safe 'listp
:type '(repeat integer))
-(defvar edit-tab-stops-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-x\C-s" 'edit-tab-stops-note-changes)
- (define-key map "\C-c\C-c" 'edit-tab-stops-note-changes)
- map)
- "Keymap used in `edit-tab-stops'.")
+(defvar-keymap edit-tab-stops-map
+ :doc "Keymap used in `edit-tab-stops'."
+ "C-x C-s" #'edit-tab-stops-note-changes
+ "C-c C-c" #'edit-tab-stops-note-changes)
(defvar edit-tab-stops-buffer nil
"Buffer whose tab stops are being edited.
:image '(isearch-tool-bar-image "left-arrow")))
map))
-(defvar minibuffer-local-isearch-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map minibuffer-local-map)
- (define-key map "\r" 'exit-minibuffer)
- (define-key map "\M-\t" 'isearch-complete-edit)
- (define-key map "\C-s" 'isearch-forward-exit-minibuffer)
- (define-key map "\C-r" 'isearch-reverse-exit-minibuffer)
- (define-key map "\C-f" 'isearch-yank-char-in-minibuffer)
- (define-key map [right] 'isearch-yank-char-in-minibuffer)
- map)
- "Keymap for editing Isearch strings in the minibuffer.")
+(defvar-keymap minibuffer-local-isearch-map
+ :doc "Keymap for editing Isearch strings in the minibuffer."
+ :parent minibuffer-local-map
+ "RET" #'exit-minibuffer
+ "M-TAB" #'isearch-complete-edit
+ "C-s" #'isearch-forward-exit-minibuffer
+ "C-r" #'isearch-reverse-exit-minibuffer
+ "C-f" #'isearch-yank-char-in-minibuffer
+ "<right>" #'isearch-yank-char-in-minibuffer)
;; Internal variables declared globally for byte-compiler.
;; These are all set with setq while isearching
(defvar pr-i-ps-send 'printer)
-(defvar pr-interface-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map widget-keymap)
- (define-key map "q" 'pr-interface-quit)
- (define-key map "?" 'pr-interface-help)
- map)
- "Keymap for `pr-interface'.")
+(defvar-keymap pr-interface-map
+ :doc "Keymap for `pr-interface'."
+ :parent widget-keymap
+ "q" #'pr-interface-quit
+ "?" #'pr-interface-help)
(defmacro pr-interface-save (&rest body)
`(with-current-buffer pr-i-buffer
menu)
-(defvar prog-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map [?\C-\M-q] 'prog-indent-sexp)
- map)
- "Keymap used for programming modes.")
+(defvar-keymap prog-mode-map
+ :doc "Keymap used for programming modes."
+ "C-M-q" #'prog-indent-sexp)
(defvar prog-indentation-context nil
"When non-nil, provides context for indenting embedded code chunks.
"\\(\\(\\W\\|[[:lower:][:digit:]]\\)\\([[:upper:]]+\\W*\\)\\|\\W\\w+\\)"
"Regexp used by `subword-backward-internal'.")
-(defvar subword-mode-map
+(defvar-keymap subword-mode-map
;; We originally remapped motion keys here, but now use Emacs core
;; hooks. Leave this keymap around so that user additions to it
;; keep working.
- (make-sparse-keymap)
- "Keymap used in `subword-mode' minor mode.")
+ :doc "Keymap used in `subword-mode' minor mode.")
;;;###autoload
(define-obsolete-function-alias
(let ((reveal-auto-hide t))
(reveal-post-command)))
-(defvar reveal-mode-map
- (let ((map (make-sparse-keymap)))
- ;; Override the default move-beginning-of-line and move-end-of-line
- ;; which skips valuable invisible text.
- (define-key map [remap move-beginning-of-line] 'beginning-of-line)
- (define-key map [remap move-end-of-line] 'end-of-line)
- map))
+(defvar-keymap reveal-mode-map
+ ;; Override the default move-beginning-of-line and move-end-of-line
+ ;; which skips valuable invisible text.
+ "<remap> <move-beginning-of-line>" #'beginning-of-line
+ "<remap> <move-end-of-line>" #'end-of-line)
;;;###autoload
(define-minor-mode reveal-mode
"Return t if STROKE1's command name precedes STROKE2's in lexicographic order."
(string-lessp (cdr stroke1) (cdr stroke2)))
-(defvar strokes-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map [(shift down-mouse-2)] #'strokes-do-stroke)
- (define-key map [(meta down-mouse-2)] #'strokes-do-complex-stroke)
- map))
+(defvar-keymap strokes-mode-map
+ "S-<down-mouse-2>" #'strokes-do-stroke
+ "M-<down-mouse-2>" #'strokes-do-complex-stroke)
;;;###autoload
(define-minor-mode strokes-mode
;;*---------------------------------------------------------------------*/
;;* The minor mode declaration. */
;;*---------------------------------------------------------------------*/
-(defvar flyspell-mouse-map
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-2] 'flyspell-correct-word)
- map)
- "Keymap for Flyspell to put on erroneous words.")
+(defvar-keymap flyspell-mouse-map
+ :doc "Keymap for Flyspell to put on erroneous words."
+ "<mouse-2>" #'flyspell-correct-word)
(defvar flyspell-mode-map
(let ((map (make-sparse-keymap)))
(modify-syntax-entry ?. "'" st)
st))
-(defvar less-css-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-c" #'less-css-compile)
- map))
+(defvar-keymap less-css-mode-map
+ "C-c C-c" #'less-css-compile)
;;;###autoload (add-to-list 'auto-mode-alist '("\\.less\\'" . less-css-mode))
;;;###autoload
;;; Internal Functions:
-(defvar remember-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-x\C-s" #'remember-finalize)
- (define-key map "\C-c\C-c" #'remember-finalize)
- (define-key map "\C-c\C-k" #'remember-destroy)
- map)
- "Keymap used in `remember-mode'.")
+(defvar-keymap remember-mode-map
+ :doc "Keymap used in `remember-mode'."
+ "C-x C-s" #'remember-finalize
+ "C-c C-c" #'remember-finalize
+ "C-c C-k" #'remember-destroy)
(define-derived-mode remember-mode text-mode "Remember"
"Major mode for output from \\[remember].
-(defvar remember-notes-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-c" #'remember-notes-save-and-bury-buffer)
- map)
- "Keymap used in `remember-notes-mode'.")
+(defvar-keymap remember-notes-mode-map
+ :doc "Keymap used in `remember-notes-mode'."
+ "C-c C-c" #'remember-notes-save-and-bury-buffer)
(define-minor-mode remember-notes-mode
"Minor mode for the `remember-notes' buffer.
;;; The Mode.
-(defvar widget-browse-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map widget-keymap)
- (define-key map "q" #'bury-buffer)
- map)
- "Keymap for `widget-browse-mode'.")
+(defvar-keymap widget-browse-mode-map
+ :doc "Keymap for `widget-browse-mode'."
+ :parent widget-keymap
+ "q" #'bury-buffer)
(easy-menu-define widget-browse-mode-customize-menu
widget-browse-mode-map
;;; Widget Minor Mode.
-(defvar widget-minor-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map widget-keymap)
- map)
- "Keymap used in Widget Minor Mode.")
+(defvar-keymap widget-minor-mode-map
+ :doc "Keymap used in Widget Minor Mode."
+ :parent widget-keymap)
;;;###autoload
(define-minor-mode widget-minor-mode
(defvar widget-key-sequence-default-value [ignore]
"Default value for an empty key sequence.")
-(defvar widget-key-sequence-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map widget-field-keymap)
- (define-key map [(control ?q)] 'widget-key-sequence-read-event)
- map))
+(defvar-keymap widget-key-sequence-map
+ :parent widget-field-keymap
+ "C-q" #'widget-key-sequence-read-event)
(define-widget 'key-sequence 'restricted-sexp
"A key sequence. This is obsolete; use the `key' type instead."