[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Language identification
From: |
Stefan Monnier |
Subject: |
Re: Language identification |
Date: |
Fri, 28 Aug 2009 10:56:14 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
>> OTOH, how often do you see a file containg programming language code and
>> yet without ny extension?
> Extremely frequently.
In what kind of circumstance?
> The great majority that I see are correctly identified by file(1) (I
> believe using libmagic), however, by parsing the shebang.
Oh, so they're executables with a shebang. That's OK we don't need
`file' for that since we have interpreter-mode-alist. Emacs should
already DTRT for them.
> There are also cases of multiple extensions, where I've seen (for
> example) foo.c.inc used for C implementation code that is used in
> multiple contexts (perhaps with different behavior according to
> #ifdefs). This would not be recognized by typical Emacs extension
> parsing since although it matches something like "\.c\>", it doesn't
> match the more usual idioms of "\.c$" or "\.c\'".
I've had
(setq auto-mode-alist (append auto-mode-alist '(("\\.[^/.]+\\'" ignore t))))
in my .emacs for eons to cover such cases.
Stefan
- Re: using libmagic in Emacs?, (continued)
- Re: using libmagic in Emacs?, Eli Zaretskii, 2009/08/22
- Re: using libmagic in Emacs?, Stefan Monnier, 2009/08/21
- 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
Re: Language identification, Richard Stallman, 2009/08/28
Re: Language identification, Stephen J. Turnbull, 2009/08/29
Re: Language identification, Stefan Monnier, 2009/08/29
Re: Language identification, Stephen J. Turnbull, 2009/08/29
Re: Language identification, Richard Stallman, 2009/08/30
Re: Language identification, Juri Linkov, 2009/08/28
Re: Language identification, Stefan Monnier, 2009/08/28
Re: Language identification, Richard Stallman, 2009/08/30