aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2006-09-11 07:12:37 +0000
committerStefan Monnier <[email protected]>2006-09-11 07:12:37 +0000
commit7efd03c350f668efd84c57a3c5f42867fd9cb61d (patch)
tree24a3d904a19f9444594eb6beb69bd9ea12be3ac6
parenta8b7149d7e0b03f9fca1898592f2dd6185ccfbcd (diff)
(cfengine-font-lock-syntactic-keywords): New var.
(cfengine-mode): Use it. Fix \ syntax to be like /.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/progmodes/cfengine.el14
2 files changed, 14 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ac3a50c921..711edf8ab9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2006-09-11 Stefan Monnier <[email protected]>
+ * progmodes/cfengine.el (cfengine-font-lock-syntactic-keywords): New var.
+ (cfengine-mode): Use it. Fix \ syntax to be like /.
+
* bindings.el (mode-line-buffer-identification-keymap):
Move initialization into declaration.
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 1b62774a72..b70fe58b54 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -85,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.
+ '(("\\(\\(?:\\\\\\)+\\)\"" . "\\")))
+
(defvar cfengine-imenu-expression
`((nil ,(concat "^[ \t]*" (eval-when-compile
(regexp-opt cfengine-actions t))
@@ -218,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.
@@ -237,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)
@@ -249,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