GNU bug report logs - #52825
[PATCH] gnus-article: shr: Let user limit the line-width

Previous Next

Package: emacs;

Reported by: Yaseen Mowzer <yaseen <at> mowzer.co.za>

Date: Mon, 27 Dec 2021 17:07:05 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 52825 in the body.
You can then email your comments to 52825 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#52825; Package emacs. (Mon, 27 Dec 2021 17:07:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yaseen Mowzer <yaseen <at> mowzer.co.za>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 27 Dec 2021 17:07:05 GMT) Full text and rfc822 format available.

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

From: Yaseen Mowzer <yaseen <at> mowzer.co.za>
To: bug-gnu-emacs <at> gnu.org
Cc: Yaseen Mowzer <yaseen <at> mowzer.co.za>
Subject: [PATCH] gnus-article: shr: Let user limit the line-width
Date: Mon, 27 Dec 2021 18:28:06 +0200
As a user with a wide screen I want to limit the width of lines in
gnus-article buffers so that articles are easier to read. This is
configurable in the 'shr' backend by setting 'shr-width' to an
integer. However, 'mm-shr' forces 'shr-width' to nil (by default) and
'fill-column' (when 'shr-use-fonts' is nil).

* lisp/gnus/mm-decode.el (mm-shr): Let the user configure 'shr-width'
instead of forcing it to nil (by default) or 'fill-column' (when
'shr-use-fonts' is nil).
---

 lisp/gnus/mm-decode.el | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index aca4bf2062..f3e498016c 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1832,10 +1832,7 @@ shr-inhibit-images
 (defun mm-shr (handle)
   ;; Require since we bind its variables.
   (require 'shr)
-  (let ((shr-width (if shr-use-fonts
-		       nil
-		     fill-column))
-	(shr-content-function (lambda (id)
+  (let ((shr-content-function (lambda (id)
 				(let ((handle (mm-get-content-id id)))
 				  (when handle
 				    (mm-with-part handle
-- 
2.34.1





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52825; Package emacs. (Wed, 29 Dec 2021 15:49:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Yaseen Mowzer <yaseen <at> mowzer.co.za>
Cc: 52825 <at> debbugs.gnu.org
Subject: Re: bug#52825: [PATCH] gnus-article: shr: Let user limit the
 line-width
Date: Wed, 29 Dec 2021 16:47:52 +0100
Yaseen Mowzer <yaseen <at> mowzer.co.za> writes:

> As a user with a wide screen I want to limit the width of lines in
> gnus-article buffers so that articles are easier to read. This is
> configurable in the 'shr' backend by setting 'shr-width' to an
> integer. However, 'mm-shr' forces 'shr-width' to nil (by default) and
> 'fill-column' (when 'shr-use-fonts' is nil).

[...]

> -  (let ((shr-width (if shr-use-fonts
> -		       nil
> -		     fill-column))
> -	(shr-content-function (lambda (id)

The point of filling when not using fonts is explained by the commit
message:

    * lisp/gnus/mm-decode.el (mm-shr): Only pass the fill column when not using
    fonts, because limiting the width to what's appropriate for followups
    doesn't really help when not using proportional fonts.

Your change would make Gnus disregard fill-column when not using fonts,
thereby causing followups to use wider lines, which we want to avoid.

But I think using shr-width instead of nil in the font case would be
fine, so I've done that instead in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 52825 <at> debbugs.gnu.org and Yaseen Mowzer <yaseen <at> mowzer.co.za> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 29 Dec 2021 15:50:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52825; Package emacs. (Wed, 29 Dec 2021 18:46:02 GMT) Full text and rfc822 format available.

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

From: Yaseen Mowzer <yaseen <at> mowzer.co.za>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 52825 <at> debbugs.gnu.org
Subject: Re: bug#52825: [PATCH] gnus-article: shr: Let user limit the
 line-width
Date: Wed, 29 Dec 2021 20:43:42 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Your change would make Gnus disregard fill-column when not using fonts,
> thereby causing followups to use wider lines, which we want to avoid.
>
> But I think using shr-width instead of nil in the font case would be
> fine, so I've done that instead in Emacs 29.

Excellent! Thanks for your hard work.

-- 
Kind regards
Yaseen Mowzer




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

This bug report was last modified 2 years and 83 days ago.

Previous Next


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