(defun dot () (point)) (defun match-troff-font-changes () "Check that all font changes are in in \f ... \fP pairs. This is the convention required for proper html generation." (interactive) (let ((pos 0) (found nil)) (while (search-forward "\\f" nil t) (setq pos (dot)) (setq found (search-forward-regexp "\\\\f." nil t)) (if (or (not found) (not (= (preceding-char) ?P))) (message (concat (buffer-name) ": Mismatch at positions " (int-to-string pos) "," (int-to-string (if found (1- found) pos)))) ) ) ) ) (match-troff-font-changes)