unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Magic MIME
Date: Mon, 11 Feb 2008 22:59:38 +0200	[thread overview]
Message-ID: <87bq6ndx3p.fsf@jurta.org> (raw)
In-Reply-To: <uodaop1pi.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Feb 2008 06:16:25 +0200")

>> Are there any obstacles to using magic-mime to determine the file
>> type in Emacs?  If linking libmagic is not possible, then maybe
>> we could parse the magic.mime file, and even run the `file'
>> command directly on a visited file?
>
> Whatever the decision is, please avoid relying in external commands
> that are not available on all supported platforms.  `file' isn't.

Emacs could follow the principle of graceful degradation here: if there
is no necessary external command or mime database on the system, then
it will provide less reliable result that will be no worse than the
current without using the magic.mime based file type recognition.

> Emacs should be powerful enough to be able to visit files without
> requiring an external tool; if it needs to consult some database for
> that, it should be easy enough to include such a data base in the
> Emacs distribution, perhaps even in a form that is convenient for
> reading in Lisp.

This is one option  However, I'm not sure if licence conditions of the
mime-magic database allow including it to Emacs.

-- 
Juri Linkov
http://www.jurta.org/emacs/




  reply	other threads:[~2008-02-11 20:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10 23:18 Magic MIME Juri Linkov
2008-02-11  2:24 ` Stefan Monnier
2008-02-11 20:55   ` Juri Linkov
2008-02-12  3:25     ` Stefan Monnier
2008-02-11  4:16 ` Eli Zaretskii
2008-02-11 20:59   ` Juri Linkov [this message]
2008-02-11 21:41     ` Eli Zaretskii
2008-02-12  3:51     ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bq6ndx3p.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).