From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Language identification Date: Fri, 28 Aug 2009 10:56:14 -0400 Message-ID: References: <87skfczqc8.fsf@mail.jurta.org> <87y6p45n4m.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251472336 18269 80.91.229.12 (28 Aug 2009 15:12:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Aug 2009 15:12:16 +0000 (UTC) Cc: Juri Linkov , joakim@verona.se, Emacs Development To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 28 17:12:08 2009 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 1Mh37X-0005wH-4F for ged-emacs-devel@m.gmane.org; Fri, 28 Aug 2009 17:12:07 +0200 Original-Received: from localhost ([127.0.0.1]:46426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mh37W-0003J0-DM for ged-emacs-devel@m.gmane.org; Fri, 28 Aug 2009 11:12:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mh2sH-0008Rw-Pa for emacs-devel@gnu.org; Fri, 28 Aug 2009 10:56:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mh2sC-0008Lw-WD for emacs-devel@gnu.org; Fri, 28 Aug 2009 10:56:21 -0400 Original-Received: from [199.232.76.173] (port=53388 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mh2sC-0008Lj-SW for emacs-devel@gnu.org; Fri, 28 Aug 2009 10:56:16 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:49129) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mh2sC-0006YR-EF for emacs-devel@gnu.org; Fri, 28 Aug 2009 10:56:16 -0400 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n7SEuEH7024702; Fri, 28 Aug 2009 10:56:14 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id A80B63A06F; Fri, 28 Aug 2009 10:56:14 -0400 (EDT) In-Reply-To: <87y6p45n4m.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Fri, 28 Aug 2009 18:00:25 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3350=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:114761 Archived-At: >> OTOH, how often do you see a file containg programming language code and >> yet without ny extension? > Extremely frequently. In what kind of circumstance? > The great majority that I see are correctly identified by file(1) (I > believe using libmagic), however, by parsing the shebang. Oh, so they're executables with a shebang. That's OK we don't need `file' for that since we have interpreter-mode-alist. Emacs should already DTRT for them. > There are also cases of multiple extensions, where I've seen (for > example) foo.c.inc used for C implementation code that is used in > multiple contexts (perhaps with different behavior according to > #ifdefs). This would not be recognized by typical Emacs extension > parsing since although it matches something like "\.c\>", it doesn't > match the more usual idioms of "\.c$" or "\.c\'". I've had (setq auto-mode-alist (append auto-mode-alist '(("\\.[^/.]+\\'" ignore t)))) in my .emacs for eons to cover such cases. Stefan