andy
Freshman Member
Posts: 17
|
Post by andy on Aug 4, 2023 9:38:09 GMT -5
Hi
I did some housekeeping on my machine a couple of days ago and deleted my SPFLite folder. I have restored it from a backup, but must have messed it up along the way.
I work mainly with cbl files, I have a cbl.auto file, but the files display with no colour.
The profile is DEFAULT, but it has always been that way. If I open a new file type, I associate it with DEFAULT. Perhaps I shouldn't...
If I open a sh file, it displays in colour, and it opens with the SH profile.
I'm guessing that there is a link between the DEFAULT profile and the file type that is broken. How do I get it back? I'm happy to associate the cbl file type with the CBL profile if that makes it any easier.
Thanks
Andy
|
|
|
Post by Robert on Aug 4, 2023 10:11:23 GMT -5
Hi Andy,
These are all "freshman" questions, so don't feel bad. I'll try to answer as best I can.
1. If you are editing COBOL, with a CBL file type, and you are doing colorization, then the correct way to handle it is to create a Profile named CBL. Just having a CBL.AUTO is not enough. You need a profile to connect your file type to the AUTO name.
2. I am not familiar with a SH file type. What is it? If you have some kind of 'default' colorization, maybe you are applying the same colorizing rules to every file. That would be unusual.
3. I believe there is an AUTO file that comes with the SPFLite installation that is just for Cobol. That is a good place to start. Of course, there are many Cobol variants, so if you're not getting all of your keywords highlighted, you can edit the AUTO file to add them.
4. If you are editing a CBL file, and you have the CBL profile set up, then you can issue the AUTO primary command. What that does is it determines where the AUTO file is for the file you're currently editing, and it will open up a new edit tab for that AUTO file. This is a new feature and it makes it real easy to update the AUTO file without having to figure out where it is.
5. Finally, DEFAULT is just that - the default for editing files that have no other profile. It is NOT intended as a general profile for everything you edit. The closest I come to that is a TXT profile, since many of my files are plain text. Don't pile everything into Default. Cobol files have very specific characteristics, and should have their own dedicated profile for it.
Robert
|
|
andy
Freshman Member
Posts: 17
|
Post by andy on Aug 7, 2023 2:26:41 GMT -5
Hi Robert
Thanks for the reply. I've been using SPFLite for about 6 years, but obviously not using profiles correctly!
SH is a Linux shell script.
Yes there is a 'cobol' colorize file. If I change the file type to 'cobol' it all works fine. BTW, SPFLite tells me there are several keywords in the cobol.auto file that are duplicated.
I'm on 2.7.22344 which doesn't recognise the AUTO command. My PC is locked down so I try to limit updates to when they are really needed - this might be one such time. Is there another way of associating a file type with a profile?
Andy
|
|
|
Post by George on Aug 7, 2023 3:25:41 GMT -5
Andy: AUTO is not a command, I think it's an Oops by Robert. Your version is getting on, but there will be a new release soon (when I get back from vacation), so I'd wait for that to come out and 'settle' down. rge Geo
|
|
andy
Freshman Member
Posts: 17
|
Post by andy on Aug 7, 2023 6:03:46 GMT -5
Thanks George
How do I associate a file type with another profile? In this case changing the cbl file type from the DEFAULT profile to CBL.
Andy
|
|
andy
Freshman Member
Posts: 17
|
Post by andy on Aug 7, 2023 6:13:08 GMT -5
Got it!
OPTIONS, General tab, at the bottom. Cleared out the junk in 'file type to use the DEFAULT profile', apart from a DUMMY entry (just in case), and I'm back with a colourized file.
|
|
|
Post by Robert on Aug 7, 2023 11:54:58 GMT -5
Well, what I wrote was a "semi-oops". AUTO is actually a macro. I think of it as a command, and I forgot that George wrote it for me, with a couple of my own tweaks (I think). Here it is:
' AUTO.MACRO ' This macro will open the .AUTO file being used in the current session. ' IF Is_FM THEN Halt(0, "AUTO command must be issued from an Edit session") USES "File" DIM ProfName AS STRING value Get_Profile$("NAME") DIM PathName AS STRING value Get_INI_Path$ DIM FileName AS STRING value Pathname + "AUTO\" + ProfName + ".AUTO" DIM FileID AS LONG value 0 '----- If AUTO file doesn't exist, create an empty one IF File_Exists(FileName) = 0 THEN FileID = File_Open(FileName, "OUTPUT") File_Close(FileID) END IF '----- Open an existing AUTO file SPF_Post_Do("EDIT " + $DQ + FileName + $DQ) halt(0)
Copy this into your macro directory with the name AUTO.MACRO Then give it a try, it works like a champ.
R
|
|