emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C file recoginzed as image file


From: Stefan Monnier
Subject: Re: C file recoginzed as image file
Date: Mon, 08 Jan 2007 17:34:12 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

>> > Basically, I think that determining the major mode for a given file should
>> > neither give precedence to auto-mode-alist nor magic-mode-alist.  Instead 
>> > it
>> > should consider both.  Each one can associate a file with a set of possible
>> > major modes (typically the set will be singleton) or say "don't know"
>> > (which would be basically the set of all major modes).
>> >
>> > E.g. auto-mode-alist would give "don't know" for a file named "/b/c/foo" 
>> > but
>> > would give the set { perl-mode, prolog-mode } for a file named
>> > "/b/c/foo.pl".  Then magic-mode-alist would give other sets of modes (based
>> > on things like the #! interpreter name, the -*- ... -*- cookie, etc...).
>> > If the intersection of the two sets is a singleton, then use that
>> > major-mode, otherwise query the user to decide whether to believe the file
>> > name or the contents.  After all, an inconsistently named file is generally
>> > a sign that there's something wrong, so it's good to prompt the user
>> > about it.
>> 
>> This is definitely the best proposal I've seen so far for solving this.

> But not something we should do before the release, IMO, however
> tempting it may be.

Obviously not.  OTOH if we agree that it's the direction in which we want to
go, than maybe it can give us some guidance as to which way to quickly solve
the immediate problem.


        Stefan




reply via email to

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