mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-27 07:37:33 +00:00
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).
This commit is contained in:
parent
1fc9d0a790
commit
00a9712420
@ -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
|
||||
|
4
etc/NEWS
4
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
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user