Subject: bug#64619: [PATCH] Add toggle-window-dedicated command

From: [email-masked]
Date: Sat, 15 Jul 2023 17:41:36 +0000 (UTC)

martin rudalics <[email-masked]> writes:
>>> * lisp/window.el (toggle-window-dedicated): Add.
>>> (window-prefix-map): Add C-x w d binding.
>>
>> Adding Martin.  Martin, any comments?
>
> It should hardly harm anyone.  But what would be a typical scenario for
> using it?

When a window is not dedicated and one wants to make it dedicated, to
affect display-buffer.

> C-x b has 'switch-to-buffer-in-dedicated-window', C-x <left> and
> friends probably should do the same.  Usually a window is marked as
> dedicated to avoid that 'display-buffer' uses it.

Exactly.

> In which case it would likely be better to not mark the window as
> dedicated in the first place - e.g. via a (dedicated . nil) entry in
> `display-buffer-alist'.

Yes, this is about making windows dedicated, not making them not
dedicated.  I implemented it as a toggle only because that seems nicer
to a user who might otherwise make a window dedicated on accident and
not know how to undo it.