emacs, dot-emacs: Provide auto-filling for m4 (and autoconf).
authorMark Wooding <mdw@distorted.org.uk>
Mon, 11 Feb 2008 14:56:05 +0000 (14:56 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 11 Feb 2008 14:56:05 +0000 (14:56 +0000)
I'm surprised I hadn't done this already, actually...

dot-emacs.el
emacs

index 9fe9741..de720a0 100644 (file)
@@ -1936,6 +1936,9 @@ strip numbers instead."
   (and mdw-auto-indent
        (indent-for-tab-command)))
 
+(defun mdw-setup-m4 ()
+  (mdw-standard-fill-prefix "\\([ \t]*\\(?:#+\\|\\<dnl\\>\\)[ \t]*\\)"))
+
 ;;;----- Text mode ----------------------------------------------------------
 
 (defun mdw-text-mode ()
diff --git a/emacs b/emacs
index 039f102..6d34822 100644 (file)
--- a/emacs
+++ b/emacs
 (add-hook 'latex-mode-hook 'mdw-fontify-tex t)
 
 (add-hook 'sh-mode-hook #'mdw-setup-sh-script-mode)
+(add-hook 'autoconf-mode-hook #'mdw-setup-m4)
+(add-hook 'm4-mode-hook #'mdw-setup-m4)
 
 (add-hook 'smalltalk-mode-hook 'mdw-fontify-smalltalk t)
 (add-hook 'smalltalk-mode-hook 'mdw-setup-smalltalk t)