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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: sbaugh <at> catern.com
Cc: sbaugh <at> janestreet.com, philipk <at> posteo.net, rudalics <at> gmx.at, drew.adams <at> oracle.com, 64619 <at> debbugs.gnu.org
Subject: bug#64619: [PATCH] Add toggle-window-dedicated command
Date: Mon, 21 Aug 2023 22:20:20 +0300
> From: sbaugh <at> catern.com
> Date: Mon, 21 Aug 2023 13:00:48 +0000 (UTC)
> Cc: sbaugh <at> janestreet.com, philipk <at> posteo.net, 64619 <at> debbugs.gnu.org,
> 	drew.adams <at> oracle.com, rudalics <at> gmx.at
> 
> >> @@ -675,6 +696,7 @@ mode-line-end-spaces
> >>  	            'mode-line-modified
> >>  	            'mode-line-remote)
> >>                'display '(min-width (5.0)))
> >> +             'mode-line-window-dedicated
> >>  	     'mode-line-frame-identification
> >>  	     'mode-line-buffer-identification
> >>  	     "   "
> >
> > Why not add this to the group with the min-width property (and enlarge
> > that to 6.0)?  That way, we prevent annoying horizontal movement of
> > the rest of the mode-line display when toggling the state.
> 
> Hm, I tried doing that, but maybe I don't understand min-width, because
> there's still horizontal movement of the mode-line when I toggle it on
> and off.  I tried various combinations of strings, but they all had this
> behavior, maybe I'm doing something obviously wrong?

Look at how modeline-client was fixed recently, it had the same
problem.

> Also, if we make it fixed-size in this way, should we display "-"
> instead of nothing when the window is not dedicated? Or just an empty
> space?

Empty space is fine, and min-width will do that.

> - @var{cs}:@var{ch}-@var{fr}  @var{buf}      @var{pos} @var{line}   (@var{major} @var{minor})
> + @var{cs}:@var{ch}-@var{D}@var{fr}  @var{buf}      @var{pos} @var{line}   (@var{major} @var{minor})
>  @end example
>  
>  @noindent
> @@ -231,6 +231,12 @@ Mode Line
>  However, if @code{default-directory} (@pxref{File Names}) for the
>  current buffer is on a remote machine, @samp{@@} is displayed instead.
>  
> +  @var{D} appears if the window is dedicated to its current buffer.

This should be @var{d}, lower-case, as all the arguments of @var are.
makeinfo will either up-case it (for Info) or produce a slanted
typeface (for other output formats).

> +@cindex dedicated window
> +  Sometimes, a window is ``dedicated'' to its current buffer
                                                               ^
A period is missing there.

> +@code{display-buffer} will avoid reusing dedicated windows most of the
> +time.  This is indicated by a ``d'' in the mode line (@pxref{Mode
> +Line}).  A window can also be strongly dedicated, which prevents any
> +changes to the buffer displayed in the window this is indicated by a
> +``D'' in the mode line.

Why use ``d'' and ``D'' and not @samp?

> +You can control the default of FLAG with
> +`toggle-window-dedicated-flag'.  Consequently, if you set that
> +variable to t, strong dedication will be used by default.

The last sentence should say at the end "...and \\[universal-argument]
will make the window weakly dedicated."




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

Previous Next


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