@@ -631,9 +631,9 @@ See also `resize-window-stack-size'."
631
631
(not (resize-window--key-element
632
632
key resize-window-dispatch-alist))))
633
633
634
- (defun resize-window-add-choice (key func doc &optional allows-capitals )
634
+ (defun resize-window-add-choice (key func doc &optional allows-capitals force )
635
635
" Register a new binding for `resize-window' .
636
- Refuses to replace an already taken key.
636
+ Refuses to replace an already taken key unless FORCE is non-nil .
637
637
638
638
KEY is the key (e.g. ?c) that invokes the function FUNC. DOC is a
639
639
docstring for the help menu. A non-nil ALLOWS-CAPITALS tells FUNC
@@ -642,6 +642,15 @@ allow capitals, otherwise to allow capitals should be of optional
642
642
single arity so a capital KEY may be passed to FUNC when pressed.
643
643
644
644
See also `resize-window--key-str' ."
645
+ (when force
646
+ (setq resize-window-alias-list
647
+ (delq (resize-window--key-element
648
+ key resize-window-alias-list)
649
+ resize-window-alias-list))
650
+ (setq resize-window-dispatch-alist
651
+ (delq (resize-window--key-element
652
+ key resize-window-dispatch-alist)
653
+ resize-window-dispatch-alist)))
645
654
(if (resize-window--key-available? key)
646
655
(push (list key func doc allows-capitals)
647
656
resize-window-dispatch-alist)
0 commit comments