summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-art.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-07-19 15:18:23 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-07-19 15:18:29 +0200
commit00a97124203258fcbd08bdc9b719f15ab777f887 (patch)
tree148b9d78395225dd1fce81f2d07bb9698e9d2388 /lisp/gnus/gnus-art.el
parent1fc9d0a79049bfbc18937fa3a3fb90f5103a2446 (diff)
downloademacs-00a97124203258fcbd08bdc9b719f15ab777f887.tar.gz
emacs-00a97124203258fcbd08bdc9b719f15ab777f887.tar.bz2
emacs-00a97124203258fcbd08bdc9b719f15ab777f887.zip
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).
Diffstat (limited to 'lisp/gnus/gnus-art.el')
-rw-r--r--lisp/gnus/gnus-art.el20
1 files changed, 13 insertions, 7 deletions
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))