all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* dns mode
@ 2010-04-21 18:33 Nachiket Gokhale
  2010-04-21 20:49 ` Dmitry Dzhus
  2010-05-07  6:48 ` Reiner Steib
  0 siblings, 2 replies; 5+ messages in thread
From: Nachiket Gokhale @ 2010-04-21 18:33 UTC (permalink / raw)
  To: help-gnu-emacs

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?

Thanks a lot,

-Nachiket


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dns mode
  2010-04-21 18:33 dns mode Nachiket Gokhale
@ 2010-04-21 20:49 ` Dmitry Dzhus
  2010-05-06 22:43   ` Kevin Rodgers
       [not found]   ` <mailman.14.1273185801.9285.help-gnu-emacs@gnu.org>
  2010-05-07  6:48 ` Reiner Steib
  1 sibling, 2 replies; 5+ messages in thread
From: Dmitry Dzhus @ 2010-04-21 20:49 UTC (permalink / raw)
  To: help-gnu-emacs

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

You may get more information by reading section 27.1 of GNU Emacs manual
(«How Major Modes are Chosen»).
-- 
Happy Hacking.

http://sphinx.net.ru^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dns mode
  2010-04-21 20:49 ` Dmitry Dzhus
@ 2010-05-06 22:43   ` Kevin Rodgers
       [not found]   ` <mailman.14.1273185801.9285.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2010-05-06 22:43 UTC (permalink / raw)
  To: help-gnu-emacs

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dns mode
       [not found]   ` <mailman.14.1273185801.9285.help-gnu-emacs@gnu.org>
@ 2010-05-07  2:59     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2010-05-07  2:59 UTC (permalink / raw)
  To: help-gnu-emacs

> And similarly for zone-mode.  This also has the advantage of working
> regardless of the regexp used to match the file name.

A simpler solution is to not remove anything but add instead:

  (push '("\\.soa\\'" . my-mode) auto-mode-alist)

this will work regardless of the shape and number of entries in
auto-mode-alist.


        Stefan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dns mode
  2010-04-21 18:33 dns mode Nachiket Gokhale
  2010-04-21 20:49 ` Dmitry Dzhus
@ 2010-05-07  6:48 ` Reiner Steib
  1 sibling, 0 replies; 5+ messages in thread
From: Reiner Steib @ 2010-05-07  6:48 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, Apr 21 2010, 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?

Maybe it is a bug in dns-mode that there is no way to force a save?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-07  6:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21 18:33 dns mode Nachiket Gokhale
2010-04-21 20:49 ` Dmitry Dzhus
2010-05-06 22:43   ` Kevin Rodgers
     [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

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.