GNU bug report logs - #77384
31.0.50; Image slice is ignored on mode/header/tab line

Previous Next

Package: emacs;

Reported by: David Ponce <da_vid <at> orange.fr>

Date: Sun, 30 Mar 2025 14:02:01 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#77384: closed (31.0.50; Image slice is ignored on
 mode/header/tab line)
Date: Sun, 30 Mar 2025 16:17:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 30 Mar 2025 19:16:00 +0300
with message-id <86semu4hq7.fsf <at> gnu.org>
and subject line Re: bug#77384: 31.0.50; Image slice is ignored on mode/header/tab line
has caused the debbugs.gnu.org bug report #77384,
regarding 31.0.50; Image slice is ignored on mode/header/tab line
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
77384: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77384
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: David Ponce <da_vid <at> orange.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Image slice is ignored on mode/header/tab line
Date: Sun, 30 Mar 2025 16:01:14 +0200
Hello,

While trying to horizontally scroll images on the header line, I
discovered that the display slice specification is ignored when an image
is displayed in the header (or mode or tab) line.  I wonder if this
might be a bug, or just an unsupported feature, since the manual says
nothing about this limitation (or I did not find it):

"‘(slice X Y WIDTH HEIGHT)’
     This specification together with ‘image’ specifies a “slice” (a
     partial area) of the image to display.  The elements Y and X
     specify the top left corner of the slice, within the image; WIDTH
     and HEIGHT specify the width and height of the slice.  Integers are
     numbers of pixels.  A floating-point number in the range 0.0-1.0
     stands for that fraction of the width or height of the entire
     image."

Following is a short recipe to eval in the *scratch-buffer*, that exhibits
the issue.  The expected sliced image is inserted in the current buffer,
but the whole image is displayed in the header line.

(let* ((img (find-image '((:file "splash.svg"))))
       (size (image-size img t))
       (h (frame-char-height))
       (y (- (cdr size) h h h))
       (txt (propertize " " 'display (list img `(slice 0 ,y 0.5 ,h)))))
  (insert txt "\n")
  (setq header-line-format txt))

Thanks!



In GNU Emacs 31.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.43, cairo version 1.18.0) of 2025-03-30
Repository revision: 209b7e7444df5cb164679c0e55f46cba424ad13c
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 40 (KDE Plasma)

Configured using:
 'configure --with-native-compilation=no'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM
XRANDR GTK3 ZLIB

Important settings:
  value of $LC_TIME: fr_FR.utf8
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix



[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: David Ponce <da_vid <at> orange.fr>
Cc: 77384-done <at> debbugs.gnu.org
Subject: Re: bug#77384: 31.0.50; Image slice is ignored on mode/header/tab line
Date: Sun, 30 Mar 2025 19:16:00 +0300
> Date: Sun, 30 Mar 2025 17:44:18 +0200
> Cc: 77384 <at> debbugs.gnu.org
> From: David Ponce <da_vid <at> orange.fr>
> 
> On 2025-03-30 16:53, Eli Zaretskii wrote:
> > You need to do it the other way around:
> > 
> >    (let* ((img (find-image '((:file "splash.svg"))))
> > 	  (size (image-size img t))
> > 	  (h (frame-char-height))
> > 	  (y (- (cdr size) h h h))
> > 	  (txt (propertize " " 'display (list `(slice 0 ,y 0.5 ,h) img))))
> >       (insert txt "\n")                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >       (setq header-line-format txt))
> > 
> > IOW, first slice, then the image spec.
> 
> Oh! I didn't even think to try that. It works perfectly now.
> You can close this bug.
> 
> Thank you so much for your help, once again!

You're welcome.  Closing.


This bug report was last modified 79 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.