GNU bug report logs - #64619
[PATCH] Add toggle-window-dedicated command

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Fri, 14 Jul 2023 15:40:02 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 64619 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Philip Kaludercic <philipk <at> posteo.net>, Spencer Baugh
 <sbaugh <at> janestreet.com>
Cc: "64619 <at> debbugs.gnu.org" <64619 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#64619: [PATCH] Add toggle-window-dedicated
 command
Date: Fri, 14 Jul 2023 21:17:18 +0000
Some minor comments.

> +  (if (window-dedicated-p window)
> +      (progn
> +        (set-window-dedicated-p window nil)
> +        (when interactive (message "Window can now be used to display other buffers")))
> +    (set-window-dedicated-p window 'dedicated)
> +    (when interactive (message "Window will now display only its current buffer"))))

1. Why _weakly_ dedicated?
2. Why not just this?

(let ((before  (window-dedicated-p window)))
  (set-window-dedicated-p window (not before))
  (when interactive
    (message "Window is %s dedicated to buffer %s"
             (if before "no longer" "now")
             (current-buffer))))

If someone might not know what it means for a
window to be dedicated, put that info in the
doc string, not in the message.

3. The toggle, as OP proposed it, imposes weak
dedication, and the toggle as I wrote it above
imposes strong dedication.  What if you want
a toggle that respects whatever non-nil FLAG
(weak or strong) might have already been used
for the window?

IOW, what if the window is dedicated to start
with, before you first use the toggle, and you
want to get back that same dedicated behavior
(weak or strong) when you toggle it back again?
The toggle (either definition) doesn't do that.

Shouldn't the doc make clear that the toggling
behavior is always between weak & undedicated
(OP version) or always between strong &
undedicated (my version, above)?  IOW, let a
user know that any original dedicated behavior
is lost, once you use the toggle.

Or if you want to let a user specify whether
to use weak or strong, maybe do that with a
prefix arg?                 




This bug report was last modified 1 year and 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.