changeset 97577:cc3ca7429977

(nroff-mode): Avoid auto-filling on directive lines.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 20 Aug 2008 22:23:06 +0000
parents 784301c18c40
children 9c944e3e2fc4
files lisp/textmodes/nroff-mode.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/nroff-mode.el	Wed Aug 20 22:22:37 2008 +0000
+++ b/lisp/textmodes/nroff-mode.el	Wed Aug 20 22:23:06 2008 +0000
@@ -144,6 +144,14 @@
        (concat "[.']\\|" paragraph-start))
   (set (make-local-variable 'paragraph-separate)
        (concat "[.']\\|" paragraph-separate))
+  ;; Don't auto-fill directive lines starting . or ' since they normally
+  ;; have to be one line.  But do auto-fill comments .\" .\# and '''.
+  ;; Comment directives (those starting . or ') are [.'][ \t]*\\[#"]
+  ;; or ''', and this regexp is everything except those.  So [.']
+  ;; followed by not backslash and not ' or followed by backslash but
+  ;; then not # or "
+  (set (make-local-variable 'auto-fill-inhibit-regexp)
+       "[.'][ \t]*\\([^ \t\\']\\|\\\\[^#\"]\\)")
   ;; comment syntax added by mit-erl!gildea 18 Apr 86
   (set (make-local-variable 'comment-start) "\\\" ")
   (set (make-local-variable 'comment-start-skip) "\\\\[\"#][ \t]*")