[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using libmagic in Emacs?
From: |
Stefan Monnier |
Subject: |
Re: using libmagic in Emacs? |
Date: |
Fri, 21 Aug 2009 15:18:33 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
>> + magic_setflags (cookie, MAGIC_MIME_ENCODING | MAGIC_ERROR);
>> + rvs=magic_file (cookie, f);
>> + if (rvs == NULL) goto libmagic_error;
>> + Lisp_Object file_encoding = intern(rvs);
> Is file_encoding supposed to be a valid encoding, one of those for
> which Emacs has a coding-system? If so, perhaps you should make sure
> you indeed return a valid coding-system or its alias, or otherwise
> tell in the doc string that it's not guaranteed to be valid (so that
> the caller should validate it before using).
The simplest route is to return a string rather than a symbol.
That should clearly convey the idea that this may or may not be a valid
coding-system.
Stefan
- RE: using libmagic in Emacs?, (continued)
- RE: using libmagic in Emacs?, Drew Adams, 2009/08/21
- Re: using libmagic in Emacs?, Eli Zaretskii, 2009/08/21
- Re: using libmagic in Emacs?, joakim, 2009/08/21
- Re: using libmagic in Emacs?, Andreas Schwab, 2009/08/21
- Re: using libmagic in Emacs?, joakim, 2009/08/22
- Re: using libmagic in Emacs?, Ken Raeburn, 2009/08/22
- Re: using libmagic in Emacs?, joakim, 2009/08/23
- Re: using libmagic in Emacs?, Eli Zaretskii, 2009/08/23
- Re: using libmagic in Emacs?, joakim, 2009/08/24
- Re: using libmagic in Emacs?, Eli Zaretskii, 2009/08/22
- Re: using libmagic in Emacs?,
Stefan Monnier <=
- Re: using libmagic in Emacs?, Andreas Schwab, 2009/08/21
- Re: using libmagic in Emacs?, Richard Stallman, 2009/08/20
- Re: using libmagic in Emacs?, Reiner Steib, 2009/08/20
- Re: using libmagic in Emacs?, Richard Stallman, 2009/08/21
- Re: using libmagic in Emacs?, Stefan Monnier, 2009/08/21
Language identification (was: using libmagic in Emacs), Juri Linkov, 2009/08/27