Function: gnus-article-fill-cited-article

gnus-article-fill-cited-article is an autoloaded, interactive and byte-compiled function defined in gnus-cite.el.gz.

Signature

(gnus-article-fill-cited-article &optional WIDTH LONG-LINES)

Documentation

Do word wrapping in the current article.

If WIDTH (the numerical prefix), use that text width when filling.

If LONG-LINES, only fill sections that have lines longer than the frame width.

Sections that are heuristically interpreted as not being text (i.e., computer code and the like) will not be folded.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-cite.el.gz
(defun gnus-article-fill-cited-article (&optional width long-lines)
  "Do word wrapping in the current article.
If WIDTH (the numerical prefix), use that text width when
filling.

If LONG-LINES, only fill sections that have lines longer than the
frame width.

Sections that are heuristically interpreted as not being
text (i.e., computer code and the like) will not be folded."
  (interactive "P" gnus-article-mode gnus-summary-mode)
  (with-current-buffer gnus-article-buffer
    (let ((buffer-read-only nil)
	  (marks (gnus-dissect-cited-text))
	  (adaptive-fill-mode nil)
	  (fill-column (if width (prefix-numeric-value width) fill-column)))
      (save-restriction
	(while (cdr marks)
	  (narrow-to-region (caar marks) (caadr marks))
	  (let ((adaptive-fill-regexp
		 (concat "^" (regexp-quote (cdar marks)) " *"))
		(fill-prefix
		 (if (string= (cdar marks) "") ""
		   (concat (cdar marks) " ")))
		(do-fill (not long-lines))
		use-hard-newlines)
	    (unless do-fill
	      (setq do-fill (gnus-article-foldable-buffer (cdar marks))))
	    (when do-fill
	      (if (not long-lines)
		  (fill-region (point-min) (point-max))
		(goto-char (point-min))
		(while (not (eobp))
		  (end-of-line)
		  (when (prog1
			    (> (current-column) (window-width))
			  (forward-line 1))
		    (save-restriction
		      (narrow-to-region (line-beginning-position 0) (point))
		      (fill-region (point-min) (point-max))))))))
	  (set-marker (caar marks) nil)
	  (setq marks (cdr marks)))
	(when marks
	  (set-marker (caar marks) nil))
	;; All this information is now incorrect.
	(setq gnus-cite-prefix-alist nil
	      gnus-cite-attribution-alist nil
	      gnus-cite-loose-prefix-alist nil
	      gnus-cite-loose-attribution-alist nil
	      gnus-cite-article nil)))))