Allow language tools by changing language synthax

76 views
Skip to first unread message

zetah

unread,
Apr 1, 2012, 4:22:33 PM4/1/12
to scite-i...@googlegroups.com
I like to suggest that in case user selects language syntax from Language menu, then allow using tools defined in that language properties files automatically

If for some reason this is not accepted then please consider further this:

I have opened file without extension which is recognised by shebang, and yet don't have access to any tool defined in that language properties file, so if I want to use specific tools, I have to rename the file

Neil Hodgson

unread,
Apr 1, 2012, 5:12:54 PM4/1/12
to scite-i...@googlegroups.com
zetah:

> I like to suggest that in case user selects language syntax from Language
> menu, then allow using tools defined in that language properties files
> automatically

There is no direct relationship between language modes and
particular properties files. Perhaps you could explain exactly what
you want.

Neil

klo uo

unread,
Apr 1, 2012, 7:48:22 PM4/1/12
to scite-i...@googlegroups.com
For example:

If I open a file and from Languages menu I select vbscript, then show tools specific to vbs properties:

command.go.$(file.patterns.vbscript)=cscript.exe //nologo "$(FilePath)"
command.help.$(file.patterns.vbscript)=$(CurrentWord)!D:\Help\script56.chm
command.10.$(file.patterns.vbscript)=wscript.exe "$(FilePath)"

if I select html, then allow html tools:

command.go.$(file.patterns.html)="file://$(FilePath)"
command.help.$(file.patterns.html)=$(CurrentWord)!C:\Program Files\Microsoft Office\Office10\1033\HTMLREF.CHM
command.10.$(file.patterns. html)=tidy -mi -utf8 "$(FilePath)"

if I select instead xml, allow xml tools:

command.go.$(file.patterns.xml)=xmlnotepad "$(FilePath)"
command.10.$(file.patterns. xml)=tidy -mi -xml -utf8 "$(FilePath)"

and similar.

klo uo

unread,
Apr 1, 2012, 8:28:40 PM4/1/12
to scite-i...@googlegroups.com
But there can be multiple file pattern definition per lexer, while there is no option to define command for specific lexer...

Then how can I define command property for file recognised by shebang?

Neil Hodgson

unread,
Apr 3, 2012, 8:38:46 AM4/3/12
to scite-i...@googlegroups.com
klo uo:

> Then how can I define command property for file recognised by shebang?

Commands are defined for file patterns so you can define a file
pattern that matches your file name. Since '*' matches everything, you
can use a default command like
command.4.*=python $(FileNameExt)

Neil

klo uo

unread,
Apr 3, 2012, 10:41:23 AM4/3/12
to scite-i...@googlegroups.com
Yes, but if I define:

command.4.*=ruby...

in ruby.properties, then:

command.4.*=perl...

in perl.properties, or:

command.4.*=python...

in python.properties, I'll get in either case "perl..."



  Neil

--
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To post to this group, send email to scite-i...@googlegroups.com.
To unsubscribe from this group, send email to scite-interes...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scite-interest?hl=en.


Neil Hodgson

unread,
Apr 3, 2012, 4:55:12 PM4/3/12
to scite-i...@googlegroups.com
klo uo:

> Yes, but if I define:
>
> command.4.*=ruby...
>
> in ruby.properties, then:
>
> command.4.*=perl...
>
> in perl.properties, or:

You should think of the multiple properties files as if they are
all contained inside the global properties file. The division into
multiple files is to make it easier to find settings and add and
remove languages.

You should never change these files: put your settings into user properties.

Neil

zetah

unread,
Apr 4, 2012, 6:08:17 AM4/4/12
to scite-i...@googlegroups.com
Well, I was commenting your suggestion on using "command.#.*" for shebang issue. If I define command for * it will be present for all files, while shebang property can be applied for various lexers, and if will be messy if try to make such commands globally available.
So even if file is recognised by shebang, I can't run it, of use help file on it, or commands (as reported)... its just highlighted.

Maybe if "file.patterns" would somehow accept reference to files recognised by particular shebangs, we could cover them with $(file.patterns.xxx) like we do file extensions

Neil Hodgson

unread,
Apr 5, 2012, 3:15:28 AM4/5/12
to scite-i...@googlegroups.com
zetah:

> Maybe if "file.patterns" would somehow accept reference to files recognised
> by particular shebangs, we could cover them with $(file.patterns.xxx) like
> we do file extensions

If anyone is interested in working on this, I'll accept a good
patch. Since I use file extensions, its not a problem for me so I
won't be working on it myself.

Neil

Reply all
Reply to author
Forward
0 new messages