|
Post by Stefan on Dec 23, 2023 10:40:22 GMT -5
Robert,
You're the undisputed expert... I'm losing my marbles trying to get this simple aspect to work (and I haven't even partaken in excessive Christmas cheer yet!!)
I have a folder called C:\$User\WinSetView\AppData In this folder there are files called Win7.ini, Win8.ini, Win10.ini which I wish to edit with a profile called INI_WSV
Based on my existing EFT entries, I figured this EFT entry should achieve it: \WinSetView\APPDATA\*.INI = INI_WSV
At first, I didn't have a profile called INI_WSV. Dragging file Win10.ini from File Explorer to SPFlite gave me an empty file!
No prompt, no complaint from SPFLite about a non-existing profile name. Just an empty file. Weird! EFT clearly did "something", or the file would have been opened using the existing INI profile. But why an empty file?
So I added a profile called INI_WSV, based on the INI profile I already had.
Loading the file Win10.ini now shows me the data I expected to see. The status line shows the profile as INI_WSV, also correct. But the Profile display has an extra EFT line at the top which I do not normally see, ie.
==EFT> \WinSetView\APPDATA\*.INI = INI_WSV =PROF> PROFILE INI_WSV LOCKED, ACTION OFF, AUTOBKUP OFF, AUTOCAPS OFF, AUTONAME NONE =PROF> AUTOSAVE ON NOPROMPT, BOM OFF, CAPS OFF, CASE T, CHANGE DS, COLLATE ANSI =PROF> COLS ON, COMMENTS 0 0 '', EMACRO NONE, EOL CRLF, FOLD OFF, HEX OFF, HILITE FIND AUTO =PROF> LRECL 0, MACLIB NONE, MARK ON, MINLEN 0, MODE EDIT, NUMTYPE NONE =PROF> PAGE OFF, PRESERVE OFF, RECFM U, SCROLL HALF, SETUNDO 20, SOURCE ANSI, START FIRST =PROF> STATE OFF, SUBARG OFF, SUBCMD OFF, TABS ON, TABBNDS OFF, XFORM NONE, XTABS 0
and the AUTO file related with this edit tab is INI.AUTO, and not the INI_WSV.AUTO I expected.
What am I doing wrong, please?
Thx in advance
|
|
|
Post by Robert on Dec 23, 2023 11:20:34 GMT -5
Stefan, you have a knack for creating conundrums. Let me put on my cogitating hat and see what I can come up with.
1. You do remember that you cannot "drag" a profile, right? These are Configuration entries, which are stored in the SQLite database. Any .INI files you have will NOT be used as profiles. That's the old, OLD way.
2. Why an empty file? If I understand your explanation right, it sounds like the file you copied WAS empty. It that correct, or not? If it were NOT empty, you should have seen a complaint that the profile INI_WSV was not found. If you didn't, this may be a bug. I don't believe it should have been silent on this matter.
3. The extra line that you don't normally see? Perhaps you have not been observant. The ==EFT> line has been there for some time. It is there to show you that you are operating under an EFT, and it shows you the one that matched the file name in question.
4. You said, "and the AUTO file related with this edit tab is INI.AUTO, and not the INI_WSV.AUTO I expected."
How do you know that is the auto file in effect? How do INI.AUTO and INI_WSV.AUTO differ so that you know which is which?
In looking at the Help, it is a little vague about how it goes about finding an AUTO file. But, I created a macro called AUTO.MACRO that I use to edit the auto file for a given edit file. It's like this:
' 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)
Maybe this will help you.
The short answer is, I am not seeing anything especially wrong with what you're doing. I don't see any EFT usage errors here.
R
|
|
|
Post by George on Dec 23, 2023 12:02:20 GMT -5
Don't forget AUTONAME:
Syntax
AUTONAME AUTO-filename | NONE | ?
Operands
AUTO-filename The name of the AUTO file to be used with the current Profile
NONE Removes any existing AUTONAME value
? Display the current status of the setting. Description
Normally, colorization support assumes the name of the AUTO file to use will be equal to the Profile name. i.e. A profile named TXT would default to using an AUTO file named TXT.AUTO. AUTONAME allows you to change this default assumption to whatever AUTO file you choose.
If NONE is entered, any existing AUTONAME value will be removed, returning the Profile to the default.
If ? is entered, the current setting will be displayed.
The new value will be saved in the Profile.
|
|
|
Post by Robert on Dec 23, 2023 13:31:45 GMT -5
I just did a test on a .MACRO file. In the edit session, I issued an AUTONAME ? to see what it's auto file name was, and it returned NONE. I have an EFT entry of MACRO = BAS, and I have Profile: BAS on the status line. And, my MACRO file is being colorized according to BAS rules.
I suspect there is some bug (?) when EFT is in effect, the AUTONAME logic is not respecting the NONE value, which is supposed to respect the default <profile-name>.AUTO.
The behavior doesn't make sense to me.
BTW, I have to say that using AUTONAME NONE on a file like MYFILE.BAS to mean the auto file is BAS.AUTO just seems wrong. Why can't the actual name be used here - AUTONAME BAS - instead of NONE? I find this very confusing.
R
|
|
|
Post by George on Dec 23, 2023 13:51:31 GMT -5
Robert: It would have been nice if you had voiced this concern when AUTONAME came along. It was created as an Override to the AUTO name, not simply to specify the current 'Name' of the AUTO file being used.
Sorry, but that's the way it was created and that's the way it is documented. But it IS different so maybe a change should be made.
George
|
|
|
Post by Stefan on Dec 23, 2023 16:54:05 GMT -5
Guys,
I missed the AUTONAME parameter altogether. I appreciate that it is intended to 'override' the normal (default) effect where SPFLite automatically uses an xxxxx.AUTO file to display the data, WHEN... a) a 'xxxxx'.AUTO file exists AND b) 'xxxxx' is the same as the file-type/extension OR the same as the profile name assigned by EFT
If so, it seems to me we need 3 settings for AUTONAME. 1) AUTONAME DEFAULT to allow the normal/default process to take place 2) AUTONAME ooooo to instruct SPFlite to use a particular ooooo.AUTO 3) AUTONAME NONE to prevent any AUTO file being used
Option (1) AUTONAME DEFAULT should be the 'default' setting in all Profiles.
|
|
|
Post by Stefan on Dec 23, 2023 17:08:35 GMT -5
Robert, To answer your questions... 1. You do remember that you cannot "drag" a profile, right? Yes, fully understand that profiles are in the CFG. I'm not trying to dragging a Spflite 'profile'. The Win10.ini file a. INI file for the WinSetView utility which influences the way (views) of File Exploerer dialogs. 2. Why an empty file? If I understand your explanation right, it sounds like the file you copied WAS empty. No. File is not empty. I didn't have a INI_WSV profile yet at the beginning. I expected that the "Create new profile" dialog would pop up and give me the option to specify a existing profile from which to create the INI_WSV profile. That didn't happen. SPFLite opend the tab, but there was not data between the *** Top of Data *** line and the *** Bottom of Data *** line. 3. The extra line that you don't normally see? Perhaps you have not been observant. The ==EFT> line has been there for some time. You're right. I just hadn't noticed the ==EFT> line before. 4. You said, "and the AUTO file related with this edit tab is INI.AUTO, and not the INI_WSV.AUTO I expected."
How do you know that is the auto file in effect? How do INI.AUTO and INI_WSV.AUTO differ so that you know which is which? This isn't an issue any more. I've found my mistake. The correct AUTO file IS being used - it just works better when I have the correct colorisation statements within it. SORRY!
That leaves the 'empty file' and no pop-up to initially request a profile template as the only issue.
|
|
|
Post by Robert on Dec 23, 2023 17:52:07 GMT -5
Stefan,
The empty-file issue is a puzzle, Something is clearly not right here, AKA seems to be a bug. Time for a George intervention.
George,
IIRC, I *did* voice concerns about the AUTONAME syntax, because NONE doesn't really convey what is actually going on.
Since my last post, I have been giving this some thought. Right now, this is your syntax:
AUTONAME AUTO-filename | NONE | ?
Operands
AUTO-filename The name of the AUTO file to be used with the current Profile NONE Removes any existing AUTONAME value ? Display the current status of the setting.
I feel that having an AUTONAME Profile option at all misleads the user, because "NONE" doesn't mean "none" the way other uses of "none" are used in SPFLite. I believe that AUTONAME should not exist in its current form. Rather, it should be an option of HILITE, since the xx.AUTO file controls how files are highlighted.
This is how I would picture an improved HILITE to address this:
HILITE { [ ON | OFF ] [ AUTO [ name | * ] ] [ FIND ] [ ? ] }
Here,
HILITE AUTO name = AUTONAME name
HILITE AUTO * = AUTONAME NONE
And for clarity, "name" cannot be ON, OFF, AUTO or FIND.
In the Profile display, if AUTO never was set with a 'name', you'd show AUTO *
Perhaps the existence of 'name' could be determined because it's none of the other keywords. When HILITE was used without the 'name' or * specified, you would see that neither of them are present. You'd only need * to shut off an existing 'name' option.
I realize that changing the syntax of AUTONAME, now that it's implemented, would be a problem, and adding more operands to HILITE complicates it.
Based on your earlier reaction to this feature, I don't expect you to change it now. But, this is my sincere opinion.
R
|
|
|
Post by George on Dec 24, 2023 10:12:22 GMT -5
Robert: My last words were "so maybe a change should be made." I'm not objecting to altering this.
However, adding it to HILITE your way introduces it as a positional operand amongst other positionless operands, meaning a probable restructure of HILITE parse. It's way simpler to just alter the existing AUTONAME command to accept * or xxxxx instead of NONE or xxxxx. And then alter the places where AUTONAME is currently referenced to accomodate the new usage.
George
|
|
|
Post by George on Dec 26, 2023 13:59:42 GMT -5
Robert: I've left it as it was - a separate primary command AUTONAME, with 4 possible values: - ? - Display current setting of AUTONAME
- * - Set AUTONAME to the actual Profile name
- xxx - Set AUTONAME to a specific xxx.AUTO filename
- NONE - Set AUTONAME to NONE. i.e. colorization will be turned off as if no AUTO file exists
This was the simplest way to alter it.
George
|
|
|
Post by Jo on Jan 2, 2024 13:45:05 GMT -5
I expanded Robert's Auto.Macro to extract then AUTONAME setting. First I tried a Get_Profile$("AUTONAME") but that results in "Invalid Profile request". Now I use Spf_Cmd("AutoName ?") and this works fine for EDIT and VIEW, but in BROWSE I get "Command not allowed in Browse mode".
Jo
|
|
|
Post by George on Jan 2, 2024 16:04:21 GMT -5
Jo: My omission, AUTONAME was missing from Get_Profile$, I'll add it and check that the holiday season didn't cause anything else to 'fall through the crack'. I'll also correct the command table to allow it in BROWSE. Sheesh! I'm getting sloppy.
George
|
|