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: Sun, 23 Aug 2009 06:24:16 +0300 Message-ID: <83eir3fc0v.fsf@gnu.org> References: <83k50xh1m8.fsf@gnu.org> <837hwxgg9w.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1250997873 23144 80.91.229.12 (23 Aug 2009 03:24:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Aug 2009 03:24:33 +0000 (UTC) Cc: schwab@linux-m68k.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 23 05:24:25 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 1Mf3gv-0001cg-1G for ged-emacs-devel@m.gmane.org; Sun, 23 Aug 2009 05:24:25 +0200 Original-Received: from localhost ([127.0.0.1]:59602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mf3gt-0001tz-T6 for ged-emacs-devel@m.gmane.org; Sat, 22 Aug 2009 23:24:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mf3gp-0001su-IO for emacs-devel@gnu.org; Sat, 22 Aug 2009 23:24:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mf3gp-0001sE-2n for emacs-devel@gnu.org; Sat, 22 Aug 2009 23:24:19 -0400 Original-Received: from [199.232.76.173] (port=45649 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mf3go-0001s9-Ts for emacs-devel@gnu.org; Sat, 22 Aug 2009 23:24:18 -0400 Original-Received: from mtaout6.012.net.il ([84.95.2.16]:19170) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mf3go-0007R7-Hs for emacs-devel@gnu.org; Sat, 22 Aug 2009 23:24:18 -0400 Original-Received: from conversion-daemon.i-mtaout6.012.net.il by i-mtaout6.012.net.il (HyperSendmail v2007.08) id <0KOT004007IU0B00@i-mtaout6.012.net.il> for emacs-devel@gnu.org; Sun, 23 Aug 2009 06:24:17 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.180.85]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KOT00D6X84G4UA0@i-mtaout6.012.net.il>; Sun, 23 Aug 2009 06:24:17 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (1203?) 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:114526 Archived-At: > From: joakim@verona.se > Cc: Eli Zaretskii , monnier@iro.umontreal.ca, > emacs-devel@gnu.org > Date: Sat, 22 Aug 2009 22:18:26 +0200 > > + magic_setflags (cookie, MAGIC_MIME_TYPE | MAGIC_ERROR); > + rvs = magic_file (cookie, f); > + if (rvs == NULL) goto libmagic_error; > + file_mime = intern (rvs); > + > + magic_setflags (cookie, MAGIC_MIME_ENCODING | MAGIC_ERROR); > + rvs=magic_file (cookie, f); > + if (rvs == NULL) goto libmagic_error; > + file_encoding = build_string(rvs); Since you are returning strings for MIME type and MIME encoding, not symbols, I suggest to state that in the doc string. Normally, when we say "SOMETHING is an encoding", we mean it's a symbol. Alternatively, use MIME-ENCODING-NAME etc., to indicate that it's just a name of the thing, not the thing itself.