From: Lars Ingebrigtsen Date: Sun, 19 Jul 2020 13:18:23 +0000 (+0200) Subject: Allow adjusting the `W Q' Gnus summary command interactively X-Git-Tag: emacs-28.0.90~6970 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=00a97124203258fcbd08bdc9b719f15ab777f887;p=emacs.git Allow adjusting the `W Q' Gnus summary command interactively * doc/misc/gnus.texi (Article Washing): Document it. * lisp/gnus/gnus-art.el (article-fill-long-lines): Take a numeric prefix as the fill width (bug#38698). --- diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 294d9590bc9..2f4bc0cbf85 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -9060,6 +9060,9 @@ when filling. @findex gnus-article-fill-long-lines Fill long lines (@code{gnus-article-fill-long-lines}). +You can give the command a numerical prefix to specify the width to use +when filling. + @item W C @kindex W C @r{(Summary)} @findex gnus-article-capitalize-sentences diff --git a/etc/NEWS b/etc/NEWS index 7fbe63013e8..7c6c9fe2620 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -213,6 +213,10 @@ The names of the commands 'gnus-slave', 'gnus-slave-no-server' and 'gnus-slave-unplugged' have changed to 'gnus-child', 'gnus-child-no-server' and 'gnus-child-unplugged' respectively. ++++ +*** The 'W Q' summary mode command now takes a numerical prefix to +allow adjusting the fill width. + --- *** Change to default value of 'message-draft-headers' user option. The 'Date' symbol has been removed from the default value, meaning that diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 0c0c1bd0c0e..3cba4ecead9 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -2303,21 +2303,27 @@ long lines if and only if arg is positive." "\n") (put-text-property start (point) 'gnus-decoration 'header))))) -(defun article-fill-long-lines () - "Fill lines that are wider than the window width or `fill-column'." - (interactive) +(defun article-fill-long-lines (&optional width) + "Fill lines that are wider than the window width or `fill-column'. +If WIDTH (interactively, the numeric prefix), use that as the +fill width." + (interactive "P") (save-excursion - (let ((inhibit-read-only t) - (width (window-width (get-buffer-window (current-buffer))))) + (let* ((inhibit-read-only t) + (window-width (window-width (get-buffer-window (current-buffer)))) + (width (if width + (prefix-numeric-value width) + (min fill-column window-width)))) (save-restriction (article-goto-body) (let ((adaptive-fill-mode nil)) ;Why? -sm (while (not (eobp)) (end-of-line) - (when (>= (current-column) (min fill-column width)) + (when (>= (current-column) width) (narrow-to-region (min (1+ (point)) (point-max)) (point-at-bol)) - (let ((goback (point-marker))) + (let ((goback (point-marker)) + (fill-column width)) (fill-paragraph nil) (goto-char (marker-position goback))) (widen))