Function: rst-adaptive-fill

rst-adaptive-fill is a byte-compiled function defined in rst.el.gz.

Signature

(rst-adaptive-fill)

Documentation

Return fill prefix found at point.

Value for adaptive-fill-function.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
;; FIXME: A paragraph with an (incorrectly) indented second line is not filled
;;        correctly::
;;
;;          Some start
;;            continued wrong
(defun rst-adaptive-fill ()
  "Return fill prefix found at point.
Value for `adaptive-fill-function'."
  (save-match-data
    (let ((fnd (if (looking-at adaptive-fill-regexp)
		   (match-string-no-properties 0))))
      (if (save-match-data
	    (not (string-match comment-start-skip fnd)))
	  ;; An non-comment prefix is fine.
	  fnd
	;; Matches a comment - return whitespace instead.
	(make-string (-
		      (save-excursion
			(goto-char (match-end 0))
			(current-column))
		      (save-excursion
			(goto-char (match-beginning 0))
			(current-column))) ? )))))