]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cfengine.el
Merge from emacs--devo--0
[gnu-emacs] / lisp / progmodes / cfengine.el
index a9e86de44aa846ff9764e2e27045a2f587ba6c89..06f464b29ce6d339f2c86e5d42faca4b0f936490 100644 (file)
@@ -1,6 +1,7 @@
 ;;; cfengine.el --- mode for editing Cfengine files
 
-;; Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: languages
@@ -9,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -19,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -84,6 +85,12 @@ This includes those for cfservd as well as cfagent."))
     ;; File, acl &c in group:   { token ... }
     ("{[ \t]*\\([^ \t\n]+\\)" 1 font-lock-constant-face)))
 
+(defconst cfengine-font-lock-syntactic-keywords
+  ;; In the main syntax-table, backslash is marked as a punctuation, because
+  ;; of its use in DOS-style directory separators.  Here we try to recognize
+  ;; the cases where backslash is used as an escape inside strings.
+  '(("\\(\\(?:\\\\\\)+\\)\"" 1 "\\")))
+
 (defvar cfengine-imenu-expression
   `((nil ,(concat "^[ \t]*" (eval-when-compile
                              (regexp-opt cfengine-actions t))
@@ -217,7 +224,7 @@ to the action header."
   ;; variable substitution:
   (modify-syntax-entry ?$ "." cfengine-mode-syntax-table)
   ;; Doze path separators:
-  (modify-syntax-entry ?\\ "_" cfengine-mode-syntax-table)
+  (modify-syntax-entry ?\\ "." cfengine-mode-syntax-table)
   ;; Otherwise, syntax defaults seem OK to give reasonable word
   ;; movement.
 
@@ -236,7 +243,9 @@ to the action header."
   ;; functions in evaluated classes to string syntax, and then obey
   ;; syntax properties.
   (setq font-lock-defaults
-       '(cfengine-font-lock-keywords nil nil nil beginning-of-line))
+       '(cfengine-font-lock-keywords nil nil nil beginning-of-line
+          (font-lock-syntactic-keywords
+           . cfengine-font-lock-syntactic-keywords)))
   (setq imenu-generic-expression cfengine-imenu-expression)
   (set (make-local-variable 'beginning-of-defun-function)
        #'cfengine-beginning-of-defun)
@@ -248,5 +257,5 @@ to the action header."
 
 (provide 'cfengine)
 
-;;; arch-tag: 6b931be2-1505-4124-afa6-9675971e26d4
+;; arch-tag: 6b931be2-1505-4124-afa6-9675971e26d4
 ;;; cfengine.el ends here