GNU bug report logs - #67764
30.0.50; Opening image in eww no longer works

Previous Next

Package: emacs;

Reported by: john muhl <jm <at> pub.pink>

Date: Mon, 11 Dec 2023 06:41:02 UTC

Severity: normal

Found in version 30.0.50

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67764 in the body.
You can then email your comments to 67764 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#67764; Package emacs. (Mon, 11 Dec 2023 06:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to john muhl <jm <at> pub.pink>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 11 Dec 2023 06:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: john muhl <jm <at> pub.pink>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Opening image in eww no longer works
Date: Mon, 11 Dec 2023 00:26:41 -0600
In Emacs 29.1 the image opens as expected:

  emacs -Q
  M-: (eww "https://www.gnu.org/software/emacs/images/emacs.png")

On master it fails with "Wrong type argument: stringp, nil".
Bisect says 4254544 is the first bad commit.


In GNU Emacs 30.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.18.0) of 2023-12-11 built on localhost
Repository revision: cd702556759b33662cd6536c89ef02ddcd93d4ff
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12302002
System Description: Fedora Linux 39 (Thirty Nine)

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

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS
HARFBUZZ JPEG JSON 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
XINPUT2 XPM GTK3 ZLIB





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67764; Package emacs. (Mon, 11 Dec 2023 11:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 67764 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: john muhl <jm <at> pub.pink>
Cc: 67764 <at> debbugs.gnu.org
Subject: Re: bug#67764: 30.0.50; Opening image in eww no longer works
Date: Mon, 11 Dec 2023 17:10:01 +0530
[Message part 1 (text/plain, inline)]
[Monday December 11, 2023] john muhl via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> In Emacs 29.1 the image opens as expected:
>
>   emacs -Q
>   M-: (eww "https://www.gnu.org/software/emacs/images/emacs.png")
>
> On master it fails with "Wrong type argument: stringp, nil".
> Bisect says 4254544 is the first bad commit.

Recent changes in shr-put-image didn't account for the possible nil
value for ALT.  Attached patch fixes the issue on my end.

[0001-Fix-shr-put-image-with-nil-value-for-ALT.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67764; Package emacs. (Mon, 11 Dec 2023 15:05:02 GMT) Full text and rfc822 format available.

Message #11 received at 67764 <at> debbugs.gnu.org (full text, mbox):

From: john muhl <jm <at> pub.pink>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 67764 <at> debbugs.gnu.org
Subject: Re: bug#67764: 30.0.50; Opening image in eww no longer works
Date: Mon, 11 Dec 2023 09:03:39 -0600
Visuwesh <visuweshm <at> gmail.com> writes:

> [Monday December 11, 2023] john muhl via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" wrote:
>
>> In Emacs 29.1 the image opens as expected:
>>
>>   emacs -Q
>>   M-: (eww "https://www.gnu.org/software/emacs/images/emacs.png")
>>
>> On master it fails with "Wrong type argument: stringp, nil".
>> Bisect says 4254544 is the first bad commit.
>
> Recent changes in shr-put-image didn't account for the possible nil
> value for ALT.  Attached patch fixes the issue on my end.

Thanks. That fixes it here too.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67764; Package emacs. (Mon, 11 Dec 2023 15:48:02 GMT) Full text and rfc822 format available.

Message #14 received at 67764 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 67764 <at> debbugs.gnu.org, jm <at> pub.pink
Subject: Re: bug#67764: 30.0.50; Opening image in eww no longer works
Date: Mon, 11 Dec 2023 17:47:17 +0200
> Cc: 67764 <at> debbugs.gnu.org
> From: Visuwesh <visuweshm <at> gmail.com>
> Date: Mon, 11 Dec 2023 17:10:01 +0530
> 
> >   emacs -Q
> >   M-: (eww "https://www.gnu.org/software/emacs/images/emacs.png")
> >
> > On master it fails with "Wrong type argument: stringp, nil".
> > Bisect says 4254544 is the first bad commit.
> 
> Recent changes in shr-put-image didn't account for the possible nil
> value for ALT.  Attached patch fixes the issue on my end.
> 
> 
> >From f6d3fc0de572a1039e83df0389c1c7efce0ef0cf Mon Sep 17 00:00:00 2001
> From: Visuwesh <visuweshm <at> gmail.com>
> Date: Mon, 11 Dec 2023 17:09:03 +0530
> Subject: [PATCH] ; Fix shr-put-image with nil value for ALT
> 
> * lisp/net/shr.el (shr-put-image): Account for nil value for ALT.
> (Bug#6774)
> ---
>  lisp/net/shr.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lisp/net/shr.el b/lisp/net/shr.el
> index 9f030b4c743..19c52ac8802 100644
> --- a/lisp/net/shr.el
> +++ b/lisp/net/shr.el
> @@ -1137,7 +1137,7 @@ shr-put-image
>          (when image
>            ;; The trailing space can confuse shr-insert into not
>            ;; putting any space after inline images.
> -	  (setq alt (string-trim alt))
> +	  (setq alt (string-trim (or alt "*")))
>  	  ;; When inserting big-ish pictures, put them at the
>  	  ;; beginning of the line.
>  	  (let ((inline (shr--inline-image-p image)))

Thanks, but can we please avoid running a fixed string through
string-trim?

Also, I think the fallback on "*" deserves a comment to explain why
that is done.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67764; Package emacs. (Tue, 12 Dec 2023 04:14:02 GMT) Full text and rfc822 format available.

Message #17 received at 67764 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67764 <at> debbugs.gnu.org, jm <at> pub.pink
Subject: Re: bug#67764: 30.0.50; Opening image in eww no longer works
Date: Tue, 12 Dec 2023 09:42:54 +0530
[Message part 1 (text/plain, inline)]
[Monday December 11, 2023] Eli Zaretskii wrote:

>> Cc: 67764 <at> debbugs.gnu.org
>> From: Visuwesh <visuweshm <at> gmail.com>
>> Date: Mon, 11 Dec 2023 17:10:01 +0530
>> 
>> >   emacs -Q
>> >   M-: (eww "https://www.gnu.org/software/emacs/images/emacs.png")
>> >
>> > On master it fails with "Wrong type argument: stringp, nil".
>> > Bisect says 4254544 is the first bad commit.
>> 
>> Recent changes in shr-put-image didn't account for the possible nil
>> value for ALT.  Attached patch fixes the issue on my end.
>> 
>> 
>> >From f6d3fc0de572a1039e83df0389c1c7efce0ef0cf Mon Sep 17 00:00:00 2001
>> From: Visuwesh <visuweshm <at> gmail.com>
>> Date: Mon, 11 Dec 2023 17:09:03 +0530
>> Subject: [PATCH] ; Fix shr-put-image with nil value for ALT
>> 
>> [...]
>>
> Thanks, but can we please avoid running a fixed string through
> string-trim?
>
> Also, I think the fallback on "*" deserves a comment to explain why
> that is done.

OK, how about the attached instead?

[0001-Fix-shr-put-image-with-nil-value-for-ALT.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67764; Package emacs. (Tue, 12 Dec 2023 08:15:02 GMT) Full text and rfc822 format available.

Message #20 received at 67764 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 67764 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, jm <at> pub.pink
Subject: Re: bug#67764: 30.0.50; Opening image in eww no longer works
Date: Tue, 12 Dec 2023 09:14:37 +0100
Visuwesh <visuweshm <at> gmail.com> writes:

[...]

> diff --git a/lisp/net/shr.el b/lisp/net/shr.el
> index 9f030b4c743..bf5038a421d 100644
> --- a/lisp/net/shr.el
> +++ b/lisp/net/shr.el
> @@ -1137,7 +1137,9 @@ shr-put-image
>          (when image
>            ;; The trailing space can confuse shr-insert into not
>            ;; putting any space after inline images.
> -	  (setq alt (string-trim alt))
> +          ;; ALT may be nil when visiting image URLs in eww
> +          ;; (bug#6774).

There is a 6 missing in the bug reference ;-)
-- 
Manuel Giraud




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67764; Package emacs. (Tue, 12 Dec 2023 09:15:01 GMT) Full text and rfc822 format available.

Message #23 received at 67764 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 67764 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, jm <at> pub.pink
Subject: Re: bug#67764: 30.0.50; Opening image in eww no longer works
Date: Tue, 12 Dec 2023 14:44:12 +0530
[Message part 1 (text/plain, inline)]
[Tuesday December 12, 2023] Manuel Giraud wrote:

> Visuwesh <visuweshm <at> gmail.com> writes:
>
> [...]
>
>> diff --git a/lisp/net/shr.el b/lisp/net/shr.el
>> index 9f030b4c743..bf5038a421d 100644
>> --- a/lisp/net/shr.el
>> +++ b/lisp/net/shr.el
>> @@ -1137,7 +1137,9 @@ shr-put-image
>>          (when image
>>            ;; The trailing space can confuse shr-insert into not
>>            ;; putting any space after inline images.
>> -	  (setq alt (string-trim alt))
>> +          ;; ALT may be nil when visiting image URLs in eww
>> +          ;; (bug#6774).
>
> There is a 6 missing in the bug reference ;-)

...and in the commit log.  I don't know how I managed to mess it up.
Thanks for catching the mistake.  Revised patch attached.

[0001-Fix-shr-put-image-with-nil-value-for-ALT.patch (text/x-diff, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 16 Dec 2023 12:55:02 GMT) Full text and rfc822 format available.

Notification sent to john muhl <jm <at> pub.pink>:
bug acknowledged by developer. (Sat, 16 Dec 2023 12:55:02 GMT) Full text and rfc822 format available.

Message #28 received at 67764-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: jm <at> pub.pink, 67764-done <at> debbugs.gnu.org, manuel <at> ledu-giraud.fr
Subject: Re: bug#67764: 30.0.50; Opening image in eww no longer works
Date: Sat, 16 Dec 2023 14:53:30 +0200
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  67764 <at> debbugs.gnu.org,  jm <at> pub.pink
> Date: Tue, 12 Dec 2023 14:44:12 +0530
> 
> > Visuwesh <visuweshm <at> gmail.com> writes:
> >
> > [...]
> >
> >> diff --git a/lisp/net/shr.el b/lisp/net/shr.el
> >> index 9f030b4c743..bf5038a421d 100644
> >> --- a/lisp/net/shr.el
> >> +++ b/lisp/net/shr.el
> >> @@ -1137,7 +1137,9 @@ shr-put-image
> >>          (when image
> >>            ;; The trailing space can confuse shr-insert into not
> >>            ;; putting any space after inline images.
> >> -	  (setq alt (string-trim alt))
> >> +          ;; ALT may be nil when visiting image URLs in eww
> >> +          ;; (bug#6774).
> >
> > There is a 6 missing in the bug reference ;-)
> 
> ...and in the commit log.  I don't know how I managed to mess it up.
> Thanks for catching the mistake.  Revised patch attached.

Thanks, installed on the master branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 14 Jan 2024 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 158 days ago.

Previous Next


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