unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52825: [PATCH] gnus-article: shr: Let user limit the line-width
@ 2021-12-27 16:28 Yaseen Mowzer
  2021-12-29 15:47 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Yaseen Mowzer @ 2021-12-27 16:28 UTC (permalink / raw)
  To: 52825; +Cc: Yaseen Mowzer

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






^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#52825: [PATCH] gnus-article: shr: Let user limit the line-width
  2021-12-27 16:28 bug#52825: [PATCH] gnus-article: shr: Let user limit the line-width Yaseen Mowzer
@ 2021-12-29 15:47 ` Lars Ingebrigtsen
  2021-12-29 18:43   ` Yaseen Mowzer
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-29 15:47 UTC (permalink / raw)
  To: Yaseen Mowzer; +Cc: 52825

Yaseen Mowzer <yaseen@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#52825: [PATCH] gnus-article: shr: Let user limit the line-width
  2021-12-29 15:47 ` Lars Ingebrigtsen
@ 2021-12-29 18:43   ` Yaseen Mowzer
  0 siblings, 0 replies; 3+ messages in thread
From: Yaseen Mowzer @ 2021-12-29 18:43 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 52825


Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-29 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-27 16:28 bug#52825: [PATCH] gnus-article: shr: Let user limit the line-width Yaseen Mowzer
2021-12-29 15:47 ` Lars Ingebrigtsen
2021-12-29 18:43   ` Yaseen Mowzer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).