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