[TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: petermad, Stefan2, Hacker

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

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *ghisler(Author) »

This should be fixed in Total Commander 11.57 rc 4 help, please check it!
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *Fla$her »

That's looks more complex than what I use now.
But this covers all cases.
The name(s) of the file(s) to be opened/created - separate multiple file names with the | character, or put them in double quotes and separate them by spaces.
It sounds like in the case of a space, double quotes are required, but in the case of | they are not required. That's not true.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *ghisler(Author) »

It sounds like in the case of a space, double quotes are required, but in the case of | they are not required. That's not true.
Have you actually tried it? The following three variants in Shift+F4 will create 3 files:
file 1.txt|file 2.txt|file 3.txt
"file 1.txt" "file 2.txt" "file 3.txt"
"file 1.txt"|"file 2.txt"|"file 3.txt"
But the following will create just a single file with that long name:
file 1.txt file 2.txt file 3.txt

Same for cm_edit:
cm_edit /CGN="file 1.txt|file 2.txt|file 2.txt"
cm_edit /CGN=<"file 1.txt" "file 2.txt" "file 3.txt">
cm_edit /CGN=<"file 1.txt"|"file 2.txt"|"file 3.txt">
versus
cm_edit /CGN="file 1.txt file 2.txt file 3.txt"

Where do you think double quotes are required when you use the | separator?
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *Fla$her »

Have you actually tried it? The following three variants in Shift+F4 will create 3 files:
It's not about what I've tried (many times, by the way), but about how you wrote about it. We are not discussing Shift+F4, we are discussing cm_Edit /N=.
Unlike my version, the current one does not explain that the entire list of names can be either in double quotes or in angle brackets, depending on the delimiter. You write in general that there are quotes only in one case, but this is not true:
cm_edit /CGN="file 1.txt|file 2.txt|file 2.txt"
cm_edit /CGN=<"file 1.txt" "file 2.txt" "file 3.txt">
cm_edit /CGN=<"file 1.txt"|"file 2.txt"|"file 3.txt">
There are always double quotes, but their location is different.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *ghisler(Author) »

It does explain it:
N="name": The name(s) of the file(s) to be opened/created - separate multiple file names with the | character, or put them in double quotes and separate them by spaces.
[...]
Use angle brackets to pass multiple names in double quotes:
N=<"name1"|"name2"|"name3">
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *Fla$her »

It does explain it:
Once again: the wording "or put them in double quotes" indicates that in the first case double quotes are not needed. This is not true.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *ghisler(Author) »

It's about double quotes around each file name, not about double quotes around the entire parameter.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *Fla$her »

Just replace "them" with "each name", then the text will correspond to your thoughts.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *ghisler(Author) »

That's a good idea, I will use it.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *ghisler(Author) »

I have updated the text to:
N="name": The name(s) of the file(s) to be opened/created - separate multiple file names with the | character (with or without double quotes), or put each name in double quotes and separate them by spaces. Alternatively, use templates from the "+" button to create multiple files. If a file already exists, it will just be opened, not overwritten with a new one.
Note: Use angle brackets to pass multiple names in double quotes:
N=<"name1" "name2" "name3"> or N=<"name1"|"name2"|"name3">
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *Fla$her »

At the end, it should have been written like this:
Note: Use angle brackets to pass multiple names, each of which is enclosed in double quotes:
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *ghisler(Author) »

No, your sentence is wrong. It implies that angle brackets are needed to pass multiple names, but this isn't true. You can pass multiple names in double quotes when not enclosing each name in double quotes, e.g.
N="name 1|name 2|name 3"
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *Fla$her »

:shock: It's exactly the opposite. It's your text implies that all names taken in double quotes should be written in angle brackets, which is incorrect. And my text implies that multiple names are enclosed in angle brackets only when each of the names is taken in double quotes, which doesn't correspond to your example N="name 1|name 2|name 3".
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *ghisler(Author) »

Maybe ike this?
Note: If names are enclosed in double quotes, the entire parameter must be passed in angle brackets:
N=<"name 1" "name 2" "name 3"> or N=<"name 1"|"name 2"|"name 3">
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor

Post by *Fla$her »

If names are enclosed in double quotes, the entire parameter must be passed in angle brackets:
"name1 name2 name3" — names are enclosed in double quotes.
"name1" "name2" "name" — each of the names is enclosed in double quotes.
Overquoting is evil! 👎
Post Reply