Some general comments about how I understand this stuff to work, a bit
long, perhaps, but to be sure we're all on the same starting line.
Also, due to being out of the office, I missed some of the earlier mails
and so will most likely repeat some things that have already been said.
My apolog
Lorenzo Bettini <[EMAIL PROTECTED]> writes:
[...]
> However, there are cases where this is not enough, since the script,
> although it has #!/bin/sh is actually written (and interpreted) in
> another language, e.g., Tcl.
>
> So my question is, is there another way of detecting the actual
> langua
Matej Cepl wrote:
Lorenzo Bettini wrote:
I was told that this was used to get around problems in older versions
of shells.
Wov! How old shell you have to have, which doesn't understand normal shebang
line?
don't ask me ;-)
I read this reply on a forum where I posted a similar request...
ch
Lorenzo Bettini wrote:
> I was told that this was used to get around problems in older versions
> of shells.
Wov! How old shell you have to have, which doesn't understand normal shebang
line?
Matěj
--
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC
http://www.ceplovi.cz/matej/blo
Maxim Vexler wrote:
(I'm thinking out loud here)
go ahead :-)
How about identifying patterns specific to each shell, and then
implementing an algorithm that would produce score for each shell
match. The one with the highest score will be the one used by
src-highlite. This perhaps should be a
Miles Bader wrote:
Matej Cepl <[EMAIL PROTECTED]> writes:
The mode name should appear in this line both preceded and followed by
`-*-'. Other text may appear on the line as well. For example,
;-*-Lisp-*-
Except that this is totally Emacs-specific and to the best of my knowledge
nobody o
Matej Cepl wrote:
Lorenzo Bettini wrote:
OK, so the line "exec ..." can be used as an heuristic for detecting the
actual scripting language, right?
I have no idea why they use this construct (something similar is used in
some perl scripts when they try to be cross-platform between Unix and
Win
Miles Bader wrote:
> Nonetheless, if such a cookie is present, it's a great thing to use for
> this purpose, as it's unambiguous.
Sure, but still I would begin with parsing shebang (with some additions --
like Tcl), and then I would see how many scripts are ambiguous.
Matěj
--
GPG Finger: 89EF
Matej Cepl <[EMAIL PROTECTED]> writes:
>> The mode name should appear in this line both preceded and followed by
>> `-*-'. Other text may appear on the line as well. For example,
>>
>> ;-*-Lisp-*-
>
> Except that this is totally Emacs-specific and to the best of my knowledge
> nobody outsid
On 9/1/06, Lorenzo Bettini <[EMAIL PROTECTED]> wrote:
Ron Johnson wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Lorenzo Bettini wrote:
>> Hi
>>
>> I need to detect the actual programming language of a script.
>>
>> A way of detecting it is to examine the first line searching for th
Jörg-Volker Peetz wrote:
>> I need to detect the language of the script in order to highlight it
>> accordingly (GNU source-highlight
>> http://www.gnu.org/software/src-highlite)
>>
> See Emacs manual "How Major Modes are Chosen". It says
>
>You can specify which major mode should be used for
Lorenzo Bettini wrote:
> OK, so the line "exec ..." can be used as an heuristic for detecting the
> actual scripting language, right?
I have no idea why they use this construct (something similar is used in
some perl scripts when they try to be cross-platform between Unix and
Windows, which appare
Matej Cepl wrote:
Ron Johnson wrote:
IOW, "wish" is a Tcl script?
wish is Tcl runtime (the same as /usr/bin/perl for Perl programs).
OK, so the line "exec ..." can be used as an heuristic for detecting the
actual scripting language, right?
--
+--
Ron Johnson wrote:
> IOW, "wish" is a Tcl script?
wish is Tcl runtime (the same as /usr/bin/perl for Perl programs).
Matěj
--
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC
http://www.ceplovi.cz/matej/blog/, Jabber: [EMAIL PROTECTED]
23 Marion St. #3, (617) 876-1259, ICQ 1328222
Lorenzo Bettini wrote:
> I need to detect the language of the script in order to highlight it
> accordingly (GNU source-highlight http://www.gnu.org/software/src-highlite)
>
See Emacs manual "How Major Modes are Chosen". It says
You can specify which major mode should be used for editing a cer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Lorenzo Bettini wrote:
> Ron Johnson wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Lorenzo Bettini wrote:
>>> Hi
>>>
>>> I need to detect the actual programming language of a script.
>>>
>>> A way of detecting it is to examine the fi
Ron Johnson wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Lorenzo Bettini wrote:
Hi
I need to detect the actual programming language of a script.
A way of detecting it is to examine the first line searching for the
"sha-bang" (#!), e.g.,
#!/bin/bash
or
#!/usr/bin/perl
However, ther
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Lorenzo Bettini wrote:
> Hi
>
> I need to detect the actual programming language of a script.
>
> A way of detecting it is to examine the first line searching for the
> "sha-bang" (#!), e.g.,
>
> #!/bin/bash
>
> or
>
> #!/usr/bin/perl
>
> However
Hi
I need to detect the actual programming language of a script.
A way of detecting it is to examine the first line searching for the
"sha-bang" (#!), e.g.,
#!/bin/bash
or
#!/usr/bin/perl
However, there are cases where this is not enough, since the script,
although it has #!/bin/sh is act
19 matches
Mail list logo