For configuration files, the generic "conf-*" modes are OK, for
instance conf-javaprop-mode is quite reasonable.
But for zone files?
The built-in Emacs search engine (C-h a) returns the
following when I type "zone" as the search argument.
zone <menu-bar> <tools> <games> <zone>
Command: Zone out, completely.
zone-mode M-x zone-mode RET
Command: A mode for editing DNS zone files.
zone-mode-update-serial M-x zone-mode-update-serial RET
Command: Update the serial number in a zone.
zone-mode-update-serial-hook M-x zone-mode-update-serial-hook RET
Command: Update the serial number in a zone if the file was modified
I guess the first one is outside your scope.
I've used zone-mode implicitly for years, and supposed
"everyone knew". Emacs just does the "right thing"; I'm not
sure what heuristic it uses. Perhaps naming my files like
"ucd.ie.zone" is what triggers it. I really like the
automatic serial update: no extra reload because I've
forgotten, as used to happen when I used a different editor.
Have a good weekend.
/Niall
> The built-in Emacs search engine (C-h a) returns the
> following when I type "zone" as the search argument.
> zone-mode M-x zone-mode RET
> Command: A mode for editing DNS zone files.
Great, thanks.
> I've used zone-mode implicitly for years, and supposed
> "everyone knew". Emacs just does the "right thing"; I'm not
> sure what heuristic it uses.
I name my files just "example.org" and it apparently does not trigger
anything. Yes, ".zone" at the end seems the proper trick.
(setq auto-mode-alist (cons '("\\.org$" . zone-mode) auto-mode-alist))
- Kevin
> (setq auto-mode-alist (cons '("\\.org$" . zone-mode) auto-mode-alist))
Next step: since I do not manage only ".org" domains, write an Emacs
Lisp function which will download the list of TLD from IANA Web site
and add them to auto-mode-alist. Bonus: handle the case of Poland for
Perl scripts and Paraguay for Python scripts.
I think I'll rather change my naming rules :-)
> I name my files just "example.org" and it apparently does not trigger
> anything. Yes, ".zone" at the end seems the proper trick.
Or you can keep naming the files the way you like, and
put some magic words for Emacs in a comment.
; -*- mode: zone -*-
$ORIGIN example.org.
@ 86400 IN SOA dummy.example.org. hostmaster.example.org. (
2008092200
28800
14400
3600000
14400
)
; or whatever
[ And yes, I haven't thought about those timer values
in a long time. ]
/Niall