(org-special-keyword): New face.
[bpt/emacs.git] / lisp / textmodes / conf-mode.el
1 ;;; conf-mode.el --- Simple major mode for editing conf/ini/properties files
2
3 ;; Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4
5 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
6 ;; Keywords: conf ini windows java
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
24
25 ;;; Commentary:
26 ;;
27 ;; This mode is designed to edit many similar varieties of Conf/Ini files and
28 ;; Java properties. It started out from Aurélien Tisné's ini-mode.
29 ;; `conf-space-keywords' were inspired by Robert Fitzgerald's any-ini-mode.
30
31
32 ;;; Code:
33
34 (require 'newcomment)
35
36 ;; Variables:
37
38 (defgroup conf nil
39 "Configuration files."
40 :group 'data
41 :version "22.1")
42
43 (defcustom conf-assignment-column 24
44 "Align assignments to this column by default with \\[conf-align-assignments].
45 If this number is negative, the `=' comes before the whitespace. Use 0 to
46 not align (only setting space according to `conf-assignment-space')."
47 :type 'integer
48 :group 'conf)
49
50 (defcustom conf-javaprop-assignment-column 32
51 "Value for `conf-assignment-column' in Java properties buffers."
52 :type 'integer
53 :group 'conf)
54
55 (defcustom conf-colon-assignment-column (- (abs conf-assignment-column))
56 "Value for `conf-assignment-column' in Java properties buffers."
57 :type 'integer
58 :group 'conf)
59
60 (defcustom conf-assignment-space t
61 "Put at least one space around assignments when aligning."
62 :type 'boolean
63 :group 'conf)
64
65 (defcustom conf-colon-assignment-space nil
66 "Value for `conf-assignment-space' in colon style Conf mode buffers."
67 :type 'boolean
68 :group 'conf)
69
70
71 (defvar conf-mode-map
72 (let ((map (make-sparse-keymap)))
73 (define-key map "\C-c\C-u" 'conf-unix-mode)
74 (define-key map "\C-c\C-w" 'conf-windows-mode)
75 (define-key map "\C-c\C-j" 'conf-javaprop-mode)
76 (define-key map "\C-c\C-s" 'conf-space-mode)
77 (define-key map "\C-c " 'conf-space-mode)
78 (define-key map "\C-c\C-c" 'conf-colon-mode)
79 (define-key map "\C-c:" 'conf-colon-mode)
80 (define-key map "\C-c\C-x" 'conf-xdefaults-mode)
81 (define-key map "\C-c\C-p" 'conf-ppd-mode)
82 (define-key map "\C-c\C-q" 'conf-quote-normal)
83 (define-key map "\C-c\"" 'conf-quote-normal)
84 (define-key map "\C-c'" 'conf-quote-normal)
85 (define-key map "\C-c\C-a" 'conf-align-assignments)
86 map)
87 "Local keymap for conf-mode buffers.")
88
89 (defvar conf-mode-syntax-table
90 (let ((table (make-syntax-table)))
91 (modify-syntax-entry ?= "." table)
92 (modify-syntax-entry ?_ "_" table)
93 (modify-syntax-entry ?- "_" table)
94 (modify-syntax-entry ?. "_" table)
95 (modify-syntax-entry ?\' "\"" table)
96 (modify-syntax-entry ?\; "<" table)
97 (modify-syntax-entry ?\n ">" table)
98 (modify-syntax-entry ?\r ">" table)
99 table)
100 "Syntax table in use in Windows style conf-mode buffers.")
101
102 (defvar conf-unix-mode-syntax-table
103 (let ((table (make-syntax-table conf-mode-syntax-table)))
104 (modify-syntax-entry ?\# "<" table)
105 ;; override
106 (modify-syntax-entry ?\; "." table)
107 table)
108 "Syntax table in use in Unix style conf-mode buffers.")
109
110 (defvar conf-javaprop-mode-syntax-table
111 (let ((table (make-syntax-table conf-unix-mode-syntax-table)))
112 (modify-syntax-entry ?/ ". 124" table)
113 (modify-syntax-entry ?* ". 23b" table)
114 table)
115 "Syntax table in use in Java prperties buffers.")
116
117 (defvar conf-ppd-mode-syntax-table
118 (let ((table (make-syntax-table conf-mode-syntax-table)))
119 (modify-syntax-entry ?* ". 1" table)
120 (modify-syntax-entry ?% ". 2" table)
121 ;; override
122 (modify-syntax-entry ?\' "." table)
123 (modify-syntax-entry ?\; "." table)
124 table)
125 "Syntax table in use in PPD conf-mode buffers.")
126
127 (defvar conf-xdefaults-mode-syntax-table
128 (let ((table (make-syntax-table conf-mode-syntax-table)))
129 (modify-syntax-entry ?! "<" table)
130 ;; override
131 (modify-syntax-entry ?\; "." table)
132 table)
133 "Syntax table in use in Xdefaults style conf-mode buffers.")
134
135
136 (defvar conf-font-lock-keywords
137 `(;; [section] (do this first because it may look like a parameter)
138 ("^[ \t]*\\[\\(.+\\)\\]" 1 'font-lock-type-face)
139 ;; var=val or var[index]=val
140 ("^[ \t]*\\(.+?\\)\\(?:\\[\\(.*?\\)\\]\\)?[ \t]*="
141 (1 'font-lock-variable-name-face)
142 (2 'font-lock-constant-face nil t))
143 ;; section { ... } (do this last because some assign ...{...)
144 ("^[ \t]*\\([^=:\n]+?\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face prepend))
145 "Keywords to hilight in Conf mode")
146
147 (defvar conf-javaprop-font-lock-keywords
148 '(;; var=val
149 ("^[ \t]*\\(.+?\\)\\(?:\\.\\([0-9]+\\)\\(?:\\.\\(.+?\\)\\(?:\\.\\([0-9]+\\)\\(?:\\.\\(.+?\\)\\(?:\\.\\([0-9]+\\)\\(\\..+?\\)?\\)?\\)?\\)?\\)?\\)?\\([:= \t]\\|$\\)"
150 (1 'font-lock-variable-name-face)
151 (2 'font-lock-constant-face nil t)
152 (3 'font-lock-variable-name-face nil t)
153 (4 'font-lock-constant-face nil t)
154 (5 'font-lock-variable-name-face nil t)
155 (6 'font-lock-constant-face nil t)
156 (7 'font-lock-variable-name-face nil t)))
157 "Keywords to hilight in Conf Java Properties mode")
158
159 (defvar conf-space-keywords-alist
160 '(("\\`/etc/gpm/" . "key\\|name\\|foreground\\|background\\|border\\|head")
161 ("\\`/etc/magic\\'" . "[^ \t]+[ \t]+\\(?:[bl]?e?\\(?:short\\|long\\)\\|byte\\|string\\)[^ \t]*")
162 ("/mod\\(?:ules\\|probe\\)\\.conf" . "alias\\|in\\(?:clude\\|stall\\)\\|options\\|remove")
163 ("/manpath\\.config" . "MAN\\(?:DATORY_MANPATH\\|PATH_MAP\\|DB_MAP\\)")
164 ("/sensors\\.conf" . "chip\\|bus\\|label\\|compute\\|set\\|ignore")
165 ("/sane\\(\\.d\\)?/" . "option\\|device\\|port\\|usb\\|sc\\(?:si\\|anner\\)")
166 ("/resmgr\\.conf" . "class\\|add\\|allow\\|deny")
167 ("/dictionary\\.lst\\'" . "DICT\\|HYPH\\|THES")
168 ("/tuxracer/options" . "set"))
169 "File name based settings for `conf-space-keywords'.")
170
171 (defvar conf-space-keywords nil
172 "Regexps for functions that may come before a space assignment.
173 This allows constructs such as
174 keyword var value
175 This variable is best set in the file local variables, or through
176 `conf-space-keywords-alist'.")
177
178 (defvar conf-space-font-lock-keywords
179 `(;; [section] (do this first because it may look like a parameter)
180 ("^[ \t]*\\[\\(.+\\)\\]" 1 'font-lock-type-face)
181 ;; section { ... } (do this first because it looks like a parameter)
182 ("^[ \t]*\\(.+?\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face)
183 ;; var val
184 (eval if conf-space-keywords
185 (list (concat "^[ \t]*\\(" conf-space-keywords "\\)[ \t]+\\([^\000- ]+\\)")
186 '(1 'font-lock-keyword-face)
187 '(2 'font-lock-variable-name-face))
188 '("^[ \t]*\\([^\000- ]+\\)" 1 'font-lock-variable-name-face)))
189 "Keywords to hilight in Conf Space mode")
190
191 (defvar conf-colon-font-lock-keywords
192 `(;; [section] (do this first because it may look like a parameter)
193 ("^[ \t]*\\[\\(.+\\)\\]" 1 'font-lock-type-face)
194 ;; var: val
195 ("^[ \t]*\\(.+?\\)[ \t]*:"
196 (1 'font-lock-variable-name-face))
197 ;; section { ... } (do this last because some assign ...{...)
198 ("^[ \t]*\\([^:\n]+\\)[ \t\n]*{[^{}]*?$" 1 'font-lock-type-face prepend))
199 "Keywords to hilight in Conf Colon mode")
200
201 (defvar conf-assignment-sign ?=
202 "What sign is used for assignments.")
203
204 (defvar conf-assignment-regexp ".+?\\([ \t]*=[ \t]*\\)"
205 "Regexp to recognize assignments.
206 It is anchored after the first sexp on a line. There must a
207 grouping for the assignment sign, including leading and trailing
208 whitespace.")
209
210
211 ;; If anybody can figure out how to get the same effect by configuring
212 ;; `align', I'd be glad to hear.
213 (defun conf-align-assignments (&optional arg)
214 (interactive "P")
215 (setq arg (if arg
216 (prefix-numeric-value arg)
217 conf-assignment-column))
218 (save-excursion
219 (goto-char (point-min))
220 (while (not (eobp))
221 (let ((cs (comment-beginning))) ; go before comment if within
222 (if cs (goto-char cs)))
223 (while (forward-comment 9)) ; max-int?
224 (when (and (not (eobp))
225 (looking-at conf-assignment-regexp))
226 (goto-char (match-beginning 1))
227 (delete-region (point) (match-end 1))
228 (if conf-assignment-sign
229 (if (>= arg 0)
230 (progn
231 (indent-to-column arg)
232 (or (not conf-assignment-space) (memq (char-before (point)) '(? ?\t)) (insert ? ))
233 (insert conf-assignment-sign (if (and conf-assignment-space (not (eolp))) ?\ "")))
234 (insert (if conf-assignment-space ?\ "") conf-assignment-sign)
235 (unless (eolp)
236 (indent-to-column (- arg))
237 (or (not conf-assignment-space) (memq (char-before (point)) '(? ?\t)) (insert ? ))))
238 (unless (eolp)
239 (if (>= (current-column) (abs arg))
240 (insert ? )
241 (indent-to-column (abs arg))))))
242 (forward-line))))
243
244
245 (defun conf-quote-normal (arg)
246 "Set the syntax of ' and \" to punctuation.
247 With prefix arg, only do it for ' if 1, or only for \" if 2.
248 This only affects the current buffer. Some conf files use quotes
249 to delimit strings, while others allow quotes as simple parts of
250 the assigned value. In those files font locking will be wrong,
251 and you can correct it with this command. (Some files even do
252 both, i.e. quotes delimit strings, except when they are
253 unbalanced, but hey...)"
254 (interactive "P")
255 (let ((table (copy-syntax-table (syntax-table))))
256 (if (or (not arg) (= (prefix-numeric-value arg) 1)) (modify-syntax-entry ?\' "." table))
257 (if (or (not arg) (= (prefix-numeric-value arg) 2)) (modify-syntax-entry ?\" "." table))
258 (set-syntax-table table)
259 (and (boundp 'font-lock-mode)
260 font-lock-mode
261 (font-lock-fontify-buffer))))
262
263
264 (defun conf-outline-level ()
265 (let ((depth 0)
266 (pt (match-end 0)))
267 (condition-case nil
268 (while (setq pt (scan-lists pt -1 1)
269 depth (1+ depth)))
270 (scan-error depth))))
271
272 \f
273
274 ;;;###autoload
275 (defun conf-mode (&optional comment syntax-table name)
276 "Mode for Unix and Windows Conf files and Java properties.
277 Most conf files know only three kinds of constructs: parameter
278 assignments optionally grouped into sections and comments. Yet
279 there is a great range of variation in the exact syntax of conf
280 files. See below for various wrapper commands that set up the
281 details for some of the most widespread variants.
282
283 This mode sets up font locking, outline, imenu and it provides
284 alignment support through `conf-align-assignments'. If strings
285 come out wrong, try `conf-quote-normal'.
286
287 Some files allow continuation lines, either with a backslash at
288 the end of line, or by indenting the next line (further). These
289 constructs cannot currently be recognized.
290
291 Because of this great variety of nuances, which are often not
292 even clearly specified, please don't expect it to get every file
293 quite right. Patches that clearly identify some special case,
294 without breaking the general ones, are welcome.
295
296 If instead you start this mode with the generic `conf-mode'
297 command, it will parse the buffer. It will generally well
298 identify the first four cases listed below. If the buffer
299 doesn't have enough contents to decide, this is identical to
300 `conf-windows-mode' on Windows, elsewhere to `conf-unix-mode'.
301 See also `conf-space-mode', `conf-colon-mode', `conf-javaprop-mode',
302 `conf-ppd-mode' and `conf-xdefaults-mode'.
303
304 \\{conf-mode-map}"
305
306 (interactive)
307 (if (not comment)
308 (let ((unix 0) (win 0) (equal 0) (colon 0) (space 0) (jp 0))
309 (save-excursion
310 (goto-char (point-min))
311 (while (not (eobp))
312 (skip-chars-forward " \t\f")
313 (cond ((eq (char-after) ?\#) (setq unix (1+ unix)))
314 ((eq (char-after) ?\;) (setq win (1+ win)))
315 ((eq (char-after) ?\[)) ; nop
316 ((eolp)) ; nop
317 ((eq (char-after) ?})) ; nop
318 ;; recognize at most double spaces within names
319 ((looking-at "[^ \t\n=:]+\\(?: ?[^ \t\n=:]+\\)*[ \t]*[=:]")
320 (if (eq (char-before (match-end 0)) ?=)
321 (setq equal (1+ equal))
322 (setq colon (1+ colon))))
323 ((looking-at "/[/*]") (setq jp (1+ jp)))
324 ((looking-at ".*{")) ; nop
325 ((setq space (1+ space))))
326 (forward-line)))
327 (if (> jp (max unix win 3))
328 (conf-javaprop-mode)
329 (if (> colon (max equal space))
330 (conf-colon-mode)
331 (if (> space (max equal colon))
332 (conf-space-mode)
333 (if (or (> win unix)
334 (and (= win unix) (eq system-type 'windows-nt)))
335 (conf-windows-mode)
336 (conf-unix-mode))))))
337 (kill-all-local-variables)
338 (use-local-map conf-mode-map)
339
340 (setq major-mode 'conf-mode
341 mode-name name)
342 (set (make-local-variable 'comment-start) comment)
343 (set (make-local-variable 'comment-start-skip)
344 (concat (regexp-quote comment-start) "+\\s *"))
345 (set (make-local-variable 'comment-use-syntax) t)
346 (set (make-local-variable 'parse-sexp-ignore-comments) t)
347 (set (make-local-variable 'outline-regexp)
348 "[ \t]*\\(?:\\[\\|.+[ \t\n]*{\\)")
349 (set (make-local-variable 'outline-heading-end-regexp)
350 "[\n}]")
351 (set (make-local-variable 'outline-level)
352 'conf-outline-level)
353 (set-syntax-table syntax-table)
354 (setq imenu-generic-expression
355 '(("Parameters" "^[ \t]*\\(.+?\\)[ \t]*=" 1)
356 ;; [section]
357 (nil "^[ \t]*\\[[ \t]*\\(.+\\)[ \t]*\\]" 1)
358 ;; section { ... }
359 (nil "^[ \t]*\\([^=:{} \t\n][^=:{}\n]+\\)[ \t\n]*{" 1)))
360
361 (run-mode-hooks 'conf-mode-hook)))
362
363 ;;;###autoload
364 (defun conf-unix-mode ()
365 "Conf Mode starter for Unix style Conf files.
366 Comments start with `#'.
367 For details see `conf-mode'. Example:
368
369 # Conf mode font-locks this right on Unix and with C-c C-u
370
371 \[Desktop Entry]
372 Encoding=UTF-8
373 Name=The GIMP
374 Name[ca]=El GIMP
375 Name[cs]=GIMP"
376 (interactive)
377 (conf-mode "#" conf-unix-mode-syntax-table "Conf[Unix]"))
378
379 ;;;###autoload
380 (defun conf-windows-mode ()
381 "Conf Mode starter for Windows style Conf files.
382 Comments start with `;'.
383 For details see `conf-mode'. Example:
384
385 ; Conf mode font-locks this right on Windows and with C-c C-w
386
387 \[ExtShellFolderViews]
388 Default={5984FFE0-28D4-11CF-AE66-08002B2E1262}
389 {5984FFE0-28D4-11CF-AE66-08002B2E1262}={5984FFE0-28D4-11CF-AE66-08002B2E1262}
390
391 \[{5984FFE0-28D4-11CF-AE66-08002B2E1262}]
392 PersistMoniker=file://Folder.htt"
393 (interactive)
394 (conf-mode ";" conf-mode-syntax-table "Conf[WinIni]"))
395
396 ;; Here are a few more or less widespread styles. There are others, so
397 ;; obscure, they are not covered. E.g. RFC 2614 allows both Unix and Windows
398 ;; comments. Or the donkey has (* Pascal comments *) -- roll your own starter
399 ;; if you need it.
400
401 ;;;###autoload
402 (defun conf-javaprop-mode ()
403 "Conf Mode starter for Java properties files.
404 Comments start with `#' but are also recognized with `//' or
405 between `/*' and `*/'.
406 For details see `conf-mode'. Example:
407
408 # Conf mode font-locks this right with C-c C-j (Java properties)
409 // another kind of comment
410 /* yet another */
411
412 name:value
413 name=value
414 name value
415 x.1 =
416 x.2.y.1.z.1 =
417 x.2.y.1.z.2.zz ="
418 (interactive)
419 (conf-mode "#" conf-javaprop-mode-syntax-table "Conf[JavaProp]")
420 (set (make-local-variable 'conf-assignment-column)
421 conf-javaprop-assignment-column)
422 (set (make-local-variable 'conf-assignment-regexp)
423 ".+?\\([ \t]*[=: \t][ \t]*\\|$\\)")
424 (set (make-local-variable 'conf-font-lock-keywords)
425 conf-javaprop-font-lock-keywords)
426 (setq comment-start-skip "\\(?:#+\\|/[/*]+\\)\\s *")
427 (setq imenu-generic-expression
428 '(("Parameters" "^[ \t]*\\(.+?\\)[=: \t]" 1))))
429
430 ;;;###autoload
431 (defun conf-space-mode (&optional keywords)
432 "Conf Mode starter for space separated conf files.
433 \"Assignments\" are with ` '. Keywords before the parameters are
434 recognized according to `conf-space-keywords'. Interactively
435 with a prefix ARG of `0' no keywords will be recognized. With
436 any other prefix arg you will be prompted for a regexp to match
437 the keywords. Programmatically you can pass such a regexp as
438 KEYWORDS, or any non-nil non-string for no keywords.
439
440 For details see `conf-mode'. Example:
441
442 # Conf mode font-locks this right with C-c C-s (space separated)
443
444 image/jpeg jpeg jpg jpe
445 image/png png
446 image/tiff tiff tif
447
448 # Or with keywords (from a recognized file name):
449 class desktop
450 # Standard multimedia devices
451 add /dev/audio desktop
452 add /dev/mixer desktop"
453 (interactive
454 (list (if current-prefix-arg
455 (if (> (prefix-numeric-value current-prefix-arg) 0)
456 (read-string "Regexp to match keywords: ")
457 t))))
458 (conf-unix-mode)
459 (setq mode-name "Conf[Space]")
460 (set (make-local-variable 'conf-assignment-sign)
461 nil)
462 (set (make-local-variable 'conf-font-lock-keywords)
463 conf-space-font-lock-keywords)
464 ;; This doesn't seem right, but the next two depend on conf-space-keywords
465 ;; being set, while after-change-major-mode-hook might set up imenu, needing
466 ;; the following result:
467 (hack-local-variables-prop-line)
468 (hack-local-variables)
469 (if keywords
470 (set (make-local-variable 'conf-space-keywords)
471 (if (stringp keywords) keywords))
472 (or conf-space-keywords
473 (not buffer-file-name)
474 (set (make-local-variable 'conf-space-keywords)
475 (assoc-default buffer-file-name conf-space-keywords-alist
476 'string-match))))
477 (set (make-local-variable 'conf-assignment-regexp)
478 (if conf-space-keywords
479 (concat "\\(?:" conf-space-keywords "\\)[ \t]+.+?\\([ \t]+\\|$\\)")
480 ".+?\\([ \t]+\\|$\\)"))
481 (setq imenu-generic-expression
482 `(,@(cdr imenu-generic-expression)
483 ("Parameters"
484 ,(if conf-space-keywords
485 (concat "^[ \t]*\\(?:" conf-space-keywords
486 "\\)[ \t]+\\([^ \t\n]+\\)\\(?:[ \t]\\|$\\)")
487 "^[ \t]*\\([^ \t\n[]+\\)\\(?:[ \t]\\|$\\)")
488 1))))
489
490 ;;;###autoload
491 (defun conf-colon-mode (&optional comment syntax-table name)
492 "Conf Mode starter for Colon files.
493 \"Assignments\" are with `:'.
494 For details see `conf-mode'. Example:
495
496 # Conf mode font-locks this right with C-c C-c (colon)
497
498 <Multi_key> <exclam> <exclam> : \"\\241\" exclamdown
499 <Multi_key> <c> <slash> : \"\\242\" cent"
500 (interactive)
501 (if comment
502 (conf-mode comment syntax-table name)
503 (conf-unix-mode)
504 (setq mode-name "Conf[Colon]"))
505 (set (make-local-variable 'conf-assignment-space)
506 conf-colon-assignment-space)
507 (set (make-local-variable 'conf-assignment-column)
508 conf-colon-assignment-column)
509 (set (make-local-variable 'conf-assignment-sign)
510 ?:)
511 (set (make-local-variable 'conf-assignment-regexp)
512 ".+?\\([ \t]*:[ \t]*\\)")
513 (set (make-local-variable 'conf-font-lock-keywords)
514 conf-colon-font-lock-keywords)
515 (setq imenu-generic-expression
516 `(("Parameters" "^[ \t]*\\(.+?\\)[ \t]*:" 1)
517 ,@(cdr imenu-generic-expression))))
518
519 ;;;###autoload
520 (defun conf-ppd-mode ()
521 "Conf Mode starter for Adobe/CUPS PPD files.
522 Comments start with `*%' and \"assignments\" are with `:'.
523 For details see `conf-mode'. Example:
524
525 *% Conf mode font-locks this right with C-c C-p (PPD)
526
527 *DefaultTransfer: Null
528 *Transfer Null.Inverse: \"{ 1 exch sub }\""
529 (interactive)
530 (conf-colon-mode "*%" conf-ppd-mode-syntax-table "Conf[PPD]")
531 ;; no sections, they match within PostScript code
532 (setq imenu-generic-expression (list (car imenu-generic-expression))))
533
534 ;;;###autoload
535 (defun conf-xdefaults-mode ()
536 "Conf Mode starter for Xdefaults files.
537 Comments start with `!' and \"assignments\" are with `:'.
538 For details see `conf-mode'. Example:
539
540 ! Conf mode font-locks this right with C-c C-x (.Xdefaults)
541
542 *background: gray99
543 *foreground: black"
544 (interactive)
545 (conf-colon-mode "!" conf-xdefaults-mode-syntax-table "Conf[Xdefaults]"))
546
547
548 ;; font lock support
549 (if (boundp 'font-lock-defaults-alist)
550 (add-to-list
551 'font-lock-defaults-alist
552 (cons 'conf-mode
553 (list 'conf-font-lock-keywords nil t nil nil))))
554
555
556 (provide 'conf-mode)
557
558 ;; arch-tag: 0a3805b2-0371-4d3a-8498-8897116b2356
559 ;;; conf-mode.el ends here