summaryrefslogtreecommitdiff
path: root/lisp/woman.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-12-24 03:15:53 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-12-24 03:15:53 +0000
commitd24b0d9a33f43d4338dddd9c402e855d6b561e75 (patch)
tree27396e81bc1961a1517822f8e20502e190b1fe44 /lisp/woman.el
parentc4cdc5a182b3ad0337c30ec7fad7e1f4e818d859 (diff)
downloademacs-d24b0d9a33f43d4338dddd9c402e855d6b561e75.tar.gz
(woman-decode-buffer): Signal error for alien macro sets. Suggested
by James Cloos.
Diffstat (limited to 'lisp/woman.el')
-rw-r--r--lisp/woman.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/woman.el b/lisp/woman.el
index e8387584ab7..2d3513f0097 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -2102,6 +2102,18 @@ No external programs are used."
(interactive) ; mainly for testing
(WoMan-log-begin)
(run-hooks 'woman-pre-format-hook)
+
+ ;; look for macro sets that woman cannot handle:
+ (goto-char (point-min))
+ (let ((case-fold-search nil))
+ (unless (and (re-search-forward "^\\.SH[ \n]" (point-max) t)
+ (progn (goto-char (point-min))
+ (re-search-forward "^\\.TH[ \n]" (point-max) t))
+ (progn (goto-char (point-min))
+ (not (re-search-forward "^\\.\\([pnil]p\\|sh\\)[ \n]"
+ (point-max) t))))
+ (error "WoMan can only format manpages written in the an format")))
+
(and (boundp 'font-lock-mode) font-lock-mode (font-lock-mode -1))
;; (fundamental-mode)
(let ((start-time (current-time)) ; (HIGH LOW MICROSEC)