From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: C file recoginzed as image file Date: Mon, 08 Jan 2007 21:48:17 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1168285750 8242 80.91.229.12 (8 Jan 2007 19:49:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Jan 2007 19:49:10 +0000 (UTC) Cc: dooglus@gmail.com, rms@gnu.org, lekktu@gmail.com, c.a.rendle@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 08 20:49:07 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H40UI-0005ne-KR for ged-emacs-devel@m.gmane.org; Mon, 08 Jan 2007 20:48:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H40UI-0003Th-3K for ged-emacs-devel@m.gmane.org; Mon, 08 Jan 2007 14:48:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H40Tm-0003Fx-Bw for emacs-devel@gnu.org; Mon, 08 Jan 2007 14:48:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H40Tk-0003EO-H3 for emacs-devel@gnu.org; Mon, 08 Jan 2007 14:48:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H40Tk-0003EA-AB for emacs-devel@gnu.org; Mon, 08 Jan 2007 14:48:20 -0500 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H40Ti-0000Qc-Vw; Mon, 08 Jan 2007 14:48:19 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-23-29.inter.net.il [80.230.23.29]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id GTL93672 (AUTH halo1); Mon, 8 Jan 2007 21:48:13 +0200 (IST) Original-To: storm@cua.dk (Kim F. Storm) In-reply-to: (storm@cua.dk) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:65002 Archived-At: > From: storm@cua.dk (Kim F. Storm) > Date: Mon, 08 Jan 2007 16:25:47 +0100 > Cc: lekktu@gmail.com, c.a.rendle@gmail.com, rms@gnu.org, dooglus@gmail.com, > emacs-devel@gnu.org > > > > 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.