unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gerd.moellmann@gmail.com, 67794@debbugs.gnu.org, alan@idiocy.org
Subject: bug#67794: 30.0.50; mouse-face is not respected on SVG images
Date: Wed, 20 Dec 2023 09:47:48 +0100	[thread overview]
Message-ID: <87edfhuuob.fsf@ledu-giraud.fr> (raw)
In-Reply-To: <83zfy6gq9j.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 19 Dec 2023 17:34:32 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

[...]

>> > Depending on your system, there surely is some tools which show the
>> > memory map of a given process in some graphical manner.
>> >
>> > If worse comes to worst, you could use 'top' of "M-x proced" in
>> > another Emacs, although that will only show a single figure or two.
>> 
>> Ok, I thought you were thinking of something into Emacs.  I'll try to do
>> something like this.
>
> Thanks.

So with "ps", I measured the RSS (resident set, here in KB).  I start
from "emacs -Q" with this patch.  I used the following code to test the
feature (the SVG used here is 580x580 pixels so produces a quite large
image on display):
--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 "/usr/local/share/qgis/svg/tourist/tourist_fountain.svg"))
				t))
			 str)
    (add-text-properties 0 6
			 (list 'mouse-face '(:background "red" :foreground "blue")) str)
    (insert str)))
--8<---------------cut here---------------end--------------->8---

Here are the results:

Right after "emacs -Q": rss = 44688
After 'M-x +insert-stuff': rss = 54292
After first hover on text: rss = 54464
After repeated hover on/off text: rss = 54496

> Btw, does this only work for SVG, and if librsvg is later than some
> recent version?  Or does this work with any image?  If the former,
> this code should be executed only conditionally, under those
> conditions under which it really changes the background color of an
> image.

You're right: it does only work with SVG.  XPM are already handled with
mask.  I have tested and it does not work with PNG with transparent
background: don't know why.  Maybe instead of guard it with a "only for
SVG" test, we should resolve the issue for transparent PNG at a later
time.

I'm using librsvg 2.57 and I could not easily test it with an older
version.
-- 
Manuel Giraud





  reply	other threads:[~2023-12-20  8:47 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 13:12 bug#67794: 30.0.50; mouse-face is not respected on SVG images Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-12 13:31 ` Eli Zaretskii
2023-12-12 14:07   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-12 14:43     ` Alan Third
2023-12-12 16:35       ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-12 17:28         ` Eli Zaretskii
2023-12-13  8:18           ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-13 12:19             ` Eli Zaretskii
2023-12-13 14:13               ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-13 15:08                 ` Eli Zaretskii
2023-12-13 16:04                   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-13 16:23                     ` Eli Zaretskii
2023-12-13 16:50                       ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-13 17:29                         ` Eli Zaretskii
2023-12-13 17:57                           ` Gerd Möllmann
2023-12-13 18:11                             ` Eli Zaretskii
2023-12-13 18:24                           ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-13 18:46                             ` Eli Zaretskii
2023-12-14  9:07                               ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-14  9:23                                 ` Eli Zaretskii
2023-12-14  9:48                                   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-14 10:05                                     ` Eli Zaretskii
2023-12-18 11:02                                       ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-18 11:42                                         ` Alan Third
2023-12-18 18:36                                           ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-18 19:48                                             ` Alan Third
2023-12-19 12:45                                               ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-19 13:03                                                 ` Eli Zaretskii
2023-12-19 13:23                                                   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-19 13:40                                                     ` Eli Zaretskii
2023-12-19 13:48                                                       ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-19 14:25                                                         ` Eli Zaretskii
2023-12-19 14:39                                                           ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-19 15:34                                                             ` Eli Zaretskii
2023-12-20  8:47                                                               ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-12-20 13:19                                                                 ` Eli Zaretskii
2023-12-20 13:54                                                                   ` Alan Third
2023-12-20 13:54                                                                   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-20 17:53                                                                   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-23 10:22                                                                     ` Eli Zaretskii
2023-12-12 14:47     ` Eli Zaretskii
2023-12-12 15:20       ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edfhuuob.fsf@ledu-giraud.fr \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67794@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    --cc=eliz@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=manuel@ledu-giraud.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).