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: Sat, 25 May 2024 12:08:33 -0700 Message-ID: <1ced3036-74eb-40b5-9aa7-950f4cf5ed4b@ixont.com> References: <86wmnj3fc5.fsf@gnu.org> <9002e131-3466-4a73-a88c-bad260e5b886@ixont.com> <86msoe1kz0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39599"; 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 Sat May 25 21:09:18 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 1sAwlY-000A5r-MC for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 May 2024 21:09:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAwlE-0007lo-72; Sat, 25 May 2024 15:08:56 -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 1sAwlC-0007lM-Ro for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 15:08:54 -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 1sAwlC-0002SD-JW for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 15:08:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAwlJ-0006TV-VR for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 15:09: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: Sat, 25 May 2024 19:09:01 +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.171666413824883 (code B ref 71162); Sat, 25 May 2024 19:09:01 +0000 Original-Received: (at 71162) by debbugs.gnu.org; 25 May 2024 19:08:58 +0000 Original-Received: from localhost ([127.0.0.1]:45129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAwlF-0006TH-E7 for submit@debbugs.gnu.org; Sat, 25 May 2024 15:08:57 -0400 Original-Received: from bosmailout06.eigbox.net ([66.96.187.6]:44399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAwlD-0006TB-EG for 71162@debbugs.gnu.org; Sat, 25 May 2024 15:08:56 -0400 Original-Received: from bosmailscan04.eigbox.net ([10.20.15.4]) by bosmailout06.eigbox.net with esmtp (Exim) id 1sAwkx-0001Hk-RI for 71162@debbugs.gnu.org; Sat, 25 May 2024 15:08:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ixont.com; s=dkim; h=Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Reply-To: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=Q3jBv1EQZKnzIYqUtnrC9+0BrZIkiZTJYgwOlIOQ0Jw=; b=oI4b1KjJwAurfOkT1ZTB4qc633 jxTBaSFve9/FnhYeXx6t798Gjz8Ndl4ydn6yW+hsp7biehjH2EAjqFs0FVrhrTRXiXT0oNHUd9+Ry a4fsB5IKS99sVQlTwIzBb3Wjjgh+0nfIf1cRuwpOaam/fcy8wyypuWGy0C9Hvl8R8cMZ9wq43+5Ai UXYiX+s2YytgWTAtokCr9S3tuQ1NZgv2ulQgsj0pNZyxmT0AxiZWhSjTx0+TtIbd8G2aJ/P7GnjIs LcKtCdE8cLPj/LxoDbXumzj4vJ84UfAib78/3B5fbUbHDXNKQ5Z5uMUjnPd8qtBIGu+PstTy49D1J gCRwy5UA==; Original-Received: from [10.115.3.33] (helo=bosimpout13) by bosmailscan04.eigbox.net with esmtp (Exim) id 1sAwkv-0006K3-Nj for 71162@debbugs.gnu.org; Sat, 25 May 2024 15:08:37 -0400 Original-Received: from bosauthsmtp11.yourhostingaccount.com ([10.20.18.11]) by bosimpout13 with id TX8a2C0070EKspE01X8dLW; Sat, 25 May 2024 15:08:37 -0400 X-Authority-Analysis: v=2.3 cv=Df2MVslW c=1 sm=1 tr=0 a=anyYG9rjTBM1sAjEBQ8Cew==:117 a=8V9CQAzvb1UE/5s8aP8Njg==:17 a=mDV3o1hIAAAA:8 a=IkcTkHD0fZMA:10 a=dr0PN7AwTpEA:10 a=TpHVaj0NuXgA:10 a=5uJjYwlGAAAA:8 a=0SoYPT2ea7YK3KEp5p8A:9 a=QEXdDO2ut3YA:10 a=_FVE-zBwftR9WsbkzFJk:22 a=BFCC1qkpAUusnFHpP09J:22 Original-Received: from 23-115-169-72.lightspeed.mtryca.sbcglobal.net ([23.115.169.72]:60294 helo=[192.168.1.66]) by bosauthsmtp11.eigbox.net with esmtpsa (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim) id 1sAwks-0002Ae-8U; Sat, 25 May 2024 15:08:34 -0400 Content-Language: en-US In-Reply-To: <86msoe1kz0.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:285908 Archived-At: Thank you both for taking the time to look into this. I use Gimp under Windows to make my icons and they all work in Linux-Emacs 26.1. When I open lxa-next.xpm in Linux-Emacs 26.3 (in Ubuntu-Mate 20.54) the icon is rendered correctly. Linux-Emacs 27.1 (in Ubuntu-Mate 22.04) shows it as a blank box. All systems correctly show my icons in the GUI. I edited lxa-next.xpm as text, completely removing the Windows directory, which isn't proper C code because it doesn't name the variable being defined. Nevertheless, the newer Linux computer's GUI does render it although with less saturated colors. When I include a variable name, "something" or "*/~/icons/lxa-next.xpm", the system renders it as designed. However, Emacs still shows it blank. I tried all of these variations in the 27.1/etc/images directory and Emacs showed them all blank. This did not change with emacs -q so the problem is not caused by my .emacs. The problem also doesn't seem to be caused by Ubuntu-Mate because it renders my icons correctly. I assume that tool-bar--image-expression is located in an elc module. Which is it and can I get an el copy? I would like to trace it to determine why Linux-Emacs 27.1 refuses its own icons unless located in 27.1/etc/images. That it refuses my icons no matter where they are located may be related. With some help from you all I may be able to find the root of both problems. On 2024-05-24 11:09 PM, Eli Zaretskii wrote: > [Please use Reply All to reply, to keep the bug tracker CC'ed.] > >> Date: Fri, 24 May 2024 12:29:49 -0700 >> From: David McCracken >> >> I use the same icons and emacs code on Windows and Linux. In Windows it >> works in Emacs 29.1 and 26.1 (the two I currently use but it worked in >> older versions as well). In Ubuntu-Mate (20.54 and 22.04) it works in >> Emacs 26.3 but not 27.1. The code I use for this particular example is >> >> (define-key-after (default-value 'tool-bar-map) >>   [separator-4] menu-bar-separator) >> ; Linux-Emacs v25 includes pseudo-key name in the toolbar unless it is too >> ; long, which is the only way to stop this unwanted behavior. >> (tool-bar-add-item "~/icons/lxa-next" >>   'lxa-next >>   'lxa-next-reference >>   :help "LXA next reference") >> >> In all cases except Emacs 27.1 in Linux the user icons directory is not >> a problem. However, it is an additional problem in 27.1 under Linux. The >> same native lock-broken.xpm that works when in the images directory and >> referenced simply as "lock-broken" fails when moved to the user icons >> directory and referenced as "~/icons/lock-broken". 27.1 also ignores my >> lxa-next.xpm when moved to the images directory and referenced simply as >> "lxa-next". Somebody hard-wired all flexibility out of this mechanism >> after 26.3 but only in the Linux version. I initially suspected the >> changes related to B/W pbm images, which is described in the images >> README but I found the same README in 26.3. > If you visit (with C-x C-f) the lxa-next.xpm file in Emacs 27.1 on > Ubuntu, does it display correctly as an image? If not, your Emacs > 27.1 on Ubuntu is for some reason unable to display XPM images. > > If lxa-next.xpm does display correctly on Ubuntu, then you need to > find out why adding a tool-bar button with an XPM image doesn't work > for you. I just tried the below in "emacs-Q" (using Emacs 27.1), and > it did show the additional tool-bar button: > > (defun lxa-next () > (interactive) > (message "lxa-next")) > > (tool-bar-add-item "~/icons/lxa-next" > 'lxa-next > 'lxa-next-reference > :help "LXA next reference") > > Does the above work for you in "emacs -Q" on Ubuntu? > > If it works in "emacs -Q", but not in your regular sessions, then > there are some customizations, perhaps site-wide and possibly by the > Ubuntu distro, which somehow prevent this. In the upstream sources, I > see no changes in this area. tool-bar-add-item still ends up calling > tool-bar--image-expression, which calls find-image like this: > > (let* ((fg (face-attribute 'tool-bar :foreground)) > (bg (face-attribute 'tool-bar :background)) > (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg)) > (if (eq bg 'unspecified) nil (list :background bg)))) > (xpm-spec (list :type 'xpm :file (concat icon ".xpm"))) > (xpm-lo-spec (list :type 'xpm :file > (concat "low-color/" icon ".xpm"))) > (pbm-spec (append (list :type 'pbm :file > (concat icon ".pbm")) colors)) > (xbm-spec (append (list :type 'xbm :file > (concat icon ".xbm")) colors))) > `(find-image (cond ((not (display-color-p)) > ',(list pbm-spec xbm-spec xpm-lo-spec xpm-spec)) > ((< (display-color-cells) 256) > ',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec)) > (t > ',(list xpm-spec pbm-spec xbm-spec)))))) > > As you see here, if your display can support at least 256 colors, the > XPM image gets preference over the other possibilities. And > find-image searches for the image file via image-search-load-path, > which searches image-load-path, and for absolute file names like > "~/images/lxa-next" should find the file immediately regardless of the > value of image-load-path. > > So if your Emacs does not have some customizations, it should find the > images without any problem. > > If the problem is some Ubuntu customizations, you should take that up > with the Ubuntu distro maintainers; we here are only responsible for > the original Emacs 27.1 tarball. > >> In case you are interested I have attached my complete code. > I attach it below, because you sent the response only to me in private > email (please use Reply All or "wide reply" in your future responses > to this discussion). >