From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67794: 30.0.50; mouse-face is not respected on SVG images Date: Mon, 18 Dec 2023 19:36:49 +0100 Message-ID: <87il4v8iim.fsf@ledu-giraud.fr> References: <83a5qers00.fsf@gnu.org> <87zfye11z3.fsf@ledu-giraud.fr> <838r5yroyp.fsf@gnu.org> <87v8920xlb.fsf@ledu-giraud.fr> <835y12rle4.fsf@gnu.org> <87bkatgnj6.fsf@ledu-giraud.fr> <83plz9qgsb.fsf@gnu.org> <877clh868o.fsf@ledu-giraud.fr> <83jzphqeto.fsf@gnu.org> <87frzzai4h.fsf@ledu-giraud.fr> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37781"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: gerd.moellmann@gmail.com, 67794@debbugs.gnu.org, Eli Zaretskii To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 18 19:37:25 2023 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 1rFIUW-0009dA-Cd for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Dec 2023 19:37:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFIUB-0003ie-Qd; Mon, 18 Dec 2023 13:37:06 -0500 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 1rFIUA-0003iT-AS for bug-gnu-emacs@gnu.org; Mon, 18 Dec 2023 13:37:02 -0500 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 1rFIU9-0005fu-Vc for bug-gnu-emacs@gnu.org; Mon, 18 Dec 2023 13:37:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rFIUA-0007w9-KH for bug-gnu-emacs@gnu.org; Mon, 18 Dec 2023 13:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Dec 2023 18:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67794 X-GNU-PR-Package: emacs Original-Received: via spool by 67794-submit@debbugs.gnu.org id=B67794.170292462030494 (code B ref 67794); Mon, 18 Dec 2023 18:37:02 +0000 Original-Received: (at 67794) by debbugs.gnu.org; 18 Dec 2023 18:37:00 +0000 Original-Received: from localhost ([127.0.0.1]:33594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFIU7-0007vi-Ug for submit@debbugs.gnu.org; Mon, 18 Dec 2023 13:37:00 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:12882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFIU3-0007vS-E9 for 67794@debbugs.gnu.org; Mon, 18 Dec 2023 13:36:58 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=LVDenj2z 9IGswTX1lUZW9jKdAcAwasxcIAWoJsgZLUo=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=gUe14D1AQm0E45KBSkbFRpGGSny3jh g+oNh/blKVeo5RJR2qpP4O9PTrqpuNsgsy94hCbi9Q3s62CMs4HPSFAA== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=LVDenj2z9IGswTX1 lUZW9jKdAcAwasxcIAWoJsgZLUo=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=0gHRbT4lYp0p+2g5cHGWYbIJfnUIguCbCUXEcC yAGbsb6eOI2uMSHljLIcKyeynI7Wgp9yMM3hBmR0IjLl2RgA49E0Z+xwArsgTn2xTkOLd/ +5Attjj/b+yW3qdd1LYZIJguygfJueYYRSSunVq3UJ4iuy7jbxN9PUdTmCNBDMes+4NauV QJZV4e31buAIFBixEsLoosFlRyVQRMS35ZqdUSmO9XpsFB1/uuvtd7H41qZ1U7XF198Zn8 htTVC3EhroTo6DBHbJG+CNX4WHLAfVcso7gZIHOP7veZBFGQtcrdmsP+MrQ02M7kcswaRW yuT9wvVefn7RdpzKTJmIu1CA== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 3bfd437f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 18 Dec 2023 19:36:50 +0100 (CET) In-Reply-To: (Alan Third's message of "Mon, 18 Dec 2023 11:42:21 +0000") 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:276477 Archived-At: Alan Third writes: > On Mon, Dec 18, 2023 at 12:02:22PM +0100, Manuel Giraud via Bug > reports for GNU Emacs, the Swiss army knife of text editors wrote: >> + /* Alter the spec a bit to have a different hash for the >> + image cache. */ >> + ptrdiff_t id; >> + Lisp_Object spec = Fcopy_sequence (s->img->spec); >> + spec = nconc2 (spec, list2 (intern (":highlight"), Qt)); >> + id = lookup_image (f, spec, hlinfo->mouse_face_face_id); >> + s->img = IMAGE_FROM_ID (f, id); > > You shouldn't have to change the image spec as the image cache > differentiates by colour too. So if the mouse face has the same > colours as the default face it will use the same image, but if they're > different it will create a new image. Thanks, I'll try that. > If that's not happening then there must be a bug somewhere. > >> It does something on the an image glyph when it is hover but the image >> is completely messed up. I have stepped this code down to >> svg_load_image but I do not understand what went wrong. Any ideas? > > The code looks OK to me. In what way is the image messed up? I'm not > sure how to test mouse face on my machine, is there a built-in theme > that uses it? The image contains some random pixels that look like part of previously loaded picture. You could try it with the previous patch and test it with the following command: --8<---------------cut here---------------start------------->8--- (defun +insert-stuff () (interactive) (let ((str "foobar")) (add-text-properties 0 1 (list 'display (find-image '((:type xpm :file "close.xpm" :ascent center)) t)) str) (add-text-properties 3 4 (list 'display (find-image '((:type svg :file "radio-checked.svg" :ascent center)) t)) str) (add-text-properties 0 6 (list 'mouse-face '(:background "red" :foreground "blue")) str) (insert str))) --8<---------------cut here---------------end--------------->8--- -- Manuel Giraud