Function: texinfo-format-refill

texinfo-format-refill is a byte-compiled function defined in texinfmt.el.gz.

Signature

(texinfo-format-refill)

Documentation

Refill paragraph. Also, indent first line as set by @paragraphindent.

Default is to leave paragraph indentation as is.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/texinfmt.el.gz
(defun texinfo-format-refill ()
  "Refill paragraph.  Also, indent first line as set by @paragraphindent.
Default is to leave paragraph indentation as is."
  (texinfo-discard-command)
  (let ((position (point-marker)))
    (forward-paragraph -1)
    (if (looking-at "[ \t\n]*$") (forward-line 1))
    ;; Do not indent if an entry in a list, table, or deffn,
    ;; or if paragraph is preceded by @noindent.
    ;; Otherwise, indent
    (cond
     ;; delete a @noindent line and do not indent paragraph
     ((save-excursion (forward-line -1)
		      (looking-at "^@noindent"))
      (forward-line -1)
      (delete-region (point) (progn (forward-line 1) (point))))
     ;; do nothing if "asis"
     ((equal texinfo-paragraph-indent "asis"))
     ;; do no indenting in list, etc.
     ((> texinfo-stack-depth 0))
     ;; otherwise delete existing whitespace and indent
     (t
      (delete-region (point) (progn (skip-chars-forward " \t") (point)))
      (insert (make-string texinfo-paragraph-indent ? ))))
    (forward-paragraph 1)
    (forward-line -1)
    (end-of-line)
    ;; Do not fill a section title line with asterisks, hyphens, etc. that
    ;; are used to underline it.  This could occur if the line following
    ;; the underlining is not an index entry and has text within it.
    (let* ((previous-paragraph-separate paragraph-separate)
	   (paragraph-separate
	    (concat paragraph-separate "\\|[-=.]+\\|\\*\\*+"))
	   (previous-paragraph-start paragraph-start)
	   (paragraph-start
	    (concat paragraph-start "\\|[-=.]+\\|\\*\\*+")))
      (unwind-protect
	  (fill-paragraph nil)
	(setq paragraph-separate previous-paragraph-separate)
	(setq paragraph-start previous-paragraph-start)))
    (goto-char position)))