Subject: Re: bug#78859: 31.0.50; Viewing mime part in Rmail sets truncate-lines

From: Eli Zaretskii <[email-masked]>
Date: Sun, 22 Jun 2025 08:14:46 +0300

> From: Richard Stallman <[email-masked]>
> Date: Sat, 21 Jun 2025 19:21:24 -0400
> 
> 
> When I am looking at a message in Rmail, and it has a hidden
> HTML mime part, and I activate the Show button, that sets
> truncate-lines in te Rmail buffer, _permanently_.

FTR: this doesn't seem to happen _every_ time I view HTML MIME message
in Rmail.  Which makes sense, since shr.el does that only when certain
conditions are true:

> It is done by this code in shr.el:
> 
>     ;; This probably won't work very well.
>     (when (> (+ (cl-loop for width across sketch-widths
> 		         summing (1+ width))
> 		shr-indentation shr-table-separator-pixel-width)
> 	     (frame-width))
>       (setq truncate-lines t))
> 
> I think the comment was prophetic.  This is a pain in the neck, as it
> affects all other messages I look at in that buffer.  But I don't
> understand this code enough to try to fix it.

I see no reason to fix shr.el, I have no reasons to believe it doesn't
DTRT in this case.  I think it should be enough to reset
truncate-lines back to its original value in rmail-show-message-1,
before showing the next message, so that the following messages aren't
affected.  Do you agree?

> Why, I wondered, does it use shr.el instead of running lynx?

Because it is always better to do something using Emacs' own
capabilities than rely on external programs (which may or may not be
available).  E.g., I don't have Lynx installed here.