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