emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/completions-highlight-modifications 0b3a68e: Fix recursive set-k


From: Jimmy Aguilar Mena
Subject: feature/completions-highlight-modifications 0b3a68e: Fix recursive set-keymap-parent in completions-highlight.
Date: Wed, 26 Aug 2020 20:38:27 -0400 (EDT)

branch: feature/completions-highlight-modifications
commit 0b3a68ed521bd526714fb261126805c94d30b828
Author: Jimmy Aguilar Mena <spacibba@aol.com>
Commit: Jimmy Aguilar Mena <spacibba@aol.com>

    Fix recursive set-keymap-parent in completions-highlight.
    
    *
    lisp/completions-highlight.el (completions-highlight-minibuffer-bindings)
    :
    (completions-highlight-completions-bindings) : Condition
    set-keymap-parent to avoid error.
---
 lisp/completions-highlight.el | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/lisp/completions-highlight.el b/lisp/completions-highlight.el
index a16e4f9..00b7382 100644
--- a/lisp/completions-highlight.el
+++ b/lisp/completions-highlight.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]