0

I have developed an Emacs library that includes a toolbar with custom icons. In my preferred configuration I put my icons under the user home directory so that this doesn't change if Emacs is updated. My library accesses this with e.g. (tool-bar-add-item "~/icons/lxa-next" to use my lxa-next.xpm icon. This works in all versions of Emacs in Windows and in Emacs version 26.3 under Ubuntu-Mate 20.54 but my toolbar is blank in Emacs 27.1 under Ubuntu-Mate 22.04. It also works to put my icon in /usr/share/emacs/26.3/etc/images and referencing it as simply "lxa-next". Doing this with 27.1 doesn't fix the problem. Referring to it as lxa-next.xpm fails in all version of Emacs. My lxa-next.xpm appears similar to the native lock-broken.xpm (4.7kB vs. 4.6kB) so I experimented referring to that instead of mine and it worked. I also tested the native left-arrow but instead of left-arrow.xpm or pbm, it showed a very plain < image that doesn't exist in the images directory. It should be noted that there is a lock-broken.pbm but the xpm version was automatically selected. I deliberately use excessively long pseudo-key names in my tool-bar-add-item statements to prevent them from being displayed in addition to the icon. I tested a short name and found the same results, icon+name in 26.3 but blank in 27.1.

1 Answer 1

0

grep -r XPM3 * in /usr/share/emacs shows etc/PROBLEMS:** macOS doesn't come with libxpm, so only XPM3 is supported. This subservience to Apple contradicts the general principle of open source. However, we can adapt to it. sudo install xpmutils installs sxpm, which can convert XPM 1 and 2 to 3. sxpm --help is inscrutable. sxpm file.xpm - o file.xpm changes file.xpm to XPM3. When this is applied to the icon files, emacs 27.1 in Linux correctly uses them in the toolbar even when they are located in ~/icons.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.