GNU bug report logs - #51049
28.0.50; tool-bar :vert-only property is broken, not documented and of limited use

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Tue, 5 Oct 2021 23:58:01 UTC

Severity: normal

Found in version 28.0.50

To reply to this bug, email your comments to 51049 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51049; Package emacs. (Tue, 05 Oct 2021 23:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 05 Oct 2021 23:58:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; tool-bar :vert-only property is broken, not documented and
 of limited use
Date: Tue, 5 Oct 2021 19:57:51 -0400
According to commit d2bd51898e4 the :vert-only property for toolbar
items is supposed to be "for tool bar items with labels not shown
horizontally".

These properties are used in some places in our sources, but are not
documented in (info "(elisp) Tool Bar").

They also don't seem to be working, at least not in GTK:

  0. emacs -Q
  1. (custom-set-variables '(tool-bar-position 'left))
  2. M-x mpc RET

  (Note that the entire tool-bar in mpc.el has the :vert-only property.)

This is extra strange as AFAICT, the only place where we check for this
property is in gtkutil.c.  So the only place where it was implemented,
the feature is broken?

I also do wonder if this property is at all useful.  If anything, I
would like the option to *hide* labels in horizontal mode, as having
labels makes the toolbar change size when I switch between windows to
with different major modes.  This makes windows jump around
horizontally, which is eminently unusable.  (But this would be more
useful as a global user option than as properties, set to t by default,
to avoid the jumping.)

So should the :vert-only property be documented?  Fixed?  Removed?

In GNU Emacs 28.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version
3.24.24, cairo version 1.16.0)
 of 2021-09-30 built on joffe
Repository revision: ec9e8a9961362cd238879c9e96617ebd2f64af9a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LC_COLLATE: C
  value of $LC_CTYPE: sv_SE.UTF-8
  value of $LC_TIME: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51049; Package emacs. (Wed, 06 Oct 2021 16:34:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 51049 <at> debbugs.gnu.org
Subject: Re: bug#51049: 28.0.50;
 tool-bar :vert-only property is broken, not documented and of limited
 use
Date: Wed, 06 Oct 2021 19:32:54 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Tue, 5 Oct 2021 19:57:51 -0400
> 
> According to commit d2bd51898e4 the :vert-only property for toolbar
> items is supposed to be "for tool bar items with labels not shown
> horizontally".
> 
> These properties are used in some places in our sources, but are not
> documented in (info "(elisp) Tool Bar").
> 
> They also don't seem to be working, at least not in GTK:
> 
>   0. emacs -Q
>   1. (custom-set-variables '(tool-bar-position 'left))
>   2. M-x mpc RET
> 
>   (Note that the entire tool-bar in mpc.el has the :vert-only property.)

I suggest to step with a debugger into update_frame_tool_bar in
gtkutil.c, where this is implemented, and see what's going on there.
The effect of :vert-only is conditioned on other aspects of the tool
bar and its buttons, so it could be that what you see is the feature
working as designed, and you just didn't create the conditions for it
to have the effect.  Jan Djärv, who implemented that, was our X and
GTK expert, so it is hard for me to believe that the code didn't work
at least then (it could have bit-rotten with the newer versions of
GTK, of course).

> I also do wonder if this property is at all useful.  If anything, I
> would like the option to *hide* labels in horizontal mode, as having
> labels makes the toolbar change size when I switch between windows to
> with different major modes.

It's fine to introduce new features, but why remove old ones while at
that?  What is not useful to you could be useful to someone else.

> So should the :vert-only property be documented?  Fixed?  Removed?

Documented, probably -- but then :label should also be documented.
Fixed? not sure what to fix.  Removed? definitely no.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51049; Package emacs. (Wed, 06 Oct 2021 18:12:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 51049 <at> debbugs.gnu.org
Subject: Re: bug#51049: 28.0.50; tool-bar :vert-only property is broken, not
 documented and of limited use
Date: Wed, 6 Oct 2021 14:10:52 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

> Jan Djärv, who implemented that, was our X and
> GTK expert, so it is hard for me to believe that the code didn't work
> at least then (it could have bit-rotten with the newer versions of
> GTK, of course).

Right.  If the feature was never documented, it might be the case that
no one is using it, or are not aware of it, and that therefore no one
noticed that it's bitrotted.

>> I also do wonder if this property is at all useful.  If anything, I
>> would like the option to *hide* labels in horizontal mode, as having
>> labels makes the toolbar change size when I switch between windows to
>> with different major modes.
>
> It's fine to introduce new features, but why remove old ones while at
> that?  What is not useful to you could be useful to someone else.

I'm just asking the question based on my observations.  I don't see a
use-case for this feature, and if it is indeed broken then the fact that
no one has complained might be some indication.

If you think that this feature could be useful, then I have no objection
to keeping it.  But if it is indeed broken, it should at least be fixed
to work as intended, and then documented; preferably in that order.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51049; Package emacs. (Wed, 06 Oct 2021 18:28:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 51049 <at> debbugs.gnu.org
Subject: Re: bug#51049: 28.0.50; tool-bar :vert-only property is broken, not
 documented and of limited use
Date: Wed, 06 Oct 2021 21:27:11 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Wed, 6 Oct 2021 14:10:52 -0400
> Cc: 51049 <at> debbugs.gnu.org
> 
> > It's fine to introduce new features, but why remove old ones while at
> > that?  What is not useful to you could be useful to someone else.
> 
> I'm just asking the question based on my observations.  I don't see a
> use-case for this feature, and if it is indeed broken then the fact that
> no one has complained might be some indication.
> 
> If you think that this feature could be useful, then I have no objection
> to keeping it.  But if it is indeed broken, it should at least be fixed
> to work as intended, and then documented; preferably in that order.

I suggested to step through the code, in order to understand what
happens there.  Then we will have a better idea of whether it works
and when.  I understand that you don't intend to do that, but perhaps
someone else will.  (I myself don't have access to a system where I
can run a GTK build on GUI display, so I unfortunately cannot do this
myself.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51049; Package emacs. (Mon, 12 Sep 2022 10:56:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 51049 <at> debbugs.gnu.org
Subject: Re: bug#51049: 28.0.50; tool-bar :vert-only property is broken, not
 documented and of limited use
Date: Mon, 12 Sep 2022 12:55:29 +0200
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefan <at> marxist.se> writes:

> According to commit d2bd51898e4 the :vert-only property for toolbar
> items is supposed to be "for tool bar items with labels not shown
> horizontally".
>
> These properties are used in some places in our sources, but are not
> documented in (info "(elisp) Tool Bar").
>
> They also don't seem to be working, at least not in GTK:

Here's how the default toolbar looks for me:

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]
If I then add :vert-only to "Save" I get this:

[Message part 4 (image/png, inline)]
[Message part 5 (text/plain, inline)]
So with the current implementation I think it just means "just show the
icon and not icon+text".

> If anything, I would like the option to *hide* labels in horizontal
> mode, as having labels makes the toolbar change size when I switch
> between windows to with different major modes.

Yes, I agree -- the intention seems to be to hide the text only when the
toolbar is vertical, but I think most people would rather prefer the
opposite if this is to be tweakable.

> So should the :vert-only property be documented?  Fixed?  Removed?

It seems useful and works, so I think it should be documented -- but the
name :vert-only is really misleading.  It should be :image-only, I
guess?


Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 12 Sep 2022 10:58:02 GMT) Full text and rfc822 format available.

Removed tag(s) moreinfo. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 12 Feb 2025 05:25:01 GMT) Full text and rfc822 format available.

This bug report was last modified 185 days ago.

Previous Next


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