|
|
|
@ -2355,7 +2355,7 @@ Currently set only from \\='\\\" t in the first line of the source file.")
|
|
|
|
|
(point-max)))
|
|
|
|
|
|
|
|
|
|
(defun woman-horizontal-escapes (to)
|
|
|
|
|
"Process \\h'+/-N' local horizontal motion escapes upto TO.
|
|
|
|
|
"Process \\h'+/-N' local horizontal motion escapes up to TO.
|
|
|
|
|
Implements arbitrary forward and non-overlapping backward motion.
|
|
|
|
|
Preserves location of `point'."
|
|
|
|
|
;; Moved from `woman-decode-region' for version 0.50.
|
|
|
|
@ -3346,7 +3346,7 @@ Ignore the default face and underline only word characters."
|
|
|
|
|
|
|
|
|
|
(defun woman2-tr (to)
|
|
|
|
|
".tr abcde -- Translate a -> b, c -> d, ..., e -> space.
|
|
|
|
|
Format paragraphs upto TO. Supports special chars.
|
|
|
|
|
Format paragraphs up to TO. Supports special chars.
|
|
|
|
|
\(Breaks, but should not.)"
|
|
|
|
|
;; This should be an update, but consing onto the front of the alist
|
|
|
|
|
;; has the same effect and match duplicates should not matter.
|
|
|
|
@ -3402,7 +3402,7 @@ Format paragraphs upto TO. Supports special chars.
|
|
|
|
|
(defvar woman-registers ; these are all read-only
|
|
|
|
|
'((".H" 24) (".V" 48) ; resolution in basic units
|
|
|
|
|
(".g" 0) ; not groff
|
|
|
|
|
;; (Iff emulating groff need to implement groff italic correction
|
|
|
|
|
;; (If emulating groff need to implement groff italic correction
|
|
|
|
|
;; \/, e.g. for pic.1)
|
|
|
|
|
(".i" left-margin) ; current indent
|
|
|
|
|
(".j" woman-adjust) ; current adjustment
|
|
|
|
@ -3432,7 +3432,7 @@ Handle numeric arguments specially if optional argument NUMERIC is non-nil."
|
|
|
|
|
(defun woman2-nr (to)
|
|
|
|
|
".nr R +/-N M -- Assign +/-N (wrt to previous value, if any) to register R.
|
|
|
|
|
The increment for auto-incrementing is set to M.
|
|
|
|
|
Format paragraphs upto TO. (Breaks, but should not!)"
|
|
|
|
|
Format paragraphs up to TO. (Breaks, but should not!)"
|
|
|
|
|
(let* ((name (buffer-substring
|
|
|
|
|
(point)
|
|
|
|
|
(progn (skip-syntax-forward "^ ") (point))))
|
|
|
|
@ -3699,7 +3699,7 @@ regexp, \"\\(\\\\c\\)?\\n[.\\=']\"."
|
|
|
|
|
|
|
|
|
|
(defun woman2-PD (to)
|
|
|
|
|
".PD d -- Set the interparagraph distance to d.
|
|
|
|
|
Round to whole lines, default 1 line. Format paragraphs upto TO.
|
|
|
|
|
Round to whole lines, default 1 line. Format paragraphs up to TO.
|
|
|
|
|
\(Breaks, but should not.)"
|
|
|
|
|
;; .ie \\n[.$] .nr PD (v;\\$1)
|
|
|
|
|
;; .el .nr PD .4v>?\n[.V]
|
|
|
|
@ -3718,7 +3718,7 @@ Round to whole lines, default 1 line. Format paragraphs upto TO.
|
|
|
|
|
(setq woman-leave-blank-lines woman-interparagraph-distance))
|
|
|
|
|
|
|
|
|
|
(defun woman2-TH (to)
|
|
|
|
|
".TH n c x v m -- Begin a man page. Format paragraphs upto TO.
|
|
|
|
|
".TH n c x v m -- Begin a man page. Format paragraphs up to TO.
|
|
|
|
|
n is the name of the page in chapter c; x is extra commentary;
|
|
|
|
|
v alters page foot left; m alters page head center.
|
|
|
|
|
\(Should set prevailing indent and tabs to 5.)"
|
|
|
|
@ -3748,7 +3748,7 @@ v alters page foot left; m alters page head center.
|
|
|
|
|
|
|
|
|
|
(defun woman2-SH (to)
|
|
|
|
|
".SH -- Sub-head. Leave blank line and subhead.
|
|
|
|
|
Format paragraphs upto TO. Set prevailing indent to 5."
|
|
|
|
|
Format paragraphs up to TO. Set prevailing indent to 5."
|
|
|
|
|
(if (eolp) ; If no args then
|
|
|
|
|
(delete-char 1) ; apply to next line
|
|
|
|
|
(woman-unquote-args) ; else unquote to end of heading
|
|
|
|
@ -3767,7 +3767,7 @@ Format paragraphs upto TO. Set prevailing indent to 5."
|
|
|
|
|
|
|
|
|
|
(defun woman2-SS (to)
|
|
|
|
|
".SS -- Sub-sub-head. Like .SH but indent heading 3 spaces.
|
|
|
|
|
Format paragraphs upto TO."
|
|
|
|
|
Format paragraphs up to TO."
|
|
|
|
|
(if (eolp) ; If no args then
|
|
|
|
|
(delete-char 1)) ; apply to next line.
|
|
|
|
|
(insert " ")
|
|
|
|
@ -3776,7 +3776,7 @@ Format paragraphs upto TO."
|
|
|
|
|
|
|
|
|
|
(defun woman2-LP (to)
|
|
|
|
|
".LP,.PP -- Begin paragraph. Set prevailing indent to 5.
|
|
|
|
|
Leave 1 blank line. Format paragraphs upto TO."
|
|
|
|
|
Leave 1 blank line. Format paragraphs up to TO."
|
|
|
|
|
(woman-delete-line 1) ; ignore any arguments
|
|
|
|
|
(woman-interparagraph-space)
|
|
|
|
|
(setq woman-prevailing-indent woman-default-indent)
|
|
|
|
@ -3786,21 +3786,21 @@ Leave 1 blank line. Format paragraphs upto TO."
|
|
|
|
|
(defalias 'woman2-P #'woman2-LP)
|
|
|
|
|
|
|
|
|
|
(defun woman2-ns (to)
|
|
|
|
|
".ns -- Turn on no-space mode. Format paragraphs upto TO."
|
|
|
|
|
".ns -- Turn on no-space mode. Format paragraphs up to TO."
|
|
|
|
|
;; Should not cause a break!
|
|
|
|
|
(woman-delete-line 1) ; ignore argument(s)
|
|
|
|
|
(setq woman-nospace t)
|
|
|
|
|
(woman2-format-paragraphs to))
|
|
|
|
|
|
|
|
|
|
(defun woman2-rs (to)
|
|
|
|
|
".rs -- Turn off no-space mode. Format paragraphs upto TO."
|
|
|
|
|
".rs -- Turn off no-space mode. Format paragraphs up to TO."
|
|
|
|
|
;; Should not cause a break!
|
|
|
|
|
(woman-delete-line 1) ; ignore argument(s)
|
|
|
|
|
(setq woman-nospace nil)
|
|
|
|
|
(woman2-format-paragraphs to))
|
|
|
|
|
|
|
|
|
|
(defun woman2-sp (to)
|
|
|
|
|
".sp N -- If N > 0 then leave 1 blank line. Format paragraphs upto TO."
|
|
|
|
|
".sp N -- If N > 0 then leave 1 blank line. Format paragraphs up to TO."
|
|
|
|
|
(let ((N (if (eolp) 1 (woman-get-numeric-arg))))
|
|
|
|
|
(if (>= N 0)
|
|
|
|
|
(woman-delete-line 1) ; ignore argument(s)
|
|
|
|
@ -3955,13 +3955,13 @@ Optional argument NUMERIC, if non-nil, means the argument is numeric."
|
|
|
|
|
;;; 4. Text Filling, Adjusting, and Centering
|
|
|
|
|
|
|
|
|
|
(defun woman2-br (to)
|
|
|
|
|
".br -- Break. Leave no blank line. Format paragraphs upto TO."
|
|
|
|
|
".br -- Break. Leave no blank line. Format paragraphs up to TO."
|
|
|
|
|
(woman-delete-line 1) ; ignore any arguments
|
|
|
|
|
(woman2-format-paragraphs to))
|
|
|
|
|
|
|
|
|
|
(defun woman2-fi (to)
|
|
|
|
|
".fi -- Fill subsequent output lines. Leave no blank line.
|
|
|
|
|
Format paragraphs upto TO."
|
|
|
|
|
Format paragraphs up to TO."
|
|
|
|
|
(setq woman-nofill nil)
|
|
|
|
|
(woman-delete-line 1) ; ignore any arguments
|
|
|
|
|
;; Preserve any final blank line in the nofill region:
|
|
|
|
@ -3981,7 +3981,7 @@ for the current line length. Format paragraphs up to TO."
|
|
|
|
|
(defun woman2-ad (to)
|
|
|
|
|
".ad c -- Line adjustment is begun (once fill mode is on).
|
|
|
|
|
Set justification mode to c if specified.
|
|
|
|
|
Format paragraphs upto TO. (Breaks, but should not.)"
|
|
|
|
|
Format paragraphs up to TO. (Breaks, but should not.)"
|
|
|
|
|
;; c = l -- left, r -- right, c -- center, b or n -- both,
|
|
|
|
|
;; absent -- unchanged. Initial mode adj,both.
|
|
|
|
|
(setq woman-adjust
|
|
|
|
@ -3997,7 +3997,7 @@ Format paragraphs upto TO. (Breaks, but should not.)"
|
|
|
|
|
(woman2-format-paragraphs to))
|
|
|
|
|
|
|
|
|
|
(defun woman2-na (to)
|
|
|
|
|
".na -- No adjusting. Format paragraphs upto TO.
|
|
|
|
|
".na -- No adjusting. Format paragraphs up to TO.
|
|
|
|
|
\(Breaks, but should not.)"
|
|
|
|
|
(setq woman-adjust-previous woman-adjust
|
|
|
|
|
woman-justify-previous woman-justify
|
|
|
|
@ -4037,7 +4037,7 @@ non-nil and non-zero."
|
|
|
|
|
(defvar woman-temp-indent nil)
|
|
|
|
|
|
|
|
|
|
(defun woman2-format-paragraphs (to &optional new-left)
|
|
|
|
|
"Indent, fill and adjust paragraphs upto TO to current left margin.
|
|
|
|
|
"Indent, fill and adjust paragraphs up to TO to current left margin.
|
|
|
|
|
If optional arg NEW-LEFT is non-nil then reset current left margin.
|
|
|
|
|
If `woman-nofill' is non-nil then indent without filling or adjusting."
|
|
|
|
|
;; Blank space should only ever be output before text.
|
|
|
|
@ -4103,7 +4103,7 @@ If `woman-nofill' is non-nil then indent without filling or adjusting."
|
|
|
|
|
;;; Tagged, indented and hanging paragraphs:
|
|
|
|
|
|
|
|
|
|
(defun woman2-TP (to)
|
|
|
|
|
".TP i -- Set prevailing indent to i. Format paragraphs upto TO.
|
|
|
|
|
".TP i -- Set prevailing indent to i. Format paragraphs up to TO.
|
|
|
|
|
Begin indented paragraph with hanging tag given by next text line.
|
|
|
|
|
If tag doesn't fit, place it on a separate line."
|
|
|
|
|
(let ((i (woman2-get-prevailing-indent)))
|
|
|
|
@ -4111,7 +4111,7 @@ If tag doesn't fit, place it on a separate line."
|
|
|
|
|
(woman2-tagged-paragraph to i)))
|
|
|
|
|
|
|
|
|
|
(defun woman2-IP (to)
|
|
|
|
|
".IP x i -- Same as .TP with tag x. Format paragraphs upto TO."
|
|
|
|
|
".IP x i -- Same as .TP with tag x. Format paragraphs up to TO."
|
|
|
|
|
(woman-interparagraph-space)
|
|
|
|
|
(if (eolp) ; no args
|
|
|
|
|
;; Like LP without resetting prevailing indent
|
|
|
|
@ -4152,7 +4152,7 @@ If tag doesn't fit, place it on a separate line."
|
|
|
|
|
(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."
|
|
|
|
|
Format paragraphs up to TO. Set prevailing indent to I."
|
|
|
|
|
(if (not (looking-at "\\s *$")) ; non-empty tag
|
|
|
|
|
(setq woman-leave-blank-lines nil))
|
|
|
|
|
|
|
|
|
@ -4206,7 +4206,7 @@ Format paragraphs upto TO. Set prevailing indent to I."
|
|
|
|
|
(goto-char to)))))
|
|
|
|
|
|
|
|
|
|
(defun woman2-HP (to)
|
|
|
|
|
".HP i -- Set prevailing indent to i. Format paragraphs upto TO.
|
|
|
|
|
".HP i -- Set prevailing indent to i. Format paragraphs up to TO.
|
|
|
|
|
Begin paragraph with hanging indent."
|
|
|
|
|
(let ((i (woman2-get-prevailing-indent)))
|
|
|
|
|
(woman-interparagraph-space)
|
|
|
|
@ -4228,7 +4228,7 @@ Delete line from point and eol unless LEAVE-EOL is non-nil."
|
|
|
|
|
|
|
|
|
|
(defun woman2-RS (to)
|
|
|
|
|
".RS i -- Start relative indent, move left margin in distance i.
|
|
|
|
|
Set prevailing indent to 5 for nested indents. Format paragraphs upto TO."
|
|
|
|
|
Set prevailing indent to 5 for nested indents. Format paragraphs up to TO."
|
|
|
|
|
(push woman-left-margin woman-RS-left-margin)
|
|
|
|
|
(push woman-prevailing-indent woman-RS-prevailing-indent)
|
|
|
|
|
(setq woman-left-margin (+ woman-left-margin
|
|
|
|
@ -4237,7 +4237,7 @@ Set prevailing indent to 5 for nested indents. Format paragraphs upto TO."
|
|
|
|
|
(woman2-format-paragraphs to woman-left-margin))
|
|
|
|
|
|
|
|
|
|
(defun woman2-RE (to)
|
|
|
|
|
".RE -- End of relative indent. Format paragraphs upto TO.
|
|
|
|
|
".RE -- End of relative indent. Format paragraphs up to TO.
|
|
|
|
|
Set prevailing indent to amount of starting .RS."
|
|
|
|
|
(when woman-RS-left-margin
|
|
|
|
|
(setq woman-left-margin (pop woman-RS-left-margin)))
|
|
|
|
@ -4274,18 +4274,18 @@ otherwise set PREVIOUS. Delete the whole remaining control line."
|
|
|
|
|
|
|
|
|
|
(defun woman2-ll (to)
|
|
|
|
|
".ll +/-N -- Set, increment or decrement line length.
|
|
|
|
|
Format paragraphs upto TO. (Breaks, but should not.)"
|
|
|
|
|
Format paragraphs up to TO. (Breaks, but should not.)"
|
|
|
|
|
(woman-set-arg 'fill-column 'woman-ll-fill-column)
|
|
|
|
|
(woman2-format-paragraphs to))
|
|
|
|
|
|
|
|
|
|
(defun woman2-in (to)
|
|
|
|
|
".in +/-N -- Set, increment or decrement the indent.
|
|
|
|
|
Format paragraphs upto TO."
|
|
|
|
|
Format paragraphs up to TO."
|
|
|
|
|
(woman-set-arg 'left-margin 'woman-in-left-margin)
|
|
|
|
|
(woman2-format-paragraphs to))
|
|
|
|
|
|
|
|
|
|
(defun woman2-ti (to)
|
|
|
|
|
".ti +/-N -- Temporary indent. Format paragraphs upto TO."
|
|
|
|
|
".ti +/-N -- Temporary indent. Format paragraphs up to TO."
|
|
|
|
|
;; Ignore if no argument.
|
|
|
|
|
;; Indent next output line only wrt current indent.
|
|
|
|
|
;; Current indent is not changed.
|
|
|
|
@ -4300,7 +4300,7 @@ Format paragraphs upto TO."
|
|
|
|
|
".ta Nt ... -- Set tabs, left type, unless t=R(right), C(centered).
|
|
|
|
|
\(Breaks, but should not.) The tab stops are separated by spaces;
|
|
|
|
|
a value preceded by + represents an increment to the previous stop value.
|
|
|
|
|
Format paragraphs upto TO."
|
|
|
|
|
Format paragraphs up to TO."
|
|
|
|
|
(setq tab-stop-list nil)
|
|
|
|
|
(woman2-process-escapes-to-eol 'numeric)
|
|
|
|
|
(save-excursion
|
|
|
|
@ -4350,7 +4350,7 @@ tab stop columns or pairs (COLUMN . TYPE) where TYPE is R or C."
|
|
|
|
|
(insert ?\s))))
|
|
|
|
|
|
|
|
|
|
(defun woman2-DT (to)
|
|
|
|
|
".DT -- Restore default tabs. Format paragraphs upto TO.
|
|
|
|
|
".DT -- Restore default tabs. Format paragraphs up to TO.
|
|
|
|
|
\(Breaks, but should not.)"
|
|
|
|
|
;; Currently just terminates special tab processing.
|
|
|
|
|
(setq tab-stop-list nil)
|
|
|
|
@ -4359,7 +4359,7 @@ tab stop columns or pairs (COLUMN . TYPE) where TYPE is R or C."
|
|
|
|
|
|
|
|
|
|
(defun woman2-fc (to)
|
|
|
|
|
".fc a b -- Set field delimiter a and pad character b.
|
|
|
|
|
Format paragraphs upto TO.
|
|
|
|
|
Format paragraphs up to TO.
|
|
|
|
|
A VERY FIRST ATTEMPT to make fields at least readable!
|
|
|
|
|
Needs doing properly!"
|
|
|
|
|
(if (eolp)
|
|
|
|
@ -4395,7 +4395,7 @@ Needs doing properly!"
|
|
|
|
|
|
|
|
|
|
(defun woman2-TS (to)
|
|
|
|
|
".TS -- Start of table code for the tbl processor.
|
|
|
|
|
Format paragraphs upto TO."
|
|
|
|
|
Format paragraphs up to TO."
|
|
|
|
|
(when woman-emulate-tbl
|
|
|
|
|
;; Assumes column separator is \t and intercolumn spacing is 3.
|
|
|
|
|
;; The first line may optionally be a list of options terminated by
|
|
|
|
|