From: John Wiegley Date: Wed, 29 Nov 2017 04:52:29 +0000 (-0800) Subject: Repeating a bind no longer causes duplicates in personal-keybindings X-Git-Tag: emacs-29.0.90~1306^2~15^2~240 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=606284e374381c4286d216a94a98fcdda2d3a501;p=emacs.git Repeating a bind no longer causes duplicates in personal-keybindings Fixes https://github.com/jwiegley/use-package/issues/446 --- diff --git a/lisp/use-package/bind-key.el b/lisp/use-package/bind-key.el index d907798ae76..e5002d4ee17 100644 --- a/lisp/use-package/bind-key.el +++ b/lisp/use-package/bind-key.el @@ -161,9 +161,13 @@ can safely be called at any time." (key-description ,namevar)) (quote ,keymap))) (,bindingvar (lookup-key (or ,keymap global-map) ,keyvar))) - (add-to-list 'personal-keybindings - (list ,kdescvar ,command - (unless (numberp ,bindingvar) ,bindingvar))) + (let ((entry (assoc ,kdescvar personal-keybindings)) + (details (list ,command + (unless (numberp ,bindingvar) + ,bindingvar)))) + (if entry + (setcdr entry details) + (add-to-list 'personal-keybindings (cons ,kdescvar details)))) ,(if predicate `(define-key (or ,keymap global-map) ,keyvar '(menu-item "" nil :filter (lambda (&optional _)