[TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor
Moderators: petermad, Stefan2, Hacker
- ghisler(Author)
- 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
This should be fixed in Total Commander 11.57 rc 4 help, please check it!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor
But this covers all cases.That's looks more complex than what I use now.
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.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.
Overquoting is evil! 👎
- ghisler(Author)
- 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
Have you actually tried it? The following three variants in Shift+F4 will create 3 files: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.
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
https://www.ghisler.com
Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor
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=.Have you actually tried it? The following three variants in Shift+F4 will create 3 files:
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:
There are always double quotes, but their location is different.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">
Overquoting is evil! 👎
- ghisler(Author)
- 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
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
https://www.ghisler.com
Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor
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.It does explain it:
Overquoting is evil! 👎
- ghisler(Author)
- 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
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
https://www.ghisler.com
Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor
Just replace "them" with "each name", then the text will correspond to your thoughts.
Overquoting is evil! 👎
- ghisler(Author)
- 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
That's a good idea, I will use it.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- 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
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
https://www.ghisler.com
Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor
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! 👎
- ghisler(Author)
- 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
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"
N="name 1|name 2|name 3"
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor
Overquoting is evil! 👎
- ghisler(Author)
- 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
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
https://www.ghisler.com
Re: [TC 11.57rc2] cm_Edit - Quoting behavior with different configurations for the editor
"name1 name2 name3" — names are enclosed in double quotes.If names are enclosed in double quotes, the entire parameter must be passed in angle brackets:
"name1" "name2" "name" — each of the names is enclosed in double quotes.
Overquoting is evil! 👎
