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: using libmagic in Emacs? Date: Thu, 20 Aug 2009 21:20:13 +0300 Message-ID: <83y6pegxeq.fsf@gnu.org> References: <87hbw35mar.fsf@uwakimon.sk.tsukuba.ac.jp> <83zl9vgovc.fsf@gnu.org> <87bpmb5bsq.fsf@uwakimon.sk.tsukuba.ac.jp> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1250793606 12225 80.91.229.12 (20 Aug 2009 18:40:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Aug 2009 18:40:06 +0000 (UTC) Cc: monnier@IRO.UMontreal.CA, joakim@verona.se, emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 20 20:39:58 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 1MeCYF-0004np-12 for ged-emacs-devel@m.gmane.org; Thu, 20 Aug 2009 20:39:55 +0200 Original-Received: from localhost ([127.0.0.1]:60221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeCYE-0006E5-DB for ged-emacs-devel@m.gmane.org; Thu, 20 Aug 2009 14:39:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeCHA-0004W5-1u for emacs-devel@gnu.org; Thu, 20 Aug 2009 14:22:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeCH8-0004TD-Oi for emacs-devel@gnu.org; Thu, 20 Aug 2009 14:22:15 -0400 Original-Received: from [199.232.76.173] (port=42235 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeCH8-0004Sq-Ey for emacs-devel@gnu.org; Thu, 20 Aug 2009 14:22:14 -0400 Original-Received: from mtaout5.012.net.il ([84.95.2.13]:62417) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MeCH8-0004u2-3E for emacs-devel@gnu.org; Thu, 20 Aug 2009 14:22:14 -0400 Original-Received: from conversion-daemon.i_mtaout5.012.net.il by i_mtaout5.012.net.il (HyperSendmail v2004.12) id <0KOO00G00TOCY100@i_mtaout5.012.net.il> for emacs-devel@gnu.org; Thu, 20 Aug 2009 21:22:12 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.180.85]) by i_mtaout5.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KOO0012HTOZALD0@i_mtaout5.012.net.il>; Thu, 20 Aug 2009 21:22:12 +0300 (IDT) In-reply-to: <87bpmb5bsq.fsf@uwakimon.sk.tsukuba.ac.jp> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 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:114452 > From: "Stephen J. Turnbull" > Cc: monnier@IRO.UMontreal.CA, > joakim@verona.se, > emacs-devel@gnu.org > Date: Thu, 20 Aug 2009 13:50:13 +0900 > > Eli Zaretskii writes: > > > > I think the main interface should be just "file-magic", even if it's > > > not in file.el. It's analogous to "file-attributes", etc. > > > > Actually, I think the interface should be `file-type' or some such. > > Seriously, "file-type" is a terrible, ambiguous name. DOS vs. Unix, > the extension of the file's name (!!), what program uses it, text > vs. binary, MIME type, endianness of the platform, Unicode vs. legacy > coding, copyleft vs. permissive vs. proprietary vs. public domain, I > could go on. Sure, it's about "files", but the "type" is what file(1) > infers from magic numbers in the file, no more and no less ... and > exactly the people you expect to say "huh?" will proceed to guess > anything but the truth about the semantics of `file-type'. Maybe so, but still "man file" shows this at the very first line: file - determine file type > I suppose the more explicit `file-type-by-magic' might be better. I'm okay with that as well, but maybe `file-type-by-magic-signature' is even better (if we indeed want to advertise its inner workings). But if this function will fall back on something else if libmagic is not available, then I think this name is not a good one.