aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2005-06-11 13:49:56 +0000
committerEli Zaretskii2005-06-11 13:49:56 +0000
commitb48e52066f205b23ada938d9e8d83e0e9cebfdce (patch)
treebb3cbf8a5db1337817916b5f709d0eb90cfdba39
parent67ed6461a6d446c25bfcb362c8678ba8926c9934 (diff)
downloademacs-b48e52066f205b23ada938d9e8d83e0e9cebfdce.tar.gz
emacs-b48e52066f205b23ada938d9e8d83e0e9cebfdce.zip
(fill-context-prefix): Try `adaptive-fill-function'
BEFORE `adaptive-fill-regexp' when determining a fill prefix. (adaptive-file-function): Minor amendment to doc-string.
-rw-r--r--lisp/textmodes/fill.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 1615da60910..048090bfdc4 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -115,7 +115,7 @@ if it would act as a paragraph-starter on the second line."
115 115
116(defcustom adaptive-fill-function nil 116(defcustom adaptive-fill-function nil
117 "*Function to call to choose a fill prefix for a paragraph, or nil. 117 "*Function to call to choose a fill prefix for a paragraph, or nil.
118This function is used when `adaptive-fill-regexp' does not match." 118nil means the function has not determined the fill prefix."
119 :type '(choice (const nil) function) 119 :type '(choice (const nil) function)
120 :group 'fill) 120 :group 'fill)
121 121
@@ -230,9 +230,9 @@ act as a paragraph-separator."
230 ;; Also setting first-line-prefix to nil prevents 230 ;; Also setting first-line-prefix to nil prevents
231 ;; second-line-prefix from being used. 231 ;; second-line-prefix from being used.
232 (cond ;; ((looking-at paragraph-start) nil) 232 (cond ;; ((looking-at paragraph-start) nil)
233 ((and adaptive-fill-function (funcall adaptive-fill-function)))
233 ((and adaptive-fill-regexp (looking-at adaptive-fill-regexp)) 234 ((and adaptive-fill-regexp (looking-at adaptive-fill-regexp))
234 (match-string-no-properties 0)) 235 (match-string-no-properties 0))))
235 (adaptive-fill-function (funcall adaptive-fill-function))))
236 (forward-line 1) 236 (forward-line 1)
237 (if (< (point) to) 237 (if (< (point) to)
238 (progn 238 (progn
@@ -240,11 +240,11 @@ act as a paragraph-separator."
240 (setq start (point)) 240 (setq start (point))
241 (setq second-line-prefix 241 (setq second-line-prefix
242 (cond ((looking-at paragraph-start) nil) ;Can it happen ? -stef 242 (cond ((looking-at paragraph-start) nil) ;Can it happen ? -stef
243 ((and adaptive-fill-function
244 (funcall adaptive-fill-function)))
243 ((and adaptive-fill-regexp 245 ((and adaptive-fill-regexp
244 (looking-at adaptive-fill-regexp)) 246 (looking-at adaptive-fill-regexp))
245 (buffer-substring-no-properties start (match-end 0))) 247 (buffer-substring-no-properties start (match-end 0)))))
246 (adaptive-fill-function
247 (funcall adaptive-fill-function))))
248 ;; If we get a fill prefix from the second line, 248 ;; If we get a fill prefix from the second line,
249 ;; make sure it or something compatible is on the first line too. 249 ;; make sure it or something compatible is on the first line too.
250 (when second-line-prefix 250 (when second-line-prefix