diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2024-10-04 20:44:53 +0800 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2024-10-04 20:46:00 +0800 |
commit | 1094c3f91477e622e064fa52de7fd0f361e54d9b (patch) | |
tree | e622825e3d63e1af478da31177ee75a62ce7cc3d /lisp/emacs-lisp | |
parent | ea7be865ac09d41844d04e5576dcd10a1d7d7d54 (diff) | |
download | emacs-1094c3f91477e622e064fa52de7fd0f361e54d9b.tar.gz emacs-1094c3f91477e622e064fa52de7fd0f361e54d9b.tar.bz2 emacs-1094c3f91477e622e064fa52de7fd0f361e54d9b.zip |
find-function-mode: Define keys at a low precedence level
* lisp/emacs-lisp/find-func.el (find-function-mode-map): Delete.
(find-function-mode): Define keys at the precedence level of
the global map for compatibility with the historical behavior of
find-function-setup-keys.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/find-func.el | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index c031ee427d4..f3ddf9f81c9 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -805,28 +805,30 @@ See `find-function-on-key'." (when (and symb (not (equal symb 0))) (find-variable-other-window symb)))) -(defvar-keymap find-function-mode-map - "C-x F" #'find-function - "C-x 4 F" #'find-function-other-window - "C-x 5 F" #'find-function-other-frame - - "C-x K" #'find-function-on-key - "C-x 4 K" #'find-function-on-key-other-window - "C-x 5 K" #'find-function-on-key-other-frame - - "C-x V" #'find-variable - "C-x 4 V" #'find-variable-other-window - "C-x 5 V" #'find-variable-other-frame - - "C-x L" #'find-library - "C-x 4 L" #'find-library-other-window - "C-x 5 L" #'find-library-other-frame) - ;;;###autoload (define-minor-mode find-function-mode "Enable some key bindings for the `find-function' family of functions." - :global t :lighter nil ; compat. with old `find-function-setup-keys' - :group 'find-function :version "31.1") + :group 'find-function :version "31.1" :global t :lighter nil + ;; For compatibility with the historical behavior of the old + ;; `find-function-setup-keys', define our bindings at the precedence + ;; level of the global map. + :keymap nil + (pcase-dolist (`(,map ,key ,cmd) + `((,ctl-x-map "F" find-function) + (,ctl-x-4-map "F" find-function-other-window) + (,ctl-x-5-map "F" find-function-other-frame) + (,ctl-x-map "K" find-function-on-key) + (,ctl-x-4-map "K" find-function-on-key-other-window) + (,ctl-x-5-map "K" find-function-on-key-other-frame) + (,ctl-x-map "V" find-variable) + (,ctl-x-4-map "V" find-variable-other-window) + (,ctl-x-5-map "V" find-variable-other-frame) + (,ctl-x-map "L" find-library) + (,ctl-x-4-map "L" find-library-other-window) + (,ctl-x-5-map "L" find-library-other-frame))) + (if find-function-mode + (keymap-set map key cmd) + (keymap-unset map key t)))) ;;;###autoload (defun find-function-setup-keys () |