How to enable COBOL in Scite?

316 views
Skip to first unread message

Simon Sobisch

unread,
May 5, 2015, 3:25:01 AM5/5/15
to scite-i...@googlegroups.com
I did not found the documentation for this, what I've "thought" would do it didn't...

This is what I've done (checked with both current trunk and latest release):

1. open SciTEGlobal.properties
2. remove comment from COBOL|cob||\ (set for property default.languages)
3. restart SciTE

Result:
1. COBOL shows up in menu item Language
2. COBOL does NOT show as option in Open File dialogue (and therefore option "All Source" does not show COBOL files, too)
3. If I open a COBOL source file the clicking of COBOL menu item from Language menu does not do anything, it's always shown as plain text.

I assume I either did it wrong and/or the cobol.properties file is broken and/or the cobol lexer is broken.

Simon

Philippe Lhoste

unread,
May 5, 2015, 4:47:54 AM5/5/15
to scite-i...@googlegroups.com
1. Don't touch SciTEGlobal.properties
Otherwise, you will loose all your changes on next update of SciTE.
Instead, create a new file next to this one, named SciTEUser.properties, that will
override the properties of the main / default one.
You can copy properties from SciTEGlobal to SciTEUser, and adjust them here.

To support fully Cobol, you have to change the following properties (some of them might be
Windows-specific, not sure if it applies to you):

- source.files (or open.filter; there is some overlap in both, not sure why, perhaps only
history): allows to see it in the Open File dialogue.
- menu.language, or default.languages as you did: allows to see it in the Language menu.
- import.exclude: removes the items from the Options menu, but also blocks loading the
corresponding .properties file, resulting in a faster load (and a less crowded menu).

The last item is probably the culprit, as I see cobol in this list.
So, copy this list to your user file, remove cobol from it, perhaps add other languages
you don't need, and you should be good to go.

HTH.

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

Simon Sobisch

unread,
May 5, 2015, 9:47:08 AM5/5/15
to scite-i...@googlegroups.com
Thank you, I think this documentation helps others, too.

BTW: I was not able to use neither the delta nor the full changed file in SciTEUser.properties - the menu items and file open/save where unchanged. It only helped to change SciTEGlobal.properties to get the full COBOL experience.

I suggest to add the COBOL parts as comments for easier inclusion by the user.

around line 331 add
#*.cob;*.cbl;*.cpy;*.lst;\

around line 361 add
#$(filter.cobol)\


And correct cobol.properties as follows:

file.patterns.COBOL=*.cob;*.cbl;*.cpy;*.lst
filter.cobol=COBOL (cob, cbl, cpy, lst)|$(file.patterns.COBOL)|

Simon

John Yeung

unread,
May 5, 2015, 10:00:09 AM5/5/15
to scite-interest
On Tue, May 5, 2015 at 9:47 AM, Simon Sobisch <simons...@gmail.com> wrote:
> BTW: I was not able to use neither the delta nor the full
> changed file in SciTEUser.properties - the menu items
> and file open/save where unchanged.

Then you didn't put the user properties file in the right place.
Philippe said "next to" the global properties file, but either this
was "fuzzy" terminology, or he was referring to his own configuration,
which can be different than other installations.

Most Windows users will need their user properties in their Windows
user directory. See the documentation for a full description of how
SciTE determines where to find the user properties:

http://www.scintilla.org/SciTEDoc.html

Look for the section titled "Properties file".

You can open the user properties file using the menu option; then you
don't have to hunt around for it. If you're sure you've made the
right changes in the right place, then also make sure you've restarted
SciTE. I forget which options need it to be restarted and which take
effect immediately.

John Y.

Simon Sobisch

unread,
May 5, 2015, 10:16:28 AM5/5/15
to scite-i...@googlegroups.com
Placing the file in %USERPROFILE%\SciTEUser.properties worked like a charm, thank you!

Should I post the proposed changes

> I suggest to add the COBOL parts as comments for easier inclusion by the user.
>
> around line 331 add
> #*.cob;*.cbl;*.cpy;*.lst;\
>
> around line 361 add
> #$(filter.cobol)\
>
> And correct cobol.properties as follows:
>
> file.patterns.COBOL=*.cob;*.
> cbl;*.cpy;*.lst
> filter.cobol=COBOL (cob, cbl, cpy, lst)|$(file.patterns.COBOL)|

As a feature request via SourceForge or is it enough to post it here?

Simon

Philippe Lhoste

unread,
May 6, 2015, 10:33:16 AM5/6/15
to scite-i...@googlegroups.com
On 05/05/2015 16:00, John Yeung wrote:
> On Tue, May 5, 2015 at 9:47 AM, Simon Sobisch <simons...@gmail.com> wrote:
>> BTW: I was not able to use neither the delta nor the full
>> changed file in SciTEUser.properties - the menu items
>> and file open/save where unchanged.
>
> Then you didn't put the user properties file in the right place.
> Philippe said "next to" the global properties file, but either this
> was "fuzzy" terminology, or he was referring to his own configuration,
> which can be different than other installations.

Probably, I fear... I forget I have the SciTE_HOME environment variable set...

Neil Hodgson

unread,
May 11, 2015, 4:29:33 AM5/11/15
to scite-i...@googlegroups.com
Simon Sobisch:

> around line 331 add
> #*.cob;*.cbl;*.cpy;*.lst;\

As the comment says source.files can not be extended. This may no longer be a problem but someone needs to work out which versions of Windows work or fail with long settings and figure out what to do on failing versions if any are still supported by SciTE.

> around line 361 add
> #$(filter.cobol)\

OK, committed:
https://sourceforge.net/p/scintilla/scite/ci/62b318975dcb5e085d49872a038c291b5fdb5170/

> And correct cobol.properties as follows:
>
> file.patterns.COBOL=*.cob;*.cbl;*.cpy;*.lst

Many languages use *.lst for their listing files. Since these would clash, it is assigned to text.

Neil

Simon Sobisch

unread,
May 20, 2015, 8:36:04 AM5/20/15
to scite-i...@googlegroups.com, nyama...@me.com


Neil Hodgson:
Simon Sobisch:

> around line 331 add
> #*.cob;*.cbl;*.cpy;*.lst;\

   As the comment says source.files can not be extended. This may no longer be a problem but someone needs to work out which versions of Windows work or fail with long settings and figure out what to do on failing versions if any are still supported by SciTE.

Even if this would be interesting (and I don't know which versions of Windows are in question) I think it doesn't harm to add as suggested - as a comment. This simply helps people enabling a language "search for xyz and remove the #" if they want to (and have to because it isn't enabled by default [I did not recognize a huge difference in starting time when enabling everything which was placed as a comment])
 
> And correct cobol.properties as follows:
>
> file.patterns.COBOL=*.cob;*.cbl;*.cpy;*.lst

   Many languages use *.lst for their listing files. Since these would clash, it is assigned to text.

OK, then what about changing as follows:
file.patterns.COBOL=*.cob;*.cbl;*.cpy

Neil Hodgson

unread,
May 20, 2015, 6:56:00 PM5/20/15
to scite-i...@googlegroups.com
Simon Sobisch:

> Even if this would be interesting (and I don't know which versions of Windows are in question) I think it doesn't harm to add as suggested - as a comment. This simply helps people enabling a language "search for xyz and remove the #" if they want to (and have to because it isn't enabled by default [I did not recognize a huge difference in starting time when enabling everything which was placed as a comment])

You should not edit SciTEGlobal.properties. Changes should go in user options because changes to global options will disappear when SciTE is updated.

No one trying to get COBOL to work will find and understand this comment. If you want to explain COBOL-specific things then they should go in cobol.properties.

> OK, then what about changing as follows:
> file.patterns.COBOL=*.cob;*.cbl;*.cpy

OK.

Neil

Reply all
Reply to author
Forward
0 new messages