[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


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
        ("\\.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]\\)\\'" .
        ("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._-]+\\)?\\'" . 
        ("\\.desktop\\'" . conf-unix-mode)

|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

\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-mode)

. 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)

Get it here:

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

lerne / learn / apprends / lär dig / ucz się    Esperanto:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]