Function: woman2-tagged-paragraph

woman2-tagged-paragraph is a byte-compiled function defined in woman.el.gz.

Signature

(woman2-tagged-paragraph TO I)

Documentation

Begin indented paragraph with hanging tag given by current text line.

If tag doesn't fit, leave it on separate line. Format paragraphs upto TO. Set prevailing indent to I.

Source Code

;; Defined in /usr/src/emacs/lisp/woman.el.gz
(defun woman2-tagged-paragraph (to i)
  "Begin indented paragraph with hanging tag given by current text line.
If tag doesn't fit, leave it on separate line.
Format paragraphs upto TO.  Set prevailing indent to I."
  (if (not (looking-at "\\s *$"))	; non-empty tag
      (setq woman-leave-blank-lines nil))

  ;; Temporary hack for bash.1, cvs.1 and groff_mmse.7 until code is revised
  ;; to process all requests uniformly.
  ;; This hack deals with IP requests followed by other requests (eg
  ;; SP) on the very next line. We skip over the SP, otherwise it gets
  ;; inserted raw in the rendered output.
  (cond ((and (= (point) to)
              (looking-at "^[.'][ \t]*\\(PD\\|br\\|ta\\|sp\\) *"))
         (if (member (match-string 1) '("br" "sp"))
             (woman-delete-line 1)
           (woman-delete-match 0)
           (if (string= (match-string 1) "ta") ; for GetInt.3
               (woman2-ta to)
             (woman-set-interparagraph-distance)))
         (set-marker to (woman-find-next-control-line-carefully))))

  (let ((tag (point)))
    (woman-reset-nospace)
    ;; Format the tag:
    (woman2-process-escapes-to-eol)
    ;; TIDY UP THE FOLLOWING CODE
    ;; (indent-to woman-left-margin)
    (setq left-margin woman-left-margin)
    (forward-line)
    (fill-region-as-paragraph (save-excursion (forward-line -1) (point))
			      (point) woman-justify)

    ;; Temporary hack for bash.1 until all requests processed uniformly:
    (cond ((and (= (point) to) (looking-at "^[.'][ \t]*PD *"))
	   (woman-delete-match 0)
	   (woman-set-interparagraph-distance)
	   (set-marker to (woman-find-next-control-line-carefully))
	   ))

    ;; Format the paragraph body, if there is one!  Set indented left
    ;; margin anyway, because the paragraph body may begin with a
    ;; control line:
    (setq left-margin (+ woman-left-margin i))
    (cond ((< (point) to)
	   (woman2-format-paragraphs to)
	   (goto-char tag)  (end-of-line)
	   (cond ((> (setq i (- left-margin (current-column))) 0)
		  (delete-char 1)
		  (delete-horizontal-space)
		  ;; Necessary to avoid spaces inheriting underlines.
		  ;; Cannot simply delete (current-column) whitespace
		  ;; characters because some may be tabs!
		  (insert-char ?\s i)))
	   (goto-char to)))))