comparison lisp/textmodes/fill.el @ 7721:b04897534717

(fill-region-as-paragraph): if left-margin is nonzero, do adaptive-fill processing even for one-line paragraphs.
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 May 1994 08:15:16 +0000
parents cc7cd83ccf3f
children bf559544bd48
comparison
equal deleted inserted replaced
7720:0e0ef6c1e53a 7721:b04897534717
83 (let ((start (point))) 83 (let ((start (point)))
84 (re-search-forward adaptive-fill-regexp) 84 (re-search-forward adaptive-fill-regexp)
85 (setq fill-prefix (buffer-substring start (point)))) 85 (setq fill-prefix (buffer-substring start (point))))
86 (goto-char (min from to)) 86 (goto-char (min from to))
87 (if (eolp) (forward-line 1)) 87 (if (eolp) (forward-line 1))
88 ;; If paragraph has only one line, don't assume 88 ;; If paragraph has only one line, don't assume in general
89 ;; that additional lines would have the same starting 89 ;; that additional lines would have the same starting
90 ;; decoration. Assume no indentation. 90 ;; decoration. Assume no indentation.
91 ;; (re-search-forward adaptive-fill-regexp) 91 ;; But if left-margin is nonzero, we can assume ordinary
92 ;; (setq fill-prefix (make-string (current-column) ?\ )) 92 ;; lines do have indentation.
93 (if (> left-margin 0)
94 (progn
95 (re-search-forward adaptive-fill-regexp)
96 (setq fill-prefix (make-string (current-column) ?\ ))))
93 ))) 97 )))
94 98
95 (save-restriction 99 (save-restriction
96 (narrow-to-region from to) 100 (narrow-to-region from to)
97 (goto-char (point-min)) 101 (goto-char (point-min))