I would like to have Geany recognize my scripts written in Tcl/Expect, to do syntax highlighting according to the Tcl syntax rules.
These scripts all start in my case with
#!/usr/bin/expect -f
and have no file extension. I thought it would be sufficient to copy filetypes.tcl to filetypes.expect, but even then, after creating and saving the new file, Geany doesn't do syntax coloring. It works of course if I manually set the file type to Tcl, but it would be great if Geany could detect this automatically.
According to the documentation, Geany does inspect the #! line as a fallback when determining the file type, so I guess it just doesn't know that 'expect' is just a special case of Tcl. I didn't find however, where I can define such an association.
Ronald
On 13 April 2012 22:59, Fischer, RonaldX O ronaldx.o.fischer@intel.com wrote:
I would like to have Geany recognize my scripts written in Tcl/Expect, to do syntax highlighting according to the Tcl syntax rules.
These scripts all start in my case with
#!/usr/bin/expect -f
and have no file extension. I thought it would be sufficient to copy filetypes.tcl to filetypes.expect, but even then, after creating and saving the new file, Geany doesn't do syntax coloring. It works of course if I manually set the file type to Tcl, but it would be great if Geany could detect this automatically.
According to the documentation, Geany does inspect the #! line as a fallback when determining the file type, so I guess it just doesn't know that 'expect' is just a special case of Tcl. I didn't find however, where I can define such an association.
The #! line associations are hard coded unfortunately, but another way is to explicitly mark the file as Tcl so it will be recognised by the extract filetype regex.
The default regex looks for -*-Tcl-*- on the first two lines, so putting that in a comment on line two should do the trick.
Cheers Lex
Ronald
Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On 13 April 2012 22:59, Fischer, RonaldX O ronaldx.o.fischer@intel.com wrote:
I would like to have Geany recognize my scripts written in Tcl/Expect,
to do
syntax highlighting according to the Tcl syntax rules.
These scripts all start in my case with
#!/usr/bin/expect -f
and have no file extension.
The #! line associations are hard coded unfortunately, but another way is to explicitly mark the file as Tcl so it will be recognised by the extract filetype regex.
The default regex looks for -*-Tcl-*- on the first two lines, so putting that in a comment on line two should do the trick.
Unfortunately, this did not work. Here is how I tried:
(1) I created a new file (File/New)
(2) I wrote the following two lines:
#!/usr/bin/expect -f # -*-Tcl-*- (for Geany)
(3) I saved the file (filename: dummy1 (no extension)).
Still, Geany shows the filetype as "None".
Ronald
On 16 April 2012 18:43, Fischer, RonaldX O ronaldx.o.fischer@intel.com wrote:
On 13 April 2012 22:59, Fischer, RonaldX O ronaldx.o.fischer@intel.com wrote:
I would like to have Geany recognize my scripts written in Tcl/Expect,
to do
syntax highlighting according to the Tcl syntax rules.
These scripts all start in my case with
#!/usr/bin/expect -f
and have no file extension.
The #! line associations are hard coded unfortunately, but another way is to explicitly mark the file as Tcl so it will be recognised by the extract filetype regex.
The default regex looks for -*-Tcl-*- on the first two lines, so putting that in a comment on line two should do the trick.
Unfortunately, this did not work. Here is how I tried:
(1) I created a new file (File/New)
(2) I wrote the following two lines:
#!/usr/bin/expect -f # -*-Tcl-*- (for Geany)
(3) I saved the file (filename: dummy1 (no extension)).
Still, Geany shows the filetype as "None".
Works for me, so the usual questions you didn't answer.
(Version of Geany and platform)
Cheers Lex
Ronald
Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany
(1) I created a new file (File/New)
(2) I wrote the following two lines:
#!/usr/bin/expect -f # -*-Tcl-*- (for Geany)
(3) I saved the file (filename: dummy1 (no extension)).
Still, Geany shows the filetype as "None".
Works for me, so the usual questions you didn't answer.
(Version of Geany and platform)
You're right - here they are:
Geany 0.21 Windows 7 (64Bit)
Ronald
On 16 April 2012 19:23, Fischer, RonaldX O ronaldx.o.fischer@intel.com wrote:
(1) I created a new file (File/New)
(2) I wrote the following two lines:
#!/usr/bin/expect -f # -*-Tcl-*- (for Geany)
(3) I saved the file (filename: dummy1 (no extension)).
Still, Geany shows the filetype as "None".
Works for me, so the usual questions you didn't answer.
(Version of Geany and platform)
You're right - here they are:
Geany 0.21 Windows 7 (64Bit)
Ah, its been added since then, you could try one of the nightly builds or build yourself.
Cheers Lex
Ronald
Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany