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.

Full log


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.




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.