Function: woman0-de
woman0-de is a byte-compiled function defined in woman.el.gz.
Signature
(woman0-de &optional APPEND)
Documentation
Process .de/am xx yy -- (re)define/append macro xx; end at ...
(Should be up to call of yy, which defaults to .)
Optional argument APPEND, if non-nil, means append macro.
Source Code
;; Defined in /usr/src/emacs/lisp/woman.el.gz
(defun woman0-de (&optional append)
"Process .de/am xx yy -- (re)define/append macro xx; end at `..'.
\(Should be up to call of yy, which defaults to `.')
Optional argument APPEND, if non-nil, means append macro."
;; Modeled on woman-strings. BEWARE: Processing of .am is a hack!
;; Add support for .rm?
;; (skip-chars-forward " \t")
(if (eolp) ; ignore if no argument
()
(looking-at "[^ \t\n]+") ; macro name
(let* ((macro (match-string 0)) from
(previous (assoc macro woman0-macro-alist)))
(if (not previous)
(setq woman0-search-regex-start
(concat woman0-search-regex-start "\\|" (regexp-quote macro))
woman0-search-regex
(concat woman0-search-regex-start woman0-search-regex-end)
))
;; Macro body runs from start of next line to line
;; beginning with `..'."
;; The terminal request MUST begin with `.' (not ')!
(forward-line)
(setq from (point))
(re-search-forward "^\\.[ \t]*\\.")
(beginning-of-line)
(let ((body (woman-unescape (buffer-substring from (point)))))
(if (and append previous)
(setq previous (cdr previous)
body (concat body (cdr previous))
append (car previous)
))
(setq macro (cons macro (cons append body))))
;; This should be an update, but consing a new string
;; onto the front of the alist has the same effect:
(setq woman0-macro-alist (cons macro woman0-macro-alist))
(forward-line)
(delete-region from (point))
(backward-char))) ; return to end of .de/am line
(beginning-of-line) ; delete .de/am line
(woman-delete-line 1))