[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: Stefan2, Hacker, petermad

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
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 we need to split the note into multiple notes?
N="name": The name(s) of the file(s) to be opened/created, or a template (starting with <) from the "+" button to create multiple files. If a file already exists, it will just be opened, not overwritten with a new one.
Notes:
Multiple names may be separated by spaces or vertical lines |.
When multiple names are separated by spaces, names containing spaces must each be put in double quotes, otherwise quotes are optional.
When a name is surrounded by double quotes, the entire parameter N must be put in angle brackets instead of double quotes.
Equivalent entries: N="name 1|name 2|name 3" or 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 »

petermad wrote:What you write in this part does not address N=""name 1"|"name 2"" which I believe is not allowed.
In this part, I highlighted the adjectives that don't match your example. And then ghisler(Author) provided the version that you are disputing.

How about this? —>
Note: For multiple names, the entire parameter N can be enclosed not only in double quotes (separator is |), but also in angle brackets (separator is | or a space, with which each name must be in double quotes). Examples:
"name 1|name 2|name 1", <name 1|name 2|name 1> or <"name 1" "name 2" "name 1">
The phrase "not only" well justifies the appearance of the note.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
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) »

Your last suggestion doesn't tell the user that they can't put the entire parameter in double quotes at the same time as the individual names, exactly the negative example from petermad: N=""name 1"|"name 2""
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 they can't put the entire parameter in double quotes at the same time as the individual names ...
How should this be understood if the first example precisely shows that individual names are enclosed in double quotes separated by |?

The clarifications in parentheses make it clear what is used and where.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
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) »

The clarifications in parentheses make it clear what is used and where.
No it doesn't. Here is your suggestion again:
Note: For multiple names, the entire parameter N can be enclosed not only in double quotes (separator is |), but also in angle brackets (separator is | or a space, with which each name must be in double quotes).
Your first parentheses (in green) just tells the user that they must use separator | when the entire parameter is enclosed in double quotes. It doesn't tell them that they can't put individual names in double quotes in this case.
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 doesn't tell them that they can't put individual names in double quotes in this case.
This is not necessary. You don't write in the help which characters (besides double quotes, there are many others) cannot be used in this or that parameter.
I also do not write there that a space is not used as a separator. Why didn't you ask about it?
In parentheses, the permissible usage option is indicated. In the first ones — a separator, and in the second ones — separators and the necessity of using double quotes. A simple and clear logic, backed up with examples.

For example, for "cm_Copy, cm_RenMov" you separately write about such a necessity:
Note: If you need double quotes around the wildcards, you need to put them in double quotes twice
In the current case, double quotes for each name are not required, so there is no point in writing about it either.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
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) »

With the latest change I just made for this function, I will go for this note now:
Note: If at least one of the names is enclosed in double quotes, the entire parameter N must be passed in angle brackets.
Equivalent entries: N="name 1|name 2|name 3" or 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 »

Then this does not explain the second example N=<name 1|name 2|name 3>. This is the first time the description talks about angle brackets.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
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 it doesn't, but why should 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 »

Because no description indicates that angle brackets can be used with the '|' separator and without double quotes.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
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) »

Using the '|' separator is actually described at the start of the N parameter:
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.
Using angle brackets without double quotes is implied with the word "must". And the examples below it make it clear.

Anyway, I don't think that we will find a wording were everything is explained. But is there any harm if the user thinks that they can only use angle brackets when there are quotes around a name? They will just use quotes for the entire parameter, and it will work too, so no harm is done.
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 »

Why not do the same for cm_MkDir?
N="name": The name(s) of the folder(s) to be created - separate multiple file names with the | character (with or without double quotes). The templates from the "+" button in the F7 dialog can also be used here.
Note: If at least one of the names is enclosed in double quotes, the entire parameter N must be passed in angle brackets.
Equivalent entries: N="name 1|name 2|name 3", N=<name 1|name 2|name 3> or N=<"name 1"|"name 2"|"name 3">
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
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) »

cm_MkDir and F7 only supports vertical lines, so it's far less confusing than cm_Edit. But for consistency reasons it is a good idea.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53139
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 thread has again deviated a lot from the initial report, to the point that it can't be fixed any more.

Moderator message from: ghisler(Author) » 2026-05-07, 07:37 UTC

Moved to will not be changed
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 »

But for consistency reasons it is a good idea.
I see the supplement. Now it's all right.
Overquoting is evil! 👎
Post Reply