Subject: bug#40990: Improve message-mode and isearch icons

From: Dmitry Gutov <[email-masked]>
Date: Fri, 1 May 2020 02:50:04 +0300

As discussed previously in the "Why is emacs so square?" thread, here's
a couple of patches that improve the toolbar icons in GTK builds.

Attached are several screenshots from my machine: isearch toolbar with
the x-gtk-stock-map patch and without (the difference is one icon), and
message-mode toolbar without the patch, with the patch, and also with
the extra patch that makes message-tool-bar-retro use the standrd
"mail/send" icon instead of the Gnus-specific one. Fixing Emacs not to
use message-tool-bar-retro is left as a future exercise.

I'd like to present a few arguments for the inclusion of the
x-gtk-stock-map patch in Emacs 27 (on which the current answer is no,
but I'll try to elaborate):

1. With it, the answer to the question "why does everybody tell the new
users to turn off toolbars" becomes less obvious, at least in GTK based
environments.

2. This only affects GTK. And also, if a theme doesn't contain the "new"
replacement image, the previous one will be shown instead.

3. Since "everybody" turns off the toolbars now, the risk of complaints
is pretty low. By the same token, we could de-prioritize said complaints
even if they appear, given that for most people the improvement is most
likely obvious (feedback welcome).

The second patch is a tiny bit more risky, but honestly, since it uses
an icon apparently borrowed from some old GTK-related icon set, using a
new version of the same icon shouldn't bother most people. But this
patch *can* affect users on different toolkits and different platforms
(again, feedback welcome).
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index adefa0efd6..62cbc754bd 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -7983,7 +7983,7 @@ message-tool-bar-gnome
 
 (defcustom message-tool-bar-retro
   '(;; Old Emacs 21 icon for consistency.
-    (message-send-and-exit "gnus/mail-send")
+    (message-send-and-exit "mail/send")
     (message-kill-buffer "close")
     (message-dont-send "cancel")
     (mml-attach-file "attach" mml-mode-map)
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 5b8feb14a5..d7bc64fa52 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -1407,13 +1407,13 @@ x-gtk-stock-map
     ("etc/images/right-arrow" . ("go-next" "gtk-go-forward"))
     ("etc/images/home" . ("go-home" "gtk-home"))
     ("etc/images/jump-to" . ("go-jump" "gtk-jump-to"))
-    ("etc/images/index" . "gtk-index")
+    ("etc/images/index" . ("gtk-search" "gtk-index"))
     ("etc/images/exit" . ("application-exit" "gtk-quit"))
     ("etc/images/cancel" . "gtk-cancel")
     ("etc/images/info" . ("dialog-information" "gtk-info"))
     ("etc/images/bookmark_add" . "n:bookmark_add")
     ;; Used in Gnus and/or MH-E:
-    ("etc/images/attach" . "gtk-attach")
+    ("etc/images/attach" . ("mail-attachment" "gtk-attach"))
     ("etc/images/connect" . "gtk-connect")
     ("etc/images/contact" . "gtk-contact")
     ("etc/images/delete" . ("edit-delete" "gtk-delete"))
@@ -1425,12 +1425,14 @@ x-gtk-stock-map
     ("etc/images/lock" . "gtk-lock")
     ("etc/images/next-page" . "gtk-next-page")
     ("etc/images/refresh" . ("view-refresh" "gtk-refresh"))
+    ("etc/images/search-replace" . "edit-find-replace")
     ("etc/images/sort-ascending" . ("view-sort-ascending" "gtk-sort-ascending"))
     ("etc/images/sort-column-ascending" . "gtk-sort-column-ascending")
     ("etc/images/sort-criteria" . "gtk-sort-criteria")
     ("etc/images/sort-descending" . ("view-sort-descending"
 				     "gtk-sort-descending"))
     ("etc/images/sort-row-ascending" . "gtk-sort-row-ascending")
+    ("etc/images/spell" . ("tools-check-spelling" "gtk-spell-check"))
     ("images/gnus/toggle-subscription" . "gtk-task-recurring")
     ("images/mail/compose" . "gtk-mail-compose")
     ("images/mail/copy" . "gtk-mail-copy")
@@ -1442,7 +1444,7 @@ x-gtk-stock-map
     ("images/mail/reply-all" . "gtk-mail-reply-to-all")
     ("images/mail/reply" . "gtk-mail-reply")
     ("images/mail/save-draft" . "gtk-mail-handling")
-    ("images/mail/send" . "gtk-mail-send")
+    ("images/mail/send" . ("mail-send" "gtk-mail-send"))
     ("images/mail/spam" . "gtk-spam")
     ;; Used for GDB Graphical Interface
     ("images/gud/break" . "gtk-no")