you should also set the :source-available flag for the backtrace
frames where the source code location is known.")
-(defvar backtrace-mode-map
- (let ((map (copy-keymap special-mode-map)))
- (set-keymap-parent map button-buffer-map)
- (define-key map "n" 'backtrace-forward-frame)
- (define-key map "p" 'backtrace-backward-frame)
- (define-key map "v" 'backtrace-toggle-locals)
- (define-key map "#" 'backtrace-toggle-print-circle)
- (define-key map ":" 'backtrace-toggle-print-gensym)
- (define-key map "s" 'backtrace-goto-source)
- (define-key map "\C-m" 'backtrace-help-follow-symbol)
- (define-key map "+" 'backtrace-multi-line)
- (define-key map "-" 'backtrace-single-line)
- (define-key map "." 'backtrace-expand-ellipses)
- (define-key map [follow-link] 'mouse-face)
- (define-key map [mouse-2] 'mouse-select-window)
- (easy-menu-define nil map ""
- '("Backtrace"
- ["Next Frame" backtrace-forward-frame
- :help "Move cursor forwards to the start of a backtrace frame"]
- ["Previous Frame" backtrace-backward-frame
- :help "Move cursor backwards to the start of a backtrace frame"]
- "--"
- ["Show Variables" backtrace-toggle-locals
- :style toggle
- :active (backtrace-get-index)
- :selected (plist-get (backtrace-get-view) :show-locals)
- :help "Show or hide the local variables for the frame at point"]
- ["Show Circular Structures" backtrace-toggle-print-circle
- :style toggle
- :active (backtrace-get-index)
- :selected (plist-get (backtrace-get-view) :print-circle)
- :help
- "Condense or expand shared or circular structures in the frame at point"]
- ["Show Uninterned Symbols" backtrace-toggle-print-gensym
- :style toggle
- :active (backtrace-get-index)
- :selected (plist-get (backtrace-get-view) :print-gensym)
- :help
- "Toggle unique printing of uninterned symbols in the frame at point"]
- ["Expand \"...\"s" backtrace-expand-ellipses
- :help "Expand all the abbreviated forms in the current frame"]
- ["Show on Multiple Lines" backtrace-multi-line
- :help "Use line breaks and indentation to make a form more readable"]
- ["Show on Single Line" backtrace-single-line]
- "--"
- ["Go to Source" backtrace-goto-source
- :active (and (backtrace-get-index)
- (plist-get (backtrace-frame-flags
- (nth (backtrace-get-index) backtrace-frames))
- :source-available))
- :help "Show the source code for the current frame"]
- ["Help for Symbol" backtrace-help-follow-symbol
- :help "Show help for symbol at point"]
- ["Describe Backtrace Mode" describe-mode
- :help "Display documentation for backtrace-mode"]))
- map)
- "Local keymap for `backtrace-mode' buffers.")
+(defvar-keymap backtrace-mode-map
+ :doc "Local keymap for `backtrace-mode' buffers."
+ :parent (make-composed-keymap special-mode-map
+ button-buffer-map)
+ "n" #'backtrace-forward-frame
+ "p" #'backtrace-backward-frame
+ "v" #'backtrace-toggle-locals
+ "#" #'backtrace-toggle-print-circle
+ ":" #'backtrace-toggle-print-gensym
+ "s" #'backtrace-goto-source
+ "RET" #'backtrace-help-follow-symbol
+ "+" #'backtrace-multi-line
+ "-" #'backtrace-single-line
+ "." #'backtrace-expand-ellipses
+ "<follow-link>" 'mouse-face
+ "<mouse-2>" #'mouse-select-window
+
+ :menu
+ '("Backtrace"
+ ["Next Frame" backtrace-forward-frame
+ :help "Move cursor forwards to the start of a backtrace frame"]
+ ["Previous Frame" backtrace-backward-frame
+ :help "Move cursor backwards to the start of a backtrace frame"]
+ "--"
+ ["Show Variables" backtrace-toggle-locals
+ :style toggle
+ :active (backtrace-get-index)
+ :selected (plist-get (backtrace-get-view) :show-locals)
+ :help "Show or hide the local variables for the frame at point"]
+ ["Show Circular Structures" backtrace-toggle-print-circle
+ :style toggle
+ :active (backtrace-get-index)
+ :selected (plist-get (backtrace-get-view) :print-circle)
+ :help
+ "Condense or expand shared or circular structures in the frame at point"]
+ ["Show Uninterned Symbols" backtrace-toggle-print-gensym
+ :style toggle
+ :active (backtrace-get-index)
+ :selected (plist-get (backtrace-get-view) :print-gensym)
+ :help
+ "Toggle unique printing of uninterned symbols in the frame at point"]
+ ["Expand \"...\"s" backtrace-expand-ellipses
+ :help "Expand all the abbreviated forms in the current frame"]
+ ["Show on Multiple Lines" backtrace-multi-line
+ :help "Use line breaks and indentation to make a form more readable"]
+ ["Show on Single Line" backtrace-single-line]
+ "--"
+ ["Go to Source" backtrace-goto-source
+ :active (and (backtrace-get-index)
+ (plist-get (backtrace-frame-flags
+ (nth (backtrace-get-index) backtrace-frames))
+ :source-available))
+ :help "Show the source code for the current frame"]
+ ["Help for Symbol" backtrace-help-follow-symbol
+ :help "Show help for symbol at point"]
+ ["Describe Backtrace Mode" describe-mode
+ :help "Display documentation for backtrace-mode"]))
(defconst backtrace--flags-width 2
"Width in characters of the flags for a backtrace frame.")
:type '(repeat (choice (const :tag "Default" nil)
(string :tag "Directory"))))
-(defvar emacs-lisp-compilation-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "g" 'emacs-lisp-compilation-recompile)
- map))
+(defvar-keymap emacs-lisp-compilation-mode-map
+ "g" #'emacs-lisp-compilation-recompile)
(defvar emacs-lisp-compilation--current-file nil)
;;; Minor Mode specification
;;
-(defvar checkdoc-minor-mode-map
- (let ((map (make-sparse-keymap))
- (pmap (make-sparse-keymap)))
- ;; Override some bindings
- (define-key map "\C-\M-x" #'checkdoc-eval-defun)
- (define-key map "\C-x`" #'checkdoc-continue)
- (define-key map [menu-bar emacs-lisp eval-buffer]
- #'checkdoc-eval-current-buffer)
- ;; Add some new bindings under C-c ?
- (define-key pmap "x" #'checkdoc-defun)
- (define-key pmap "X" #'checkdoc-ispell-defun)
- (define-key pmap "`" #'checkdoc-continue)
- (define-key pmap "~" #'checkdoc-ispell-continue)
- (define-key pmap "s" #'checkdoc-start)
- (define-key pmap "S" #'checkdoc-ispell-start)
- (define-key pmap "d" #'checkdoc)
- (define-key pmap "D" #'checkdoc-ispell)
- (define-key pmap "b" #'checkdoc-current-buffer)
- (define-key pmap "B" #'checkdoc-ispell-current-buffer)
- (define-key pmap "e" #'checkdoc-eval-current-buffer)
- (define-key pmap "m" #'checkdoc-message-text)
- (define-key pmap "M" #'checkdoc-ispell-message-text)
- (define-key pmap "c" #'checkdoc-comments)
- (define-key pmap "C" #'checkdoc-ispell-comments)
- (define-key pmap " " #'checkdoc-rogue-spaces)
-
- ;; bind our submap into map
- (define-key map "\C-c?" pmap)
- map)
- "Keymap used to override evaluation key-bindings for documentation checking.")
-
-;; Add in a menubar with easy-menu
+(defvar-keymap checkdoc-minor-mode-map
+ :doc "Keymap used to override evaluation key-bindings for documentation checking."
+ ;; Override some bindings
+ "C-M-x" #'checkdoc-eval-defun
+ "C-x `" #'checkdoc-continue
+ "<menu-bar> <emacs-lisp> <eval-buffer>" #'checkdoc-eval-current-buffer
+
+ ;; Add some new bindings under C-c ?
+ "C-c ? x" #'checkdoc-defun
+ "C-c ? X" #'checkdoc-ispell-defun
+ "C-c ? `" #'checkdoc-continue
+ "C-c ? ~" #'checkdoc-ispell-continue
+ "C-c ? s" #'checkdoc-start
+ "C-c ? S" #'checkdoc-ispell-start
+ "C-c ? d" #'checkdoc
+ "C-c ? D" #'checkdoc-ispell
+ "C-c ? b" #'checkdoc-current-buffer
+ "C-c ? B" #'checkdoc-ispell-current-buffer
+ "C-c ? e" #'checkdoc-eval-current-buffer
+ "C-c ? m" #'checkdoc-message-text
+ "C-c ? M" #'checkdoc-ispell-message-text
+ "C-c ? c" #'checkdoc-comments
+ "C-c ? C" #'checkdoc-ispell-comments
+ "C-c ? SPC" #'checkdoc-rogue-spaces)
(easy-menu-define nil checkdoc-minor-mode-map
"Checkdoc Minor Mode Menu."
It should be a regexp that does not match the list of completion candidates.
The default value is `crm-default-separator'.")
-(defvar crm-local-completion-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map minibuffer-local-completion-map)
- (define-key map [remap minibuffer-complete] #'crm-complete)
- (define-key map [remap minibuffer-complete-word] #'crm-complete-word)
- (define-key map [remap minibuffer-completion-help] #'crm-completion-help)
- map)
- "Local keymap for minibuffer multiple input with completion.
-Analog of `minibuffer-local-completion-map'.")
-
-(defvar crm-local-must-match-map
- (let ((map (make-sparse-keymap)))
- ;; We'd want to have multiple inheritance here.
- (set-keymap-parent map minibuffer-local-must-match-map)
- (define-key map [remap minibuffer-complete] #'crm-complete)
- (define-key map [remap minibuffer-complete-word] #'crm-complete-word)
- (define-key map [remap minibuffer-completion-help] #'crm-completion-help)
- (define-key map [remap minibuffer-complete-and-exit]
- #'crm-complete-and-exit)
- map)
- "Local keymap for minibuffer multiple input with exact match completion.
-Analog of `minibuffer-local-must-match-map' for crm.")
+(defvar-keymap crm-local-completion-map
+ :doc "Local keymap for minibuffer multiple input with completion.
+Analog of `minibuffer-local-completion-map'."
+ :parent minibuffer-local-completion-map
+ "<remap> <minibuffer-complete>" #'crm-complete
+ "<remap> <minibuffer-complete-word>" #'crm-complete-word
+ "<remap> <minibuffer-completion-help>" #'crm-completion-help)
+
+(defvar-keymap crm-local-must-match-map
+ :doc "Local keymap for minibuffer multiple input with exact match completion.
+Analog of `minibuffer-local-must-match-map' for crm."
+ ;; We'd want to have multiple inheritance here.
+ :parent minibuffer-local-must-match-map
+ "<remap> <minibuffer-complete>" #'crm-complete
+ "<remap> <minibuffer-complete-word>" #'crm-complete-word
+ "<remap> <minibuffer-completion-help>" #'crm-completion-help
+ "<remap> <minibuffer-complete-and-exit>" #'crm-complete-and-exit)
(defvar crm-completion-table nil
"An alist whose elements' cars are strings, or an obarray.
'backtrace-toggle-locals "28.1")
\f
-(defvar debugger-mode-map
- (let ((map (make-keymap)))
- (set-keymap-parent map backtrace-mode-map)
- (define-key map "b" 'debugger-frame)
- (define-key map "c" 'debugger-continue)
- (define-key map "j" 'debugger-jump)
- (define-key map "r" 'debugger-return-value)
- (define-key map "u" 'debugger-frame-clear)
- (define-key map "d" 'debugger-step-through)
- (define-key map "l" 'debugger-list-functions)
- (define-key map "q" 'debugger-quit)
- (define-key map "e" 'debugger-eval-expression)
- (define-key map "R" 'debugger-record-expression)
- (define-key map [mouse-2] 'push-button)
- (easy-menu-define nil map ""
- '("Debugger"
- ["Step through" debugger-step-through
- :help "Proceed, stepping through subexpressions of this expression"]
- ["Continue" debugger-continue
- :help "Continue, evaluating this expression without stopping"]
- ["Jump" debugger-jump
- :help "Continue to exit from this frame, with all debug-on-entry suspended"]
- ["Eval Expression..." debugger-eval-expression
- :help "Eval an expression, in an environment like that outside the debugger"]
- ["Display and Record Expression" debugger-record-expression
- :help "Display a variable's value and record it in `*Backtrace-record*' buffer"]
- ["Return value..." debugger-return-value
- :help "Continue, specifying value to return."]
- "--"
- ["Debug frame" debugger-frame
- :help "Request entry to debugger when this frame exits"]
- ["Cancel debug frame" debugger-frame-clear
- :help "Do not enter debugger when this frame exits"]
- ["List debug on entry functions" debugger-list-functions
- :help "Display a list of all the functions now set to debug on entry"]
- "--"
- ["Next Line" next-line
- :help "Move cursor down"]
- ["Help for Symbol" backtrace-help-follow-symbol
- :help "Show help for symbol at point"]
- ["Describe Debugger Mode" describe-mode
- :help "Display documentation for debugger-mode"]
- "--"
- ["Quit" debugger-quit
- :help "Quit debugging and return to top level"]))
- map))
+(defvar-keymap debugger-mode-map
+ :full t
+ :parent backtrace-mode-map
+ "b" #'debugger-frame
+ "c" #'debugger-continue
+ "j" #'debugger-jump
+ "r" #'debugger-return-value
+ "u" #'debugger-frame-clear
+ "d" #'debugger-step-through
+ "l" #'debugger-list-functions
+ "q" #'debugger-quit
+ "e" #'debugger-eval-expression
+ "R" #'debugger-record-expression
+
+ "<mouse-2>" #'push-button
+
+ :menu
+ '("Debugger"
+ ["Step through" debugger-step-through
+ :help "Proceed, stepping through subexpressions of this expression"]
+ ["Continue" debugger-continue
+ :help "Continue, evaluating this expression without stopping"]
+ ["Jump" debugger-jump
+ :help "Continue to exit from this frame, with all debug-on-entry suspended"]
+ ["Eval Expression..." debugger-eval-expression
+ :help "Eval an expression, in an environment like that outside the debugger"]
+ ["Display and Record Expression" debugger-record-expression
+ :help "Display a variable's value and record it in `*Backtrace-record*' buffer"]
+ ["Return value..." debugger-return-value
+ :help "Continue, specifying value to return."]
+ "--"
+ ["Debug frame" debugger-frame
+ :help "Request entry to debugger when this frame exits"]
+ ["Cancel debug frame" debugger-frame-clear
+ :help "Do not enter debugger when this frame exits"]
+ ["List debug on entry functions" debugger-list-functions
+ :help "Display a list of all the functions now set to debug on entry"]
+ "--"
+ ["Next Line" next-line
+ :help "Move cursor down"]
+ ["Help for Symbol" backtrace-help-follow-symbol
+ :help "Show help for symbol at point"]
+ ["Describe Debugger Mode" describe-mode
+ :help "Display documentation for debugger-mode"]
+ "--"
+ ["Quit" debugger-quit
+ :help "Quit debugging and return to top level"]))
(put 'debugger-mode 'mode-class 'special)
;; The following isn't a GUD binding.
(define-key emacs-lisp-mode-map "\C-x\C-a\C-m" 'edebug-set-initial-mode))
-(defvar edebug-mode-map
- (let ((map (copy-keymap emacs-lisp-mode-map)))
- ;; control
- (define-key map " " 'edebug-step-mode)
- (define-key map "n" 'edebug-next-mode)
- (define-key map "g" 'edebug-go-mode)
- (define-key map "G" 'edebug-Go-nonstop-mode)
- (define-key map "t" 'edebug-trace-mode)
- (define-key map "T" 'edebug-Trace-fast-mode)
- (define-key map "c" 'edebug-continue-mode)
- (define-key map "C" 'edebug-Continue-fast-mode)
-
- ;;(define-key map "f" 'edebug-forward) not implemented
- (define-key map "f" 'edebug-forward-sexp)
- (define-key map "h" 'edebug-goto-here)
-
- (define-key map "I" 'edebug-instrument-callee)
- (define-key map "i" 'edebug-step-in)
- (define-key map "o" 'edebug-step-out)
-
- ;; quitting and stopping
- (define-key map "q" 'top-level)
- (define-key map "Q" 'edebug-top-level-nonstop)
- (define-key map "a" 'abort-recursive-edit)
- (define-key map "S" 'edebug-stop)
-
- ;; breakpoints
- (define-key map "b" 'edebug-set-breakpoint)
- (define-key map "u" 'edebug-unset-breakpoint)
- (define-key map "U" 'edebug-unset-breakpoints)
- (define-key map "B" 'edebug-next-breakpoint)
- (define-key map "x" 'edebug-set-conditional-breakpoint)
- (define-key map "X" 'edebug-set-global-break-condition)
- (define-key map "D" 'edebug-toggle-disable-breakpoint)
-
- ;; evaluation
- (define-key map "r" 'edebug-previous-result)
- (define-key map "e" 'edebug-eval-expression)
- (define-key map "\C-x\C-e" 'edebug-eval-last-sexp)
- (define-key map "E" 'edebug-visit-eval-list)
-
- ;; views
- (define-key map "w" 'edebug-where)
- (define-key map "v" 'edebug-view-outside) ;; maybe obsolete??
- (define-key map "p" 'edebug-bounce-point)
- (define-key map "P" 'edebug-view-outside) ;; same as v
- (define-key map "W" 'edebug-toggle-save-windows)
-
- ;; misc
- (define-key map "?" 'edebug-help)
- (define-key map "d" 'edebug-pop-to-backtrace)
-
- (define-key map "-" 'negative-argument)
-
- ;; statistics
- (define-key map "=" 'edebug-temp-display-freq-count)
-
- ;; GUD bindings
- (define-key map "\C-c\C-s" 'edebug-step-mode)
- (define-key map "\C-c\C-n" 'edebug-next-mode)
- (define-key map "\C-c\C-c" 'edebug-go-mode)
-
- (define-key map "\C-x " 'edebug-set-breakpoint)
- (define-key map "\C-c\C-d" 'edebug-unset-breakpoint)
- (define-key map "\C-c\C-t"
- (lambda () (interactive) (edebug-set-breakpoint t)))
- (define-key map "\C-c\C-l" 'edebug-where)
- map))
+(defvar-keymap edebug-mode-map
+ :parent emacs-lisp-mode-map
+ ;; control
+ "SPC" #'edebug-step-mode
+ "n" #'edebug-next-mode
+ "g" #'edebug-go-mode
+ "G" #'edebug-Go-nonstop-mode
+ "t" #'edebug-trace-mode
+ "T" #'edebug-Trace-fast-mode
+ "c" #'edebug-continue-mode
+ "C" #'edebug-Continue-fast-mode
+
+ ;;"f" #'edebug-forward ; not implemented
+ "f" #'edebug-forward-sexp
+ "h" #'edebug-goto-here
+
+ "I" #'edebug-instrument-callee
+ "i" #'edebug-step-in
+ "o" #'edebug-step-out
+
+ ;; quitting and stopping
+ "q" #'top-level
+ "Q" #'edebug-top-level-nonstop
+ "a" #'abort-recursive-edit
+ "S" #'edebug-stop
+
+ ;; breakpoints
+ "b" #'edebug-set-breakpoint
+ "u" #'edebug-unset-breakpoint
+ "U" #'edebug-unset-breakpoints
+ "B" #'edebug-next-breakpoint
+ "x" #'edebug-set-conditional-breakpoint
+ "X" #'edebug-set-global-break-condition
+ "D" #'edebug-toggle-disable-breakpoint
+
+ ;; evaluation
+ "r" #'edebug-previous-result
+ "e" #'edebug-eval-expression
+ "C-x C-e" #'edebug-eval-last-sexp
+ "E" #'edebug-visit-eval-list
+
+ ;; views
+ "w" #'edebug-where
+ "v" #'edebug-view-outside ; maybe obsolete??
+ "p" #'edebug-bounce-point
+ "P" #'edebug-view-outside ; same as v
+ "W" #'edebug-toggle-save-windows
+
+ ;; misc
+ "?" #'edebug-help
+ "d" #'edebug-pop-to-backtrace
+
+ "-" #'negative-argument
+
+ ;; statistics
+ "=" #'edebug-temp-display-freq-count
+
+ ;; GUD bindings
+ "C-c C-s" #'edebug-step-mode
+ "C-c C-n" #'edebug-next-mode
+ "C-c C-c" #'edebug-go-mode
+
+ "C-x SPC" #'edebug-set-breakpoint
+ "C-c C-d" #'edebug-unset-breakpoint
+ "C-c C-t" (lambda () (interactive) (edebug-set-breakpoint t))
+ "C-c C-l" #'edebug-where)
;; Autoloading these global bindings doesn't make sense because
;; they cannot be used anyway unless Edebug is already loaded and active.
(define-obsolete-variable-alias 'global-edebug-map
'edebug-global-map "28.1")
-(defvar edebug-global-map
- (let ((map (make-sparse-keymap)))
-
- (define-key map " " 'edebug-step-mode)
- (define-key map "g" 'edebug-go-mode)
- (define-key map "G" 'edebug-Go-nonstop-mode)
- (define-key map "t" 'edebug-trace-mode)
- (define-key map "T" 'edebug-Trace-fast-mode)
- (define-key map "c" 'edebug-continue-mode)
- (define-key map "C" 'edebug-Continue-fast-mode)
-
- ;; breakpoints
- (define-key map "b" 'edebug-set-breakpoint)
- (define-key map "u" 'edebug-unset-breakpoint)
- (define-key map "U" 'edebug-unset-breakpoints)
- (define-key map "x" 'edebug-set-conditional-breakpoint)
- (define-key map "X" 'edebug-set-global-break-condition)
- (define-key map "D" 'edebug-toggle-disable-breakpoint)
-
- ;; views
- (define-key map "w" 'edebug-where)
- (define-key map "W" 'edebug-toggle-save-windows)
-
- ;; quitting
- (define-key map "q" 'top-level)
- (define-key map "Q" 'edebug-top-level-nonstop)
- (define-key map "a" 'abort-recursive-edit)
-
- ;; statistics
- (define-key map "=" 'edebug-display-freq-count)
- map)
- "Global map of edebug commands, available from any buffer.")
+(defvar-keymap edebug-global-map
+ :doc "Global map of edebug commands, available from any buffer."
+ "SPC" #'edebug-step-mode
+ "g" #'edebug-go-mode
+ "G" #'edebug-Go-nonstop-mode
+ "t" #'edebug-trace-mode
+ "T" #'edebug-Trace-fast-mode
+ "c" #'edebug-continue-mode
+ "C" #'edebug-Continue-fast-mode
+
+ ;; breakpoints
+ "b" #'edebug-set-breakpoint
+ "u" #'edebug-unset-breakpoint
+ "U" #'edebug-unset-breakpoints
+ "x" #'edebug-set-conditional-breakpoint
+ "X" #'edebug-set-global-break-condition
+ "D" #'edebug-toggle-disable-breakpoint
+
+ ;; views
+ "w" #'edebug-where
+ "W" #'edebug-toggle-save-windows
+
+ ;; quitting
+ "q" #'top-level
+ "Q" #'edebug-top-level-nonstop
+ "a" #'abort-recursive-edit
+
+ ;; statistics
+ "=" #'edebug-display-freq-count)
(when edebug-global-prefix
(global-unset-key edebug-global-prefix)
-(defvar edebug-eval-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map lisp-interaction-mode-map)
- (define-key map "\C-c\C-w" 'edebug-where)
- (define-key map "\C-c\C-d" 'edebug-delete-eval-item)
- (define-key map "\C-c\C-u" 'edebug-update-eval-list)
- (define-key map "\C-x\C-e" 'edebug-eval-last-sexp)
- (define-key map "\C-j" 'edebug-eval-print-last-sexp)
- map)
- "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.")
+(defvar-keymap edebug-eval-mode-map
+ :doc "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode."
+ :parent lisp-interaction-mode-map
+ "C-c C-w" #'edebug-where
+ "C-c C-d" #'edebug-delete-eval-item
+ "C-c C-u" #'edebug-update-eval-list
+ "C-x C-e" #'edebug-eval-last-sexp
+ "C-j" #'edebug-eval-print-last-sexp)
(put 'edebug-eval-mode 'mode-class 'special)
Optional argument GROUP is the sub-group of slots to display."
(eieio-customize-object obj group))
-(defvar eieio-custom-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map widget-keymap)
- map)
- "Keymap for EIEIO Custom mode.")
+(defvar-keymap eieio-custom-mode-map
+ :doc "Keymap for EIEIO Custom mode."
+ :parent widget-keymap)
(define-derived-mode eieio-custom-mode fundamental-mode "EIEIO Custom"
"Major mode for customizing EIEIO objects.
(insert atstr))
(insert "\n"))))
-(defvar elp-results-symname-map
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-2] 'elp-results-jump-to-definition)
- (define-key map [follow-link] 'mouse-face)
- (define-key map "\C-m" 'elp-results-jump-to-definition)
- map)
- "Keymap used on the function name column." )
+(defvar-keymap elp-results-symname-map
+ :doc "Keymap used on the function name column."
+ "<mouse-2>" #'elp-results-jump-to-definition
+ "<follow-link>" 'mouse-face
+ "RET" #'elp-results-jump-to-definition)
(defun elp-results-jump-to-definition (&optional event)
"Jump to the definition of the function at point."
(progn (forward-sexp 1)
(point)))))))
-(defvar lisp-mode-shared-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map prog-mode-map)
- (define-key map "\e\C-q" 'indent-sexp)
- (define-key map "\177" 'backward-delete-char-untabify)
- ;; This gets in the way when viewing a Lisp file in view-mode. As
- ;; long as [backspace] is mapped into DEL via the
- ;; function-key-map, this should remain disabled!!
- ;;;(define-key map [backspace] 'backward-delete-char-untabify)
- map)
- "Keymap for commands shared by all sorts of Lisp modes.")
+(defvar-keymap lisp-mode-shared-map
+ :doc "Keymap for commands shared by all sorts of Lisp modes."
+ :parent prog-mode-map
+ "C-M-q" #'indent-sexp
+ "DEL" #'backward-delete-char-untabify
+ ;; This gets in the way when viewing a Lisp file in view-mode. As
+ ;; long as [backspace] is mapped into DEL via the
+ ;; function-key-map, this should remain disabled!!
+ ;;;"<backspace>" #'backward-delete-char-untabify
+ )
(defcustom lisp-mode-hook nil
"Hook run when entering Lisp mode."
;;; Generic Lisp mode.
-(defvar lisp-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map lisp-mode-shared-map)
- (define-key map "\e\C-x" 'lisp-eval-defun)
- (define-key map "\C-c\C-z" 'run-lisp)
- map)
- "Keymap for ordinary Lisp mode.
-All commands in `lisp-mode-shared-map' are inherited by this map.")
+(defvar-keymap lisp-mode-map
+ :doc "Keymap for ordinary Lisp mode.
+All commands in `lisp-mode-shared-map' are inherited by this map."
+ :parent lisp-mode-shared-map
+ "C-M-x" #'lisp-eval-defun
+ "C-c C-z" #'run-lisp)
(easy-menu-define lisp-mode-menu lisp-mode-map
"Menu for ordinary Lisp mode."
"Buffer to use for the RE Builder.")
;; Define the local "\C-c" keymap
-(defvar reb-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-c" 'reb-toggle-case)
- (define-key map "\C-c\C-q" 'reb-quit)
- (define-key map "\C-c\C-w" 'reb-copy)
- (define-key map "\C-c\C-s" 'reb-next-match)
- (define-key map "\C-c\C-r" 'reb-prev-match)
- (define-key map "\C-c\C-i" 'reb-change-syntax)
- (define-key map "\C-c\C-e" 'reb-enter-subexp-mode)
- (define-key map "\C-c\C-b" 'reb-change-target-buffer)
- (define-key map "\C-c\C-u" 'reb-force-update)
- map)
- "Keymap used by the RE Builder.")
+(defvar-keymap reb-mode-map
+ :doc "Keymap used by the RE Builder."
+ "C-c C-c" #'reb-toggle-case
+ "C-c C-q" #'reb-quit
+ "C-c C-w" #'reb-copy
+ "C-c C-s" #'reb-next-match
+ "C-c C-r" #'reb-prev-match
+ "C-c C-i" #'reb-change-syntax
+ "C-c C-e" #'reb-enter-subexp-mode
+ "C-c C-b" #'reb-change-target-buffer
+ "C-c C-u" #'reb-force-update)
(easy-menu-define reb-mode-menu reb-mode-map
"Menu for the RE Builder."
(setq-local blink-matching-paren nil)
(reb-mode-common))
-(defvar reb-lisp-mode-map
- (let ((map (make-sparse-keymap)))
- ;; Use the same "\C-c" keymap as `reb-mode' and use font-locking from
- ;; `emacs-lisp-mode'
- (define-key map "\C-c" (lookup-key reb-mode-map "\C-c"))
- map))
+(defvar-keymap reb-lisp-mode-map
+ ;; Use the same "\C-c" keymap as `reb-mode' and use font-locking from
+ ;; `emacs-lisp-mode'
+ "C-c" (keymap-lookup reb-mode-map "C-c"))
(define-derived-mode reb-lisp-mode
emacs-lisp-mode "RE Builder Lisp"
(require 'rx)) ; require rx anyway
(reb-mode-common))
-(defvar reb-subexp-mode-map
- (let ((m (make-keymap)))
- (suppress-keymap m)
- ;; Again share the "\C-c" keymap for the commands
- (define-key m "\C-c" (lookup-key reb-mode-map "\C-c"))
- (define-key m "q" 'reb-quit-subexp-mode)
- (dotimes (digit 10)
- (define-key m (int-to-string digit) 'reb-display-subexp))
- m)
- "Keymap used by the RE Builder for the subexpression mode.")
+(defvar-keymap reb-subexp-mode-map
+ :doc "Keymap used by the RE Builder for the subexpression mode."
+ :full t :suppress t
+ ;; Again share the "\C-c" keymap for the commands
+ "C-c" (keymap-lookup reb-mode-map "C-c")
+ "q" #'reb-quit-subexp-mode
+ "0" #'reb-display-subexp
+ "1" #'reb-display-subexp
+ "2" #'reb-display-subexp
+ "3" #'reb-display-subexp
+ "4" #'reb-display-subexp
+ "5" #'reb-display-subexp
+ "6" #'reb-display-subexp
+ "7" #'reb-display-subexp
+ "8" #'reb-display-subexp
+ "9" #'reb-display-subexp)
(defun reb-mode-common ()
"Setup functions common to functions `reb-mode' and `reb-lisp-mode'."
(while (re-search-forward re nil 'noerror)
(tabulated-list-put-tag empty)))))
-(defvar tabulated-list-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map (make-composed-keymap
- button-buffer-map
- special-mode-map))
- (define-key map "n" 'next-line)
- (define-key map "p" 'previous-line)
- (define-key map (kbd "M-<left>") 'tabulated-list-previous-column)
- (define-key map (kbd "M-<right>") 'tabulated-list-next-column)
- (define-key map "S" 'tabulated-list-sort)
- (define-key map "}" 'tabulated-list-widen-current-column)
- (define-key map "{" 'tabulated-list-narrow-current-column)
- (define-key map [follow-link] 'mouse-face)
- (define-key map [mouse-2] 'mouse-select-window)
- map)
- "Local keymap for `tabulated-list-mode' buffers.")
-
-(defvar tabulated-list-sort-button-map
- (let ((map (make-sparse-keymap)))
- (define-key map [header-line mouse-1] 'tabulated-list-col-sort)
- (define-key map [header-line mouse-2] 'tabulated-list-col-sort)
- (define-key map [mouse-1] 'tabulated-list-col-sort)
- (define-key map [mouse-2] 'tabulated-list-col-sort)
- (define-key map "\C-m" 'tabulated-list-sort)
- (define-key map [follow-link] 'mouse-face)
- map)
- "Local keymap for `tabulated-list-mode' sort buttons.")
+(defvar-keymap tabulated-list-mode-map
+ :doc "Local keymap for `tabulated-list-mode' buffers."
+ :parent (make-composed-keymap button-buffer-map
+ special-mode-map)
+ "n" #'next-line
+ "p" #'previous-line
+ "M-<left>" #'tabulated-list-previous-column
+ "M-<right>" #'tabulated-list-next-column
+ "S" #'tabulated-list-sort
+ "}" #'tabulated-list-widen-current-column
+ "{" #'tabulated-list-narrow-current-column
+ "<follow-link>" 'mouse-face
+ "<mouse-2>" #'mouse-select-window)
+
+(defvar-keymap tabulated-list-sort-button-map
+ :doc "Local keymap for `tabulated-list-mode' sort buttons."
+ "<header-line> <mouse-1>" #'tabulated-list-col-sort
+ "<header-line> <mouse-2>" #'tabulated-list-col-sort
+ "<mouse-1>" #'tabulated-list-col-sort
+ "<mouse-2>" #'tabulated-list-col-sort
+ "RET" #'tabulated-list-sort
+ "<follow-link>" 'mouse-face)
(defun tabulated-list-make-glyphless-char-display-table ()
"Make the `glyphless-char-display' table used for text-mode frames.
;; doing. Kids, don't try this at home!
;;;###autoload (put 'list-timers 'disabled "Beware: manually canceling timers can ruin your Emacs session.")
-(defvar timer-list-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "c" 'timer-list-cancel)
- (easy-menu-define nil map ""
- '("Timers"
- ["Cancel" timer-list-cancel t]))
- map))
+(defvar-keymap timer-list-mode-map
+ "c" #'timer-list-cancel
+ :menu
+ '("Timers"
+ ["Cancel" timer-list-cancel t]))
(define-derived-mode timer-list-mode tabulated-list-mode "Timer-List"
"Mode for listing and controlling timers."