From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David McCracken Newsgroups: gmane.emacs.bugs Subject: bug#71162: bug-gnu-emacs@gnu.org Date: Sun, 26 May 2024 21:16:19 -0700 Message-ID: <3056cd9d-9e4b-4822-a12d-a78ecaba91f5@ixont.com> References: <86wmnj3fc5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------z0bweuSVWYR0tSooQET5w0bX" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29056"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 71162@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 27 06:22:48 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sBRsm-0007Mo-An for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 May 2024 06:22:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBRnm-00006O-IA; Mon, 27 May 2024 00:17:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBRn5-0008SW-4A for bug-gnu-emacs@gnu.org; Mon, 27 May 2024 00:16:56 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBRn4-0006uv-40 for bug-gnu-emacs@gnu.org; Mon, 27 May 2024 00:16:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sBRnC-0002xa-EQ for bug-gnu-emacs@gnu.org; Mon, 27 May 2024 00:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: David McCracken Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 May 2024 04:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71162 X-GNU-PR-Package: emacs Original-Received: via spool by 71162-submit@debbugs.gnu.org id=B71162.171678340211335 (code B ref 71162); Mon, 27 May 2024 04:17:02 +0000 Original-Received: (at 71162) by debbugs.gnu.org; 27 May 2024 04:16:42 +0000 Original-Received: from localhost ([127.0.0.1]:42862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBRmr-0002wk-Gz for submit@debbugs.gnu.org; Mon, 27 May 2024 00:16:42 -0400 Original-Received: from bosmailout02.eigbox.net ([66.96.184.2]:41473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBRmp-0002wV-TV for 71162@debbugs.gnu.org; Mon, 27 May 2024 00:16:40 -0400 Original-Received: from bosmailscan04.eigbox.net ([10.20.15.4]) by bosmailout02.eigbox.net with esmtp (Exim) id 1sBRmc-0007Wd-2p for 71162@debbugs.gnu.org; Mon, 27 May 2024 00:16:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ixont.com; s=dkim; h=Sender:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date :Message-ID:Content-Type:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=G6d0Qhvavk3mr6BG3glTccs2njATDhU+3BNrVcrAse8=; b=GSqaryCNDz1HtKzbbKElQiMn52 hm1zXEF0r4ms88CPt7jx4rY/f7mgtbJHbbCF/E5oZLQ/T77fCBQaZ9LHleNNbRFfPk7/negtHaNLe qkODLEc6i8LAiwlTsTzPvJRxFqQ/089PLS0mXQ9v4a3884ZyP6amt0poCgNgQUCY6uWgjJ4WWh45T RRVOvcjo+aaxCY7QwuVcaZgPsMOJLHRGZY4swU+7k/qoUqfsDyco9G8paBB4BqwKbH0DOyWY2pjqg bIheux29f25fqAXIjLvgMm9ckWP7xu70sTiX4lQgLCtxAXAuwXBdys45+c2FLfIsWpaV1J20ccMSk 0pS1o7sw==; Original-Received: from [10.115.3.32] (helo=bosimpout12) by bosmailscan04.eigbox.net with esmtp (Exim) id 1sBRmb-0004Gg-Po for 71162@debbugs.gnu.org; Mon, 27 May 2024 00:16:25 -0400 Original-Received: from bosauthsmtp14.yourhostingaccount.com ([10.20.18.14]) by bosimpout12 with id U4GN2C0060JCtq2014GRQm; Mon, 27 May 2024 00:16:25 -0400 X-Authority-Analysis: v=2.3 cv=dOg9ZNRb c=1 sm=1 tr=0 a=AnsiuLKgxXFeB68GILQVjQ==:117 a=8V9CQAzvb1UE/5s8aP8Njg==:17 a=mDV3o1hIAAAA:8 a=dr0PN7AwTpEA:10 a=TpHVaj0NuXgA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=5uJjYwlGAAAA:8 a=_sCHbt-FhbEU9YVjU8AA:9 a=QEXdDO2ut3YA:10 a=_jOVc7BtCUnB-xMcVEwA:9 a=q8sPxlEpPvKy_yuP:21 a=_W_S_7VecoQA:10 a=_FVE-zBwftR9WsbkzFJk:22 a=BFCC1qkpAUusnFHpP09J:22 Original-Received: from 23-115-169-72.lightspeed.mtryca.sbcglobal.net ([23.115.169.72]:62048 helo=[192.168.1.66]) by bosauthsmtp14.eigbox.net with esmtpsa (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim) id 1sBRmY-0001j9-E4; Mon, 27 May 2024 00:16:22 -0400 Content-Language: en-US In-Reply-To: <86wmnj3fc5.fsf@gnu.org> X-EN-UserInfo: 7db9acb10a66b5d38e8efde72e4a1877:931c98230c6409dcc37fa7e93b490c27 X-EN-AuthUser: davidm@ixont.com X-EN-OrigIP: 23.115.169.72 X-EN-OrigHost: 23-115-169-72.lightspeed.mtryca.sbcglobal.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286008 Archived-At: This is a multi-part message in MIME format. --------------z0bweuSVWYR0tSooQET5w0bX Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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. Many thanks to Benjamin Riefenstahl and Eli Zaretskii for helping me to resolve this problem. On 2024-05-23 11:15 PM, Eli Zaretskii wrote: >> Date: Thu, 23 May 2024 21:08:24 -0700 >> From: David McCracken >> >> I have developed a library that includes a toolbar with custom icons. It >> works in all versions of Emacs in Windows and in Emacs version 26.3 >> under Ubuntu-Mate 20.54 but the toolbar doesn't work in Emacs 27.1 under >> Ubuntu-Mate 22.04. 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. In Emacs 26.3 it also works to put my icon >> in /usr/share/emacs/26.3/etc/images and refer to it as simply >> "lxa-next". Emacs 27.1 shows nothing either way. 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 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. The icon selection mechanism of Emacs 26.3 is >> usable but could be improved by accepting an explicit icon file >> extension. That of 27.1 is unusable and, unless we can fix it, I will >> have to advise users of my library to install an older version of Emacs. > I tried to visit the XPM file you attached, and it displays okay with > both Emacs 27.1 and the current development version, at least on > MS-Windows. So I don't see a reason why this would not work on a tool > bar. I suggest that you post some minimal Lisp code that displays > these icons on the Emacs tool bar, starting from "emacs -Q", and then > we could try the code and see if the problem can be reproduced and > debugged. > > Btw, to clarify: you are saying that your XPM icons don't work in > Emacs 27.1 both on MS-Windows and on Ubuntu? Or only on Ubuntu? > > Thanks. --------------z0bweuSVWYR0tSooQET5w0bX Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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.

Many thanks to Benjamin Riefenstahl and Eli Zaretskii for helping me to resolve this problem.

On 2024-05-23 11:15 PM, Eli Zaretskii wrote:
Date: Thu, 23 May 2024 21:08:24 -0700
From: David McCracken <davidm@ixont.com>

I have developed a library that includes a toolbar with custom icons. It
works in all versions of Emacs in Windows and in Emacs version 26.3
under Ubuntu-Mate 20.54 but the toolbar doesn't work in Emacs 27.1 under
Ubuntu-Mate 22.04. 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. In Emacs 26.3 it also works to put my icon
in /usr/share/emacs/26.3/etc/images and refer to it as simply
"lxa-next". Emacs 27.1 shows nothing either way. 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 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. The icon selection mechanism of Emacs 26.3 is
usable but could be improved by accepting an explicit icon file
extension. That of 27.1 is unusable and, unless we can fix it, I will
have to advise users of my library to install an older version of Emacs.
I tried to visit the XPM file you attached, and it displays okay with
both Emacs 27.1 and the current development version, at least on
MS-Windows.  So I don't see a reason why this would not work on a tool
bar.  I suggest that you post some minimal Lisp code that displays
these icons on the Emacs tool bar, starting from "emacs -Q", and then
we could try the code and see if the problem can be reproduced and
debugged.

Btw, to clarify: you are saying that your XPM icons don't work in
Emacs 27.1 both on MS-Windows and on Ubuntu?  Or only on Ubuntu?

Thanks.
--------------z0bweuSVWYR0tSooQET5w0bX--