mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-07 06:50:23 -08:00
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
This commit is contained in:
commit
86b03046c0
1 changed files with 6 additions and 7 deletions
|
|
@ -76,12 +76,9 @@ Note that if KEY has a local binding in the current buffer,
|
||||||
that local binding will continue to shadow any global binding
|
that local binding will continue to shadow any global binding
|
||||||
that you make with this function."
|
that you make with this function."
|
||||||
(declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))
|
(declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))
|
||||||
(interactive
|
(interactive "KSet key globally:\nCSet key %s globally to command: ")
|
||||||
(let* ((menu-prompting nil)
|
(unless (stringp key)
|
||||||
(key (read-key-sequence "Set key globally: " nil t)))
|
(setq key (key-description key)))
|
||||||
(list key
|
|
||||||
(read-command (format "Set key %s to command: "
|
|
||||||
(key-description key))))))
|
|
||||||
(keymap-set (current-global-map) key command))
|
(keymap-set (current-global-map) key command))
|
||||||
|
|
||||||
(defun keymap-local-set (key command)
|
(defun keymap-local-set (key command)
|
||||||
|
|
@ -94,10 +91,12 @@ KEY is a string that satisfies `key-valid-p'.
|
||||||
The binding goes in the current buffer's local map, which in most
|
The binding goes in the current buffer's local map, which in most
|
||||||
cases is shared with all other buffers in the same major mode."
|
cases is shared with all other buffers in the same major mode."
|
||||||
(declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))
|
(declare (compiler-macro (lambda (form) (keymap--compile-check key) form)))
|
||||||
(interactive "KSet key locally: \nCSet key %s locally to command: ")
|
(interactive "KSet key locally:\nCSet key %s locally to command: ")
|
||||||
(let ((map (current-local-map)))
|
(let ((map (current-local-map)))
|
||||||
(unless map
|
(unless map
|
||||||
(use-local-map (setq map (make-sparse-keymap))))
|
(use-local-map (setq map (make-sparse-keymap))))
|
||||||
|
(unless (stringp key)
|
||||||
|
(setq key (key-description key)))
|
||||||
(keymap-set map key command)))
|
(keymap-set map key command)))
|
||||||
|
|
||||||
(defun keymap-global-unset (key &optional remove)
|
(defun keymap-global-unset (key &optional remove)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue