summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2023-03-20 06:30:32 +0100
committerStefan Kangas <stefankangas@gmail.com>2023-03-20 06:30:32 +0100
commit20d8a1cf4bdc1de994b5c39a8ee02af657416c56 (patch)
tree542aff7d6767542a42e4fb6a84c69f4dece073ef /src
parentf615968fe1b4726e3914aa65e4b7c6c6be07ea70 (diff)
parentea87c54f359e3d98b4f21a0904206b3696b4bb74 (diff)
downloademacs-20d8a1cf4bdc1de994b5c39a8ee02af657416c56.tar.gz
Merge from origin/emacs-29
ea87c54f359 ; * lisp/subr.el (setq-local): Add missing period (bug#62... 90362f87d58 ; Correct last commit, downcase node reference 38067f05b92 Enhance section about troubleshooting in Eglot manual. 6f82596b490 Fix Eglot's snippet insertion to follow the manual c54bda15e35 Reset abbrevs-changed after saving abbrevs (bug#62208) e8cee15f780 ; Fix markup in previous change e4a7d0cd6ea Document `keymap-unset' in lispref bb3e0ded9eb Don't add a key binding when REMOVE is non-nil a4a9ffdd80a Fix the documentation of various aspects of adding Xref h... a2222b9a9bf ; Minor wording fix in ELisp reference manual 5cf1de683b2 Fix python-fill-paragraph problems on filling strings (bu... 7385c991dff Also exempt eglot-inlay-hints-mode from desktop.el's fumb... 1961bdb52ed ; Add WebDAV entry to index in Tramp manual dfb36d36230 Refer to EWW instead of w3 and w3m 9d3fdf7e0d4 Fix Eglot's command generation for code actions # Conflicts: # etc/NEWS
Diffstat (limited to 'src')
-rw-r--r--src/keymap.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 23453eaa9a6..efac410d317 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -887,22 +887,23 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx,
keymap_end:
/* We have scanned the entire keymap, and not found a binding for
IDX. Let's add one. */
- {
- Lisp_Object elt;
+ if (!remove)
+ {
+ Lisp_Object elt;
- if (CONSP (idx) && CHARACTERP (XCAR (idx)))
- {
- /* IDX specifies a range of characters, and not all of them
- were handled yet, which means this keymap doesn't have a
- char-table. So, we insert a char-table now. */
- elt = Fmake_char_table (Qkeymap, Qnil);
- Fset_char_table_range (elt, idx, NILP (def) ? Qt : def);
- }
- else
- elt = Fcons (idx, def);
- CHECK_IMPURE (insertion_point, XCONS (insertion_point));
- XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point)));
- }
+ if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+ {
+ /* IDX specifies a range of characters, and not all of them
+ were handled yet, which means this keymap doesn't have a
+ char-table. So, we insert a char-table now. */
+ elt = Fmake_char_table (Qkeymap, Qnil);
+ Fset_char_table_range (elt, idx, NILP (def) ? Qt : def);
+ }
+ else
+ elt = Fcons (idx, def);
+ CHECK_IMPURE (insertion_point, XCONS (insertion_point));
+ XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point)));
+ }
}
return def;