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

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_.

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.

Why, I wondered, does it use shr.el instead of running lynx?
Apparengly because of this in rmailmm.el:

    (defcustom rmail-mime-render-html-function
      (cond ((fboundp 'libxml-parse-html-region) #'rmail-mime-render-html-shr)
            ((executable-find "lynx") #'rmail-mime-render-html-lynx)
            (t nil))

That enabkes me to prevent the problem in my .emacs,
but it deserves a real fix that I can't wrote.

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 2.24.33, cairo version 1.16.0) of 2024-08-01 built on freetop
Repository revision: a2c439db687774f7b57959c39560993579c5d1bd
Repository branch: master
System Description: Trisquel GNU/Linux Aramo (11.0.1)

Configured using:
 'configure 'CFLAGS=-O0 -g' --with-gnutls=ifavailable'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GPM GSETTINGS HARFBUZZ JPEG LIBOTF
LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2
XPM GTK2 ZLIB

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

Major mode: RMAIL

Minor modes in effect:
  gpm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: linux
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug doc-view filenotify image-mode exif novice apropos
completion warnings cl-print debug backtrace find-func vc-git
vc-dispatcher bug-reference shortdoc comp-common ps-mode ps-samp
zeroconf printing man ps-mule ps-print ps-print-loaddefs lpr
display-line-numbers two-column kmacro rect format-spec battery dbus
jka-compr noutline outline help-fns radix-tree etags fileloop
generator xref project mule-util cal-move cal-menu calendar
cal-loaddefs epa-mail diff-mode track-changes diff sh-script rx
executable quail parse-time iso8601 vc-cvs vc-rcs log-view easy-mmode
pcvs-util mhtml-mode css-mode smie eww xdg url-queue mm-url gnus
nnheader range wid-edit color js c-ts-common treesit imenu cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs sgml-mode facemenu ispell shell pcomplete thingatpt
files-x grep compile comint ansi-osc ansi-color ring rmailkwd cl-extra
help-mode textsec uni-scripts idna-mapping ucs-normalize
uni-confusable textsec-check bookmark pp shr pixel-fill kinsoku
url-file svg xml dom rmailout dabbrev misearch multi-isearch mailalias
qp rmailmm message sendmail yank-media puny rfc822 mml mml-sec epa epg
epg-config gnus-util text-property-search time-date mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader mail-parse rfc2231
dired-aux dired dired-loaddefs t-mouse term/linux view derived
disp-table advice rmailsum rmail rfc6068 rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils finder-inf info osm-autoloads package
browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie generate-lisp-file url-domsuf url-util mailcap
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
icons password-cache json subr-x map byte-opt gv bytecomp byte-compile
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice
seq simple cl-generic indonesian philippine cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese
eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable
backquote threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk x-toolkit xinput2 x multi-tty
move-toolbar make-network-process emacs)

Memory information:
((conses 16 883551 159991) (symbols 48 35406 40)
 (strings 32 136764 12191) (string-bytes 1 3162774) (vectors 16 75645)
 (vector-slots 8 1646651 179463) (floats 8 558 486)
 (intervals 56 84322 3761) (buffers 984 116))
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)