# HG changeset patch # User Chong Yidong # Date 1166930153 0 # Node ID 26507757f9623898bdeb15ece37c3a4fc6fe56fe # Parent 874a9a6de4254719f502dc884bb20e92a6952e5a (woman-decode-buffer): Signal error for alien macro sets. Suggested by James Cloos. diff -r 874a9a6de425 -r 26507757f962 lisp/woman.el --- a/lisp/woman.el Sun Dec 24 03:15:41 2006 +0000 +++ b/lisp/woman.el Sun Dec 24 03:15:53 2006 +0000 @@ -2102,6 +2102,18 @@ (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)