]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix recursive set-keymap-parent in completions-highlight.
authorJimmy Aguilar Mena <spacibba@aol.com>
Thu, 27 Aug 2020 00:34:13 +0000 (02:34 +0200)
committerJimmy Aguilar Mena <spacibba@aol.com>
Fri, 20 Nov 2020 18:03:23 +0000 (19:03 +0100)
*
lisp/completions-highlight.el (completions-highlight-minibuffer-bindings)
:
(completions-highlight-completions-bindings) : Condition
set-keymap-parent to avoid error.

lisp/completions-highlight.el

index a16e4f972edb801c6c7159bdf50793de0e02eaf5..00b7382f51985ee161da570bfe709795595ba116 100644 (file)
@@ -211,9 +211,12 @@ suffix."
 When SET is nil the bindings are removed."
   (if set
       (let ((local-map (current-local-map)))
-        (setq completions-highlight-minibuffer-map-save local-map)
-        (set-keymap-parent completions-highlight-minibuffer-map local-map)
-        (use-local-map completions-highlight-minibuffer-map))
+        (unless (eq local-map completions-highlight-minibuffer-map)
+          (setq completions-highlight-minibuffer-map-save local-map)
+          (unless (eq local-map
+                      (keymap-parent completions-highlight-minibuffer-map))
+            (set-keymap-parent completions-highlight-minibuffer-map local-map))
+          (use-local-map completions-highlight-minibuffer-map)))
 
     (use-local-map completions-highlight-minibuffer-map-save)))
 
@@ -222,11 +225,11 @@ When SET is nil the bindings are removed."
   "Add extra keybindings to `completion-list-mode-map'.
 When SET is nil the bindings are removed."
   (if set
-      (unless (keymap-parent completions-highlight-completions-map)
         (let ((local-map (current-local-map)))
-          (setq completions-highlight-completions-map-save local-map)
-          (set-keymap-parent completions-highlight-completions-map local-map)
-          (use-local-map completions-highlight-completions-map)))
+          (unless (eq local-map completions-highlight-completions-map)
+            (setq completions-highlight-completions-map-save local-map)
+            (set-keymap-parent completions-highlight-completions-map local-map)
+            (use-local-map completions-highlight-completions-map)))
 
     ;; Set is called already inside *Completions* but unset not
     (when-let ((parent (keymap-parent completions-highlight-completions-map))