From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: Language identification Date: Fri, 28 Aug 2009 18:00:25 +0900 Message-ID: <87y6p45n4m.fsf@uwakimon.sk.tsukuba.ac.jp> References: <87skfczqc8.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251449515 11502 80.91.229.12 (28 Aug 2009 08:51:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Aug 2009 08:51:55 +0000 (UTC) Cc: Juri Linkov , joakim@verona.se, Emacs Development To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 28 10:51:47 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 1MgxBR-0005ta-AZ for ged-emacs-devel@m.gmane.org; Fri, 28 Aug 2009 10:51:45 +0200 Original-Received: from localhost ([127.0.0.1]:35049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgxBQ-0000Nk-M4 for ged-emacs-devel@m.gmane.org; Fri, 28 Aug 2009 04:51:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgxBK-0000Lw-76 for emacs-devel@gnu.org; Fri, 28 Aug 2009 04:51:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgxBE-0000HJ-1d for emacs-devel@gnu.org; Fri, 28 Aug 2009 04:51:37 -0400 Original-Received: from [199.232.76.173] (port=47332 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgxBD-0000Gd-Iz for emacs-devel@gnu.org; Fri, 28 Aug 2009 04:51:31 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]:36781) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgxBC-0002Do-Vv for emacs-devel@gnu.org; Fri, 28 Aug 2009 04:51:31 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id 10FE31535AE; Fri, 28 Aug 2009 17:51:29 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id A431F156F94; Fri, 28 Aug 2009 18:00:25 +0900 (JST) In-Reply-To: X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta29) "garbanzo" 891381effa11+ XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:114728 Archived-At: Stefan Monnier writes: > OTOH, how often do you see a file containg programming language code and > yet without ny extension? Extremely frequently. The great majority that I see are correctly identified by file(1) (I believe using libmagic), however, by parsing the shebang. 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\'".