[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Language identification
From: |
Juri Linkov |
Subject: |
Re: Language identification |
Date: |
Sun, 30 Aug 2009 01:48:35 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) |
> > OTOH, how often do you see a file containg programming language code and
> > yet without ny extension?
>
> More often with a non-standard extension than without any extension.
>
> So why not rename the files, or put in -*- lines?
Often this is not possible when files are not under my control.
> Also there are conflicting extensions like e.g. ".pl" for both
> Perl and Prolog (esp. SWI-Prolog).
>
> Perhaps we should promote .plg for Prolog.
I'd rather prefer to promote changing the Perl file extension since
Prolog is older than Perl :) But I think neither is realistic.
Currently I use this hack in .emacs to distinguish between Perl and Prolog:
(add-hook 'find-file-hooks
(lambda ()
(when (and (looking-at "#") (string-match "Prolog" mode-name))
(perl-mode))))
since almost all Perl files begin with a comment, even library files
that have no shebangs.
But I agree such guessing is unreliable.
--
Juri Linkov
http://www.jurta.org/emacs/
- Re: Language identification, (continued)
- Re: Language identification, Chong Yidong, 2009/08/29
- 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
- Re: Language identification, Richard Stallman, 2009/08/29
- Re: Language identification,
Juri Linkov <=
- Re: Language identification, Richard Stallman, 2009/08/30
- Re: Language identification, David Kastrup, 2009/08/31
- Re: Language identification, Jan D., 2009/08/31
- Re: Language identification, Richard Stallman, 2009/08/30
Re: Language identification, Alex Ott, 2009/08/28
Re: Language identification, Alex Ott, 2009/08/28