From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: dns mode
Date: Thu, 06 May 2010 16:43:00 -0600 [thread overview]
Message-ID: <hrvglc$fpt$1@dough.gmane.org> (raw)
In-Reply-To: <877ho0fs4x.fsf@sphinx.net.ru>
Dmitry Dzhus wrote:
> Nachiket Gokhale wrote:
>> It appears that I cannot save files with the extension "zone" e.g.
>> "foobar.zone" because emacs has loaded something called dns-mode by
>> default. How do I turn this thing off? What change do I have to make
>> to my .emacs.d/init.el file?
>
> Emacs associates file extensions and major modes by looking into
> `auto-mode-alist` variable, you can clean all `.zone`-matching entries
> from it if you don't want Emacs to turn on DNS mode when editing such files:
>
> (setq auto-mode-alist (delete '("\\.\\(soa\\|zone\\)\\'" . dns-mode) auto-mode-alist))
> (setq auto-mode-alist (delete '("\\.zone\\'" . zone-mode) auto-mode-alist))
Oddly enough, my emacs (22.3) -Q has 2 entries for dns-mode in auto-mode-alist:
("\\.soa\\'" . dns-mode)
("\\.\\(soa\\|zone\\)\\'" . dns-mode)
So I would do something like:
(let ((auto-dns))
(while (setq auto-dns (rassq 'dns-mode auto-mode-alist))
(setq auto-mode-alist (delq auto-dns auto-mode-alist))))
And similarly for zone-mode. This also has the advantage of working
regardless of the regexp used to match the file name.
> You may get more information by reading section 27.1 of GNU Emacs manual
> («How Major Modes are Chosen»).
--
Kevin Rodgers
Denver, Colorado, USA
next prev parent reply other threads:[~2010-05-06 22:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-21 18:33 dns mode Nachiket Gokhale
2010-04-21 20:49 ` Dmitry Dzhus
2010-05-06 22:43 ` Kevin Rodgers [this message]
[not found] ` <mailman.14.1273185801.9285.help-gnu-emacs@gnu.org>
2010-05-07 2:59 ` Stefan Monnier
2010-05-07 6:48 ` Reiner Steib
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='hrvglc$fpt$1@dough.gmane.org' \
--to=kevin.d.rodgers@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.