[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
conf-mode almost ready
From: |
Daniel Pfeiffer |
Subject: |
conf-mode almost ready |
Date: |
Sat, 6 Nov 2004 20:40:01 +0100 |
Hi,
Please find at the link below a mode that handles thousands of config files
fairly well. These are Windows .ini, .lst and .reg (all of which can also be
found on Unix), Java properties and a whole bunch of /etc/*, .cf, .cfg, .conf
etc. files on Unix.
On my PC (including a nearly unused Windows partition) I have found almost
2000 of these, with varying syntaxes for comments (;, #, //, /* */ or !),
assignment (var = value, var : value, var value or keyword var value) and
sections ([section] or section { }). All of this is handled by this mode.
I'd like to make this part of Emacs, so any feedback is welcome! To start it
up, use:
(autoload 'conf-mode "conf-mode" () t)
(autoload 'conf-unix-mode "conf-mode" () t)
(autoload 'conf-windows-mode "conf-mode" () t)
(autoload 'conf-javaprop-mode "conf-mode" () t)
(autoload 'conf-space-mode "conf-mode" () t)
(autoload 'conf-xdefaults-mode "conf-mode" () t)
(setq auto-mode-alist
`(,@auto-mode-alist
("\\.docbook\\'" . sgml-mode)
("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode)
;; Windows candidates may be opened case sensitively on Unix
("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" .
conf-mode)
("java.+\\.conf\\'" . conf-javaprop-mode)
("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode)
;; *.cf, *.cfg, *.conf, *.config[.local|.de_DE.UTF8|...], */config
("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" .
conf-mode)
("\\.desktop\\'" . conf-unix-mode)
("\\`/etc/\\(?:aliases\\|DIR_COLORS\\|ethers\\|.?fstab\\|gnokiirc\\|.*hosts\\
|ksysguarddrc\\|lesskey\\|login\\.defs\\|mtab\\|opera6rc\\|permissions\\|prot
|ocols\\|rpc\\|services\\)\\'" . conf-mode)
;; either user's dot-files or under /etc or some such
("/\\.?\\(?:kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-mode)
;; alas not all ~/.*rc files are like this
("/\\.\\(?:enigma\\|gltron\\|hxplayer\\|net\\|neverball\\|qt/.+\\|realplayer\
\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-mode)
("/\\.\\(?:gdbtkinit\\|grip\\|orbital/.+txt\\|rhosts\\|tuxracer/options\\)\\'"
. conf-mode)
("/\\.?X\\(?:default\\|resource\\|re\\)s\\>" . conf-xdefaults-mode)
("/X11.+app-defaults/" . conf-xdefaults-mode)
("/X11.+locale/.+/Compose\\'" . conf-colon-mode)
;; this contains everything twice, with space and with colon :-(
("/X11.+locale/compose\\.dir\\'" . conf-javaprop-mode)))
(setq magic-mode-alist
`(("# xmcd" . conf-unix-mode)
,@magic-mode-alist))
Get it here:
http://dapfy.bei.t-online.de/conf-mode.el
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
--
lerne / learn / apprends / lär dig / ucz się Esperanto:
http://lernu.net/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- conf-mode almost ready,
Daniel Pfeiffer <=