From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Language identification Date: Sun, 30 Aug 2009 01:48:35 +0300 Organization: JURTA Message-ID: <87k50mw83c.fsf@mail.jurta.org> References: <87skfczqc8.fsf@mail.jurta.org> <877hwnoi8d.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 1251586602 31160 80.91.229.12 (29 Aug 2009 22:56:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Aug 2009 22:56:42 +0000 (UTC) Cc: monnier@iro.umontreal.ca, joakim@verona.se, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 30 00:56:34 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 1MhWqX-0007h7-VD for ged-emacs-devel@m.gmane.org; Sun, 30 Aug 2009 00:56:34 +0200 Original-Received: from localhost ([127.0.0.1]:47325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhWqX-0001Bc-EB for ged-emacs-devel@m.gmane.org; Sat, 29 Aug 2009 18:56:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MhWnl-0006In-Bt for emacs-devel@gnu.org; Sat, 29 Aug 2009 18:53:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MhWng-0006Cd-D8 for emacs-devel@gnu.org; Sat, 29 Aug 2009 18:53:40 -0400 Original-Received: from [199.232.76.173] (port=55157 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhWng-0006CV-B2 for emacs-devel@gnu.org; Sat, 29 Aug 2009 18:53:36 -0400 Original-Received: from smtp-out1.starman.ee ([85.253.0.3]:57705 helo=mx1.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MhWnc-00032K-Kg; Sat, 29 Aug 2009 18:53:32 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.52.53.cable.starman.ee [82.131.52.53]) by mx1.starman.ee (Postfix) with ESMTP id 61B223F41D9; Sun, 30 Aug 2009 01:53:26 +0300 (EEST) In-Reply-To: (Richard Stallman's message of "Sat, 29 Aug 2009 16:20:39 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) 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:114857 Archived-At: > > OTOH, how often do you see a file containg programming language code and > > yet without ny extension? > > More often with a non-standard extension than without any extension. > > So why not rename the files, or put in -*- lines? Often this is not possible when files are not under my control. > Also there are conflicting extensions like e.g. ".pl" for both > Perl and Prolog (esp. SWI-Prolog). > > Perhaps we should promote .plg for Prolog. I'd rather prefer to promote changing the Perl file extension since Prolog is older than Perl :) But I think neither is realistic. Currently I use this hack in .emacs to distinguish between Perl and Prolog: (add-hook 'find-file-hooks (lambda () (when (and (looking-at "#") (string-match "Prolog" mode-name)) (perl-mode)))) since almost all Perl files begin with a comment, even library files that have no shebangs. But I agree such guessing is unreliable. -- Juri Linkov http://www.jurta.org/emacs/