+(defvar nroff-mode-syntax-table nil
+ "Syntax table used while in nroff mode.")
+
+(defcustom nroff-font-lock-keywords
+ (list
+ ;; Directives are . or ' at start of line, followed by
+ ;; optional whitespace, then command (which my be longer than
+ ;; 2 characters in groff). Perhaps the arguments should be
+ ;; fontified as well.
+ "^[.']\\s-*\\sw+"
+ ;; There are numerous groff escapes; the following get things
+ ;; like \-, \(em (standard troff) and \f[bar] (groff
+ ;; variants). This won't currently do groff's \A'foo' and
+ ;; the like properly. One might expect it to highlight an escape's
+ ;; arguments in common cases, like \f.
+ (concat "\\\\" ; backslash
+ "\\(" ; followed by various possibilities
+ (mapconcat 'identity
+ '("[f*n]*\\[.+]" ; some groff extensions
+ "(.." ; two chars after (
+ "[^(\"]" ; single char escape
+ ) "\\|")
+ "\\)")
+ )
+ "Font-lock highlighting control in nroff-mode."
+ :group 'nroff
+ :type '(repeat regexp))
+