Wrapping my head around icon-map-list

Antonio Romano <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Hi all,

I'm on Emacs 30.2 Wayland PGTK. I'm trying to understand how to set `icon-map-list` in order to set a
GTK theme icon for some toolbar buttons which would otherwise fallback to
its XPM counterpart.

For the Adwaita theme, the prime example of missing
icon would be the "Read Directory" button, which I'd like to change, for
the sake of simplicty, to the same icon of "Read File".

According to its docstring, icon-map-list is a list of alists (or
symbols to alists). Alists are searched in the order they appear and
each entry is, put simply, a cons of type ("etc/images/«name»"
. "«gtk-theme-icon-name»"), where:

- «name» is basically of an extensionless built-in emacs icon got from
  /usr/share/30.2/etc/images/«name».xpm
- «gtk-theme-icon-name» is the name of the icon from the currently set
  GTK theme (e.g. Adwaita).

So an entry like 

    ("etc/images/new" . "document-new")

Basically says "whenever trying to display a built-in icon new.xmp,
show the fancy `document-new` GTK icon instead.

The default value of `icon-map-list` is this:
    (x-gtk-stock-map)
which is the symbol pointing to an alist filled with default mappings:
    (("etc/images/new" "document-new" "gtk-new")
     ("etc/images/open" "document-open" "gtk-open")
     ("etc/images/diropen" . "gtk-directory")
     ("etc/images/close" "window-close" "gtk-close")
     ("etc/images/save" "document-save" "gtk-save")
     ("etc/images/cut" "edit-cut" "gtk-cut")
     ...)

(I don't understand why most entries are lists instead of
    conses.)

Having read this, I tried edited the `icon-map-list` as by prepending a
personal alist as follows:

(setopt icon-map-list (cons '("etc/images/diropen" . "document-new")
			    icon-map-list))
 => (("etc/images/diropen" . "document-new") x-gtk-stock-map)

but opening Emacs now results in the toolbar failing to show and the
frame doing some weird display glitches. Trying to append the alist does
nothing, instead. What am I doing wrong? Is this variable even planned
for personal customization?

TIA.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.