F4 from Lister to Editor

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

ghisler(Author) wrote: 2024-01-26, 10:06 UTC In RC3 I will keep the Lister window open half a second after launching the editor, this way it should be easier for third party tools to determine that they were not launched from the main TC window.
Why you don't think that next suggestion:
Flint wrote: 2024-01-25, 12:03 UTC
ghisler(Author) wrote: 2024-01-25, 08:36 UTC then TCER will have to be updated to detect whether the calling window is Total Commander or not.
Do you think you could introduce some difference; maybe pass an extra environment variable into the started editor's environment block, which would contain a value, defining the particular type of the editor call? Then the proxy-editor authors could easily recognize all the scenarios.

For example, a variable named %COMMANDER_EDITOR_SRC%, which would contain one of the possible values:
main, if the editor was called from the main TC panels;
sync, if it was called from SyncDirs;
find, if from Find Files;
lister, if from Lister;
cmd, if called via cm_Edit.
I think that would cover it.
isn't a MUCH more better variant? It will be easy to use NOT only for fully finished third-party programs,
but also for our own scripts, which may definitely not have enough time for analysis, if they can detect
this time-lag at all.
And thanks to such values, there is much more "space" for performing some necessary actions,
Previously, which could not even be fulfilled - because it was impossible to determine the initial conditions
of their triggering...
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *ghisler(Author) »

The idea is that some tools may already work with F4 in sync because it was introduced in 2020, so they wouldn't need to be changed when they detect that the calling window wasn't main TC. Your suggestion means that all such tools would have to be changed.
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: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *Flint »

They don't have to be changed. Environment variables can be simply ignored, which is why I suggested this approach in the TCER topic: it's a great way to provide information while keeping 100% backwards compatibility. So the old tools continue to work like they did before, and new and updated tools will be able to use this new information for reliable detection.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

which is why I suggested this approach in the TCER topic.....
exactly! And the same - that' why I've mentioned you suggestion only inside this "similar" topic...
2ghisler(Author)
again - new var with new values - CAN BE used for a new and freshly-updatable programs.
But they don't HAVE TO do this... They can ignore this totally.
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *ghisler(Author) »

Maybe it's best to do both?
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *AntonyD »

and a new var\values AND a small time-lag? Yep, not a bad design, IMHO.
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *ghisler(Author) »

This turned out more complex than expected, there are a lot of locations where a program can be launched.
Here is the list I will use. The variable will be named %COMMANDER_OPEN%

bar : Button bar button
changeini: Menu Configuration - Change ini files directly
cmd: Menu Commands - Open command prompt window
cmdline: Command line
contextmenu: Right click context menu
delete: Delete from archive (launching external packer)
edit: F4 in main program
editlistfile: Edit list file in background transfer manager
hotkey: User-defined hotkey
lister: F4 in Lister
menu: Menu "Start"
new: Context menu, submenu "New"
open: Enter or double click
pack: Pack with external packer
unpack: Unpack with external packer
view: View with internal viewer (default Alt+F3)
find: F4 in Commands - Search
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: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *Flint »

Thanks a lot! This will definitely help!
Do I understand correctly that "hotkey" and "edit" are basically the same (starting an editor from the main TC window), only with different hotkeys?

Also, is it possible to distinguish the command cm_Edit started, for example, from buttonbar, but in one case it's without arguments (to open the currently chosen file in the TC panels), and in another case with parameters specifying the particular file to open?
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *petermad »

2ghisler(Author)
Aren't you missing:
sync: F4, Shift+F4 or context menu in the Sync tool.
hotlist: Directory hotlist.
mrtlist: Edit names in the Multi-rename tool

Then I wonder about:
auto: Auto-run commands in View Modes
- here user commands (em_commands) can be used and they can open external programs.

view: View with internal viewer (default Alt+F3)
Shouldn't that be External viewer
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
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: F4MiniMenu (AHK): F4Menu w. Drag&Drop, filelist, cmdline (XYPlorer, Everything, Explorer, Double Commander)

Post by *ghisler(Author) »

Do I understand correctly that "hotkey" and "edit" are basically the same (starting an editor from the main TC window), only with different hotkeys?
No, hotkey is when the user defines an em_command and opens that with a user-defined hotkey (Configuration - Options - Misc).
Aren't you missing:
sync: I'm actually setting that, it just wasn't documented.
hotlist, mrtlist: These don't currently set the value. I will add them.
Please let me know if you find any others.
Shouldn't that be External viewer
Yes, you are right.
Author of Total Commander
https://www.ghisler.com
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 »

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
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 »

BUT why it was not added inside the GUI form? Lister -> Configure ... -> tab General
Maybe because there is no more space in that dialog? - but it would be the right place to put it.
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
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 »

history.txt wrote:26.01.24 Added: F4 in Lister: If F4Edit is set to 2 or 3, keep Lister open for half a second after launching the editor, so a multi-editor launcher like F4menu can detect that it wasn't opened by the main program (32/64)
I can confirm that this works fine in TC 11.03rc3 with F4 configured for F4Menu and with multiple files selected.
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
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 »

Moderator message from: petermad » 2024-01-29, 20:02 UTC

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
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 »

2ghisler(Author)
These should be included::

auto: Auto-run commands in View Modes
- here user commands (em_commands) can be used and they can open external programs.

assoc: Internal Associations.



I testet this a little:
bar, cmd, cmdline, contextmenu, delete, edit, hotkey, menu, open, pack, view, find and sync all work as expected.

lister: does not seem to work - pressing F4 in Lister returns edit.
unpack: only works when pressing Alt+F9 not when pressing F5 inside an archive.
- pack works with both Alt+F5 and F5 with open archive in target panel, so unpack should also work with F5.
I have not been able to test: changeini, editlistfile and new.

em_commands works for hotkey and cmdline, but NOT for bar and menu - and should also work for auto and assoc if implemented.
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