F4 from Lister to Editor

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 from Lister to Editor

Post by *ghisler(Author) »

Here are my findings:
lister: I'm setting it in lister to "lister" but then again in the function which launches the editor to "edit". I will fix it.
unpack: confirmed
em_commands:
bar: confirmed, should be set to "bar"
menu: confirmed, should be set to "menu"
view mode change: confirmed, will be set to "viewmode"
internal associations to em_commands: is currently set to "open" when you press enter or double click on a file which is then opening an em_command. What am I missing?
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: F4 from Lister to Editor

Post by *petermad »

internal associations to em_commands: is currently set to "open" when you press enter or double click on a file which is then opening an em_command. What am I missing?
Sorry my bad - it works OK for a single open command but if you have multiple commands for the filter like:

Code: Select all

[Associations]
Filter1=*.txt *.css *.js *.dat
Filter1_open=*
Filter1.icon=*
Filter1_Prompt1="cmd.exe"
Filter1_Prompt2=***em_cmd
Filter1_Metapad=""%COMMANDER_PATH%\TOOLS\metapad.exe" "%1""
Filter1_PlainEdit=""%PROGRAMFILES(x86)%\PlainEdit\PlainEdit.exe" "%1""
Filter2_Notepad++=""%PROGRAMFILES%\Notepad++\notepad++.exe" "%1""
Filter1_Notepad=""%SYSTEMROOT%\notepad.exe" "%1""
Filter1_Lister=***cm_List %1
Filter1_Lister Multi=***cm_List
Filter1_Standard=**
with

Code: Select all

[em_cmd}
cmd=cmd.exe
then %COMMANDER-OPEN% is not set when using Prompt1 and Prompt2 from the menu after double-clicking a .txt file.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4 from Lister to Editor

Post by *AntonyD »

Looks like question was missed, will repeat then it again:
2ghisler(Author)
I found a solution: You will be able to set a different editor for F4 invoked from Lister:
wincmd.ini
[Lister]
Editor=<your editor> "%1"
OK. I see it in history1103.txt.
BUT why it was not added inside the GUI form? Lister -> Configure ... -> tab General????
You ALREADY have a proper translatable string(-s): 5186 and\or 5187
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 from Lister to Editor

Post by *ghisler(Author) »

2petermad
I will check it, thanks.

2AntonyD
People would complain that they can't set the hotkey independently. Also it's a niche function only needed by those using a misbehaving multi-editor opener.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: F4 from Lister to Editor

Post by *Flint »

I've tried the COMMANDER_OPEN in a few modes in 11.03rc4, and it's a good help to the editor proxy. Thank you!
However, there's still one significant scenario that remains uncovered: currently there is no way to distinguish cm_Edit as is, and cm_Edit /N="filename", the value of COMMANDER_OPEN is "edit" in both cases.

For a proxy editor that supports opening selected files, it is important to know, if the file passed to the editor was taken from under cursor in the file panel, or passed directly via explicit command line arguments. In the first case, the program should ignore the passed argument, and obtain the selected files from the file panel (or the file under cursor, if no selection). In the second case, the command line argument takes precedence, and the selected files are ignored.

The problem is, currently there is no way to distinguish these two situations from inside the proxy editor program. Would it be possible for TC to also set COMMANDER_OPEN to some different value when explicit arguments are used in cm_Edit? Something like "edit" if generic cm_Edit was called, and "edit-args" if a particular file was passed via /N.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 from Lister to Editor

Post by *ghisler(Author) »

That's a good point. However, I think that we need to distinguish several cases here:
1. cm_edit /C or Shift+F4 -> editnew
2. cm_edit /N="name" -> editname
3. cm_edit /CGN="name" -> editname
4. cm_edit /L2 -> edit
editnew would always be set if the dialog box to enter the name was shown.
editname would be set if a different name was passed to cm_edit, but the dialog box to enter the name was not shown

What do you think?
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: F4 from Lister to Editor

Post by *Flint »

2ghisler(Author)
Good call, I agree, it might be useful, indeed. Only, I guess, the p.4 should apply for any value of /L, not just 2. (Or is that what you meant, and used 2 just as an example?)

Also, I've found that in rc4 when you run one of:

Code: Select all

cm_Edit /C

Code: Select all

cm_Edit /CN="test.txt"
then no COMMANDER_OPEN variable is present at all.

And another aspect I'm not clear on: when you run

Code: Select all

cm_Edit /L0N="test.txt"
the editor still starts. Is this a bug or intended behavior? I realize that /L0 does not have any use without /C, but still, the help says "do not launch"…
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 from Lister to Editor

Post by *ghisler(Author) »

Or is that what you meant, and used 2 just as an example?
Yes, it's an example of a parameter which doesn't change the file name, so the called editor may want to open all selected files.
then no COMMANDER_OPEN variable is present at all.
That's because TC "forgets" the COMMANDER_OPEN variable when the launch is more than half a second later than when I set the variable. I set it before calling the edit function, but using the dialog to set the name usually takes longer. I will set "editnew" after the edit box is closed in RC5.

Finally, L0 only works together with C, otherwise the command would do nothing at all.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: F4 from Lister to Editor

Post by *white »

Flint wrote: 2024-02-06, 10:42 UTC And another aspect I'm not clear on: when you run

Code: Select all

cm_Edit /L0N="test.txt"
the editor still starts. Is this a bug or intended behavior? I realize that /L0 does not have any use without /C, but still, the help says "do not launch"…
ghisler(Author) wrote: 2024-02-07, 08:13 UTC Finally, L0 only works together with C, otherwise the command would do nothing at all.
Flint is proving the point I made about this earlier:
white wrote: 2023-09-11, 11:37 UTC
ghisler(Author) wrote: 2023-09-11, 10:03 UTC cm_Edit /L0 would do nothing at all, so L0 is ignored.
Doing nothing would be consistent and consistent with the help text.
cm_Edit /L0 doing nothing would give the user feedback that L0 indeed means: do not start the editor or associated program.
Ignoring it may cause confusion. And it isn't clear from the help.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4 from Lister to Editor

Post by *ghisler(Author) »

I will change the help, so people who have buttons now with L0 don't get a nasty surprise.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: F4 from Lister to Editor

Post by *petermad »

Confirmed that the help in TC 11.03rc5 is chnaged from:
L: Launch type: L0=do not launch, L1=open with default editor, L2=open with associated program (including internal associations), L3=open with associated program (no internal associations)
to:
L: Launch type: L0=do not launch (only in combination with C), L1=open with default editor, L2=open with associated program (including internal associations), L3=open with associated program (no internal associations)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply