From: Jimmy Aguilar Mena Date: Thu, 27 Aug 2020 00:34:13 +0000 (+0200) Subject: Fix recursive set-keymap-parent in completions-highlight. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=42f47e75689919f8337bb142d1ed2f91dc4b4334;p=emacs.git 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. --- diff --git a/lisp/completions-highlight.el b/lisp/completions-highlight.el index a16e4f972ed..00b7382f519 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))