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