aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-07-19 15:18:23 +0200
committerLars Ingebrigtsen2020-07-19 15:18:29 +0200
commit00a97124203258fcbd08bdc9b719f15ab777f887 (patch)
tree148b9d78395225dd1fce81f2d07bb9698e9d2388
parent1fc9d0a79049bfbc18937fa3a3fb90f5103a2446 (diff)
downloademacs-00a97124203258fcbd08bdc9b719f15ab777f887.tar.gz
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).
-rw-r--r--doc/misc/gnus.texi3
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/gnus/gnus-art.el20
3 files changed, 20 insertions, 7 deletions
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.
9060@findex gnus-article-fill-long-lines 9060@findex gnus-article-fill-long-lines
9061Fill long lines (@code{gnus-article-fill-long-lines}). 9061Fill long lines (@code{gnus-article-fill-long-lines}).
9062 9062
9063You can give the command a numerical prefix to specify the width to use
9064when filling.
9065
9063@item W C 9066@item W C
9064@kindex W C @r{(Summary)} 9067@kindex W C @r{(Summary)}
9065@findex gnus-article-capitalize-sentences 9068@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
213'gnus-slave-unplugged' have changed to 'gnus-child', 213'gnus-slave-unplugged' have changed to 'gnus-child',
214'gnus-child-no-server' and 'gnus-child-unplugged' respectively. 214'gnus-child-no-server' and 'gnus-child-unplugged' respectively.
215 215
216+++
217*** The 'W Q' summary mode command now takes a numerical prefix to
218allow adjusting the fill width.
219
216--- 220---
217*** Change to default value of 'message-draft-headers' user option. 221*** Change to default value of 'message-draft-headers' user option.
218The 'Date' symbol has been removed from the default value, meaning that 222The '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."
2303 "\n") 2303 "\n")
2304 (put-text-property start (point) 'gnus-decoration 'header))))) 2304 (put-text-property start (point) 'gnus-decoration 'header)))))
2305 2305
2306(defun article-fill-long-lines () 2306(defun article-fill-long-lines (&optional width)
2307 "Fill lines that are wider than the window width or `fill-column'." 2307 "Fill lines that are wider than the window width or `fill-column'.
2308 (interactive) 2308If WIDTH (interactively, the numeric prefix), use that as the
2309fill width."
2310 (interactive "P")
2309 (save-excursion 2311 (save-excursion
2310 (let ((inhibit-read-only t) 2312 (let* ((inhibit-read-only t)
2311 (width (window-width (get-buffer-window (current-buffer))))) 2313 (window-width (window-width (get-buffer-window (current-buffer))))
2314 (width (if width
2315 (prefix-numeric-value width)
2316 (min fill-column window-width))))
2312 (save-restriction 2317 (save-restriction
2313 (article-goto-body) 2318 (article-goto-body)
2314 (let ((adaptive-fill-mode nil)) ;Why? -sm 2319 (let ((adaptive-fill-mode nil)) ;Why? -sm
2315 (while (not (eobp)) 2320 (while (not (eobp))
2316 (end-of-line) 2321 (end-of-line)
2317 (when (>= (current-column) (min fill-column width)) 2322 (when (>= (current-column) width)
2318 (narrow-to-region (min (1+ (point)) (point-max)) 2323 (narrow-to-region (min (1+ (point)) (point-max))
2319 (point-at-bol)) 2324 (point-at-bol))
2320 (let ((goback (point-marker))) 2325 (let ((goback (point-marker))
2326 (fill-column width))
2321 (fill-paragraph nil) 2327 (fill-paragraph nil)
2322 (goto-char (marker-position goback))) 2328 (goto-char (marker-position goback)))
2323 (widen)) 2329 (widen))