# HG changeset patch # User Eli Zaretskii # Date 1118497796 0 # Node ID e700c9f37b8f2f5ac8aee7b7d0f7667d26acc9ad # Parent 99035f54e10f50d72c9ad5aa6eb2ef21f3a4517f (fill-context-prefix): Try `adaptive-fill-function' BEFORE `adaptive-fill-regexp' when determining a fill prefix. (adaptive-file-function): Minor amendment to doc-string. diff -r 99035f54e10f -r e700c9f37b8f lisp/textmodes/fill.el --- a/lisp/textmodes/fill.el Sat Jun 11 13:25:16 2005 +0000 +++ b/lisp/textmodes/fill.el Sat Jun 11 13:49:56 2005 +0000 @@ -115,7 +115,7 @@ (defcustom adaptive-fill-function nil "*Function to call to choose a fill prefix for a paragraph, or nil. -This function is used when `adaptive-fill-regexp' does not match." +nil means the function has not determined the fill prefix." :type '(choice (const nil) function) :group 'fill) @@ -230,9 +230,9 @@ ;; Also setting first-line-prefix to nil prevents ;; second-line-prefix from being used. (cond ;; ((looking-at paragraph-start) nil) + ((and adaptive-fill-function (funcall adaptive-fill-function))) ((and adaptive-fill-regexp (looking-at adaptive-fill-regexp)) - (match-string-no-properties 0)) - (adaptive-fill-function (funcall adaptive-fill-function)))) + (match-string-no-properties 0)))) (forward-line 1) (if (< (point) to) (progn @@ -240,11 +240,11 @@ (setq start (point)) (setq second-line-prefix (cond ((looking-at paragraph-start) nil) ;Can it happen ? -stef + ((and adaptive-fill-function + (funcall adaptive-fill-function))) ((and adaptive-fill-regexp (looking-at adaptive-fill-regexp)) - (buffer-substring-no-properties start (match-end 0))) - (adaptive-fill-function - (funcall adaptive-fill-function)))) + (buffer-substring-no-properties start (match-end 0))))) ;; If we get a fill prefix from the second line, ;; make sure it or something compatible is on the first line too. (when second-line-prefix