emacs-diffs
[Top][All Lists]
Advanced

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

feature/completions-highlight-modifications 56a64ec 6/6: Fix recursive s


From: Jimmy Aguilar Mena
Subject: feature/completions-highlight-modifications 56a64ec 6/6: Fix recursive set-keymap-parent in completions-highlight.
Date: Mon, 31 Aug 2020 05:28:53 -0400 (EDT)

branch: feature/completions-highlight-modifications
commit 56a64ec49a4693e965da158b8fa5a9858b9abf88
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]