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: Language identification (was: using libmagic in Emacs) Date: Fri, 28 Aug 2009 03:27:35 +0300 Organization: JURTA Message-ID: <87skfczqc8.fsf@mail.jurta.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251423501 19563 80.91.229.12 (28 Aug 2009 01:38:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Aug 2009 01:38:21 +0000 (UTC) Cc: Emacs Development To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 28 03:38:13 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 1MgqPr-0001Ay-VA for ged-emacs-devel@m.gmane.org; Fri, 28 Aug 2009 03:38:12 +0200 Original-Received: from localhost ([127.0.0.1]:35755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgqPq-0006PV-Ue for ged-emacs-devel@m.gmane.org; Thu, 27 Aug 2009 21:38:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgqPl-0006P6-KA for emacs-devel@gnu.org; Thu, 27 Aug 2009 21:38:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgqPg-0006NG-Mr for emacs-devel@gnu.org; Thu, 27 Aug 2009 21:38:05 -0400 Original-Received: from [199.232.76.173] (port=33693 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgqPg-0006NA-KK for emacs-devel@gnu.org; Thu, 27 Aug 2009 21:38:00 -0400 Original-Received: from smtp-out1.starman.ee ([85.253.0.3]:55057 helo=mx1.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgqPg-00087Z-7q for emacs-devel@gnu.org; Thu, 27 Aug 2009 21:38:00 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.54.14.cable.starman.ee [82.131.54.14]) by mx1.starman.ee (Postfix) with ESMTP id DE66B3F4166; Fri, 28 Aug 2009 04:37:53 +0300 (EEST) In-Reply-To: (joakim@verona.se's message of "Tue, 18 Aug 2009 20:35:14 +0200") 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:114713 Archived-At: > I often wish that files would open in Emacs with correct mode > more often when there is no file extension. In `auto-mode-alist' you can see that with the exception of `archive-mode', `doc-view-mode' and `image-mode', all remaining modes are programming text modes. It would be more useful to identify file types for these modes that libmagic can't do. Do you know a library that identifies programming languages? Such a library might be implemented using a Bayesian classifier trained on a sufficiently large corpus of different programming languages. -- Juri Linkov http://www.jurta.org/emacs/