115 |
|
|
116 |
(defcustom adaptive-fill-function nil |
(defcustom adaptive-fill-function nil |
117 |
"*Function to call to choose a fill prefix for a paragraph, or nil. |
"*Function to call to choose a fill prefix for a paragraph, or nil. |
118 |
This function is used when `adaptive-fill-regexp' does not match." |
nil means the function has not determined the fill prefix." |
119 |
:type '(choice (const nil) function) |
:type '(choice (const nil) function) |
120 |
:group 'fill) |
:group 'fill) |
121 |
|
|
230 |
;; Also setting first-line-prefix to nil prevents |
;; Also setting first-line-prefix to nil prevents |
231 |
;; second-line-prefix from being used. |
;; second-line-prefix from being used. |
232 |
(cond ;; ((looking-at paragraph-start) nil) |
(cond ;; ((looking-at paragraph-start) nil) |
233 |
|
((and adaptive-fill-function (funcall adaptive-fill-function))) |
234 |
((and adaptive-fill-regexp (looking-at adaptive-fill-regexp)) |
((and adaptive-fill-regexp (looking-at adaptive-fill-regexp)) |
235 |
(match-string-no-properties 0)) |
(match-string-no-properties 0)))) |
|
(adaptive-fill-function (funcall adaptive-fill-function)))) |
|
236 |
(forward-line 1) |
(forward-line 1) |
237 |
(if (< (point) to) |
(if (< (point) to) |
238 |
(progn |
(progn |
240 |
(setq start (point)) |
(setq start (point)) |
241 |
(setq second-line-prefix |
(setq second-line-prefix |
242 |
(cond ((looking-at paragraph-start) nil) ;Can it happen ? -stef |
(cond ((looking-at paragraph-start) nil) ;Can it happen ? -stef |
243 |
|
((and adaptive-fill-function |
244 |
|
(funcall adaptive-fill-function))) |
245 |
((and adaptive-fill-regexp |
((and adaptive-fill-regexp |
246 |
(looking-at adaptive-fill-regexp)) |
(looking-at adaptive-fill-regexp)) |
247 |
(buffer-substring-no-properties start (match-end 0))) |
(buffer-substring-no-properties start (match-end 0))))) |
|
(adaptive-fill-function |
|
|
(funcall adaptive-fill-function)))) |
|
248 |
;; If we get a fill prefix from the second line, |
;; If we get a fill prefix from the second line, |
249 |
;; make sure it or something compatible is on the first line too. |
;; make sure it or something compatible is on the first line too. |
250 |
(when second-line-prefix |
(when second-line-prefix |