* [PATCH] remove save and undo text on tool-bar for gtk version
@ 2020-09-30 16:48 Caio Henrique
2020-09-30 16:58 ` Robert Pluim
2020-09-30 17:00 ` Eli Zaretskii
0 siblings, 2 replies; 5+ messages in thread
From: Caio Henrique @ 2020-09-30 16:48 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 493 bytes --]
Hi, these suggestions to improve the tool-bar consistency and also save
horizontal space got lost in the "Changes for emacs 28" discussion, so
I'm changing the subject. This only affects the gtk version, AFAIK windows
only shows the icons.
There were two proposals:
1 - remove :vertonly from all tool-bar items and change the default
value of tool-bar-style to image
2 - simply add :vertonly to save and undo
IMO option 1 is better, since option 2 makes the value text-image-horiz
useless.
[-- Attachment #2: tool bar gtk --]
[-- Type: image/png, Size: 28526 bytes --]
[-- Attachment #3: Type: text/plain, Size: 3690 bytes --]
Here is the 2nd proposal patch:
____________
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 7df1e28e06..bec45c1ea4 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -256,9 +256,9 @@ tool-bar-setup
(tool-bar-add-item-from-menu 'dired "diropen" nil :vert-only t)
(tool-bar-add-item-from-menu 'kill-this-buffer "close" nil :vert-only t)
(tool-bar-add-item-from-menu 'save-buffer "save" nil
- :label "Save")
+ :label "Save" :vert-only t)
(define-key-after (default-value 'tool-bar-map) [separator-1] menu-bar-separator)
- (tool-bar-add-item-from-menu 'undo "undo" nil)
+ (tool-bar-add-item-from-menu 'undo "undo" nil :vert-only t)
(define-key-after (default-value 'tool-bar-map) [separator-2] menu-bar-separator)
(tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut])
"cut" nil :vert-only t)
____________
Here is the 1st proposal patch:
____________
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 7df1e28e06..c45c7ae8ed 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -249,26 +249,19 @@ tool-bar-local-item-from-menu
(defun tool-bar-setup ()
(setq tool-bar-separator-image-expression
(tool-bar--image-expression "separator"))
- (tool-bar-add-item-from-menu 'find-file "new" nil :label "New File"
- :vert-only t)
- (tool-bar-add-item-from-menu 'menu-find-file-existing "open" nil
- :label "Open" :vert-only t)
- (tool-bar-add-item-from-menu 'dired "diropen" nil :vert-only t)
- (tool-bar-add-item-from-menu 'kill-this-buffer "close" nil :vert-only t)
- (tool-bar-add-item-from-menu 'save-buffer "save" nil
- :label "Save")
+ (tool-bar-add-item-from-menu 'find-file "new" nil :label "New File")
+ (tool-bar-add-item-from-menu 'menu-find-file-existing "open" nil :label "Open")
+ (tool-bar-add-item-from-menu 'dired "diropen" nil)
+ (tool-bar-add-item-from-menu 'kill-this-buffer "close" nil)
+ (tool-bar-add-item-from-menu 'save-buffer "save" nil :label "Save")
(define-key-after (default-value 'tool-bar-map) [separator-1] menu-bar-separator)
(tool-bar-add-item-from-menu 'undo "undo" nil)
(define-key-after (default-value 'tool-bar-map) [separator-2] menu-bar-separator)
- (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut])
- "cut" nil :vert-only t)
- (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [copy])
- "copy" nil :vert-only t)
- (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste])
- "paste" nil :vert-only t)
+ (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut]) "cut" nil)
+ (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [copy]) "copy" nil)
+ (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste]) "paste" nil)
(define-key-after (default-value 'tool-bar-map) [separator-3] menu-bar-separator)
- (tool-bar-add-item-from-menu 'isearch-forward "search"
- nil :label "Search" :vert-only t)
+ (tool-bar-add-item-from-menu 'isearch-forward "search" nil :label "Search")
;;(tool-bar-add-item-from-menu 'ispell-buffer "spell")
;; There's no icon appropriate for News and we need a command rather
diff --git a/src/xdisp.c b/src/xdisp.c
index 152946363e..673be19b51 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -34993,7 +34993,7 @@ syms_of_xdisp (void)
any other - use system default or image if no system default.
This variable only affects the GTK+ toolkit version of Emacs. */);
- Vtool_bar_style = Qnil;
+ Vtool_bar_style = Qimage;
DEFVAR_INT ("tool-bar-max-label-size", tool_bar_max_label_size,
doc: /* Maximum number of characters a label can have to be shown.
____________
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] remove save and undo text on tool-bar for gtk version
2020-09-30 16:48 [PATCH] remove save and undo text on tool-bar for gtk version Caio Henrique
@ 2020-09-30 16:58 ` Robert Pluim
2020-09-30 17:32 ` Caio Henrique
2020-09-30 17:00 ` Eli Zaretskii
1 sibling, 1 reply; 5+ messages in thread
From: Robert Pluim @ 2020-09-30 16:58 UTC (permalink / raw)
To: Caio Henrique; +Cc: emacs-devel
>>>>> On Wed, 30 Sep 2020 13:48:53 -0300, Caio Henrique <caiohcs0@gmail.com> said:
Caio> Hi, these suggestions to improve the tool-bar consistency and also save
Caio> horizontal space got lost in the "Changes for emacs 28" discussion, so
Caio> I'm changing the subject. This only affects the gtk version, AFAIK windows
Caio> only shows the icons.
Caio> There were two proposals:
Caio> 1 - remove :vertonly from all tool-bar items and change the default
Caio> value of tool-bar-style to image
Caio> 2 - simply add :vertonly to save and undo
Caio> IMO option 1 is better, since option 2 makes the value text-image-horiz
Caio> useless.
Caio> This variable only affects the GTK+ toolkit version of Emacs. */);
Caio> - Vtool_bar_style = Qnil;
Caio> + Vtool_bar_style = Qimage;
Caio> DEFVAR_INT ("tool-bar-max-label-size", tool_bar_max_label_size,
Caio> doc: /* Maximum number of characters a label can have to be shown.
Caio> ____________
If you do this you'll need to update the version tag for
tool-bar-style in lisp/cus-start.el to "28.1" as well.
FWIW option 1 sounds good to me (although I donʼt use the toolbar at
all).
Robert
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] remove save and undo text on tool-bar for gtk version
2020-09-30 16:48 [PATCH] remove save and undo text on tool-bar for gtk version Caio Henrique
2020-09-30 16:58 ` Robert Pluim
@ 2020-09-30 17:00 ` Eli Zaretskii
2020-09-30 17:30 ` Caio Henrique
1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2020-09-30 17:00 UTC (permalink / raw)
To: Caio Henrique; +Cc: emacs-devel
> From: Caio Henrique <caiohcs0@gmail.com>
> Date: Wed, 30 Sep 2020 13:48:53 -0300
>
> Hi, these suggestions to improve the tool-bar consistency and also save
> horizontal space got lost in the "Changes for emacs 28" discussion, so
> I'm changing the subject. This only affects the gtk version, AFAIK windows
> only shows the icons.
What about Lucid?
> There were two proposals:
> 1 - remove :vertonly from all tool-bar items and change the default
> value of tool-bar-style to image
> 2 - simply add :vertonly to save and undo
Can you elaborate on the rationale for each change? I don't think I
have a clear idea of the reasons.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] remove save and undo text on tool-bar for gtk version
2020-09-30 17:00 ` Eli Zaretskii
@ 2020-09-30 17:30 ` Caio Henrique
0 siblings, 0 replies; 5+ messages in thread
From: Caio Henrique @ 2020-09-30 17:30 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Caio Henrique, emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> What about Lucid?
I never used the Lucid version before, but I could try it later when I
have some free time. I suppose that running configure with
"--with-x-toolkit=lucid" would allow me to build it, is that right?
I said that it only affects GTK because the documentation of
tool-bar-style says that "This variable only affects the GTK+ toolkit
version of Emacs.".
> Can you elaborate on the rationale for each change? I don't think I
> have a clear idea of the reasons.
>
> Thanks.
These changes try to make the tool-bar more consistent since as it is
now, every other tool-bar item (new, open, close, cut, copy etc) on GTK
shows only the image [1], whereas the items "undo" and "save"" show both
the image and the text horizontally. Also, if I change the value of
tool-bar-style from nil to text-image-horiz, it doesn't do what it is
supposed to do, i.e. show bow the text and the image horizontally for
all items. All items that have :vertonly aren't affected by text-image-horiz.
This also saves horizontal space on the tool-bar, so we could add other
things like a "redo" buttom.
[1] I'm talking about the tool-bar items of fundamental-mode and
elisp-mode. The tool-bar for other modes like the GNUS tool-bar are also
inconsistent, here on GTK they show only the image for some items like
"previous unread", whereas other items like "next unread" show both the
icon and the text. IOW, the GNUS tool-bar doesn't even fit on the
default size of an Emacs frame. In other modes they behave differently,
e.g. here the tool-bar of custom mode show both the image and the text
horizontally for all the items, but they fit on the emacs frame unlike
the GNUS tool-bar. Option 1, making the default value 'image, would
solve all inconsistencies and every item would use only the
images. Thus, I think that option 1 is the better choice.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] remove save and undo text on tool-bar for gtk version
2020-09-30 16:58 ` Robert Pluim
@ 2020-09-30 17:32 ` Caio Henrique
0 siblings, 0 replies; 5+ messages in thread
From: Caio Henrique @ 2020-09-30 17:32 UTC (permalink / raw)
To: Robert Pluim; +Cc: Caio Henrique, emacs-devel
Robert Pluim <rpluim@gmail.com> writes:
> If you do this you'll need to update the version tag for
> tool-bar-style in lisp/cus-start.el to "28.1" as well.
I'll look that later, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-30 17:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-30 16:48 [PATCH] remove save and undo text on tool-bar for gtk version Caio Henrique
2020-09-30 16:58 ` Robert Pluim
2020-09-30 17:32 ` Caio Henrique
2020-09-30 17:00 ` Eli Zaretskii
2020-09-30 17:30 ` Caio Henrique
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).