(defconst sentence-end-double-space t
"*Non-nil means a single space does not end a sentence.")
+(defconst colon-double-space nil
+ "*Non-nil means put two spaces after a colon when filling.")
+
(defvar fill-paragraph-function nil
"Mode-specific function to fill a paragraph.")
for the paragraph. If the paragraph has just one line, the indentation
is taken from that line.")
+(defun adaptive-fill-function nil
+ "*Function to call to choose a fill prefix for a paragraph.
+This function is used when `adaptive-fill-regexp' does not match.")
+
(defun current-fill-column ()
"Return the fill-column to use for this line.
The fill-column to use for a buffer is stored in the variable `fill-column',
(skip-chars-backward " ]})\"'")
(cond ((and sentence-end-double-space
(memq (preceding-char) '(?. ?? ?!))) 2)
+ ((and colon-double-space
+ (= (preceding-char) ?:)) 2)
((char-equal (preceding-char) ?\n) 0)
(t 1))))
(match-end 0)))
(if (>= (point) to)
(goto-char firstline)))
(move-to-left-margin)
- (let ((start (point)))
- (re-search-forward adaptive-fill-regexp)
- (setq fill-prefix (buffer-substring start (point)))
- (set-text-properties 0 (length fill-prefix) nil
- fill-prefix))
- ))
+ (let ((start (point))
+ (eol (save-excursion (end-of-line) (point)))
+ temp)
+ (if (not (looking-at paragraph-start))
+ (cond ((re-search-forward adaptive-fill-regexp nil t)
+ (setq fill-prefix
+ (buffer-substring-no-properties start (point))))
+ ((setq temp (funcall adaptive-fill-function))
+ (setq fill-prefix temp)))))))
(save-restriction
(goto-char from)