Re: Re: Adding backslash escapes to find.command

Chris Angelico <[email protected]> Mon, 12 May 2025 08:59:30 +1000
Newsgroups gmane.editors.scite.general
Message-ID <CAPTjJmqX-OwtBNVP+ui1cUP9adq0At=G-qS7A9msiefB_Fvs1A@mail.gmail.com>
On Mon, 12 May 2025 at 08:54, scintillaDotOrg <[email protected]> w=
rote:
>
> ChrisA:
>
> I'm looking at is the non-file-dependent one, right?
>
>
> No, find.command for GTK is currently implemented with GetNewExpandString=
. It's likely this was done as it is a command and most commands can be dif=
ferentiated by file type although find.command does not currently allow a p=
attern like find.command.*.c.
>
> I had a look at this previously; this is SciTEGTK::FindInFilesCmd in
> SciTEGTK.cxx. If the find command is blank, a command is constructed
> that calls on the SciTE executable in grep mode, and notably, it
> appends Slash(props.GetString("find.what"), true) to get the search
> string. Is that the same as what $(escape ...) would do?
>
>
> Its similar but $(escape ...) uses ShellEscape, not Slash which is more o=
riented towards making control characters visible and less towards avoiding=
 shell features. A difficulty here is that a different set of escapes is ne=
eded based on context, such as the OS; the command language being executed;=
 and whether the value is inside quotes.
>

Ah. Confusing.

To be completely honest, what I *actually* want here is a way to
specify an array of arguments, rather than a shell-like command line.
But that probably wouldn't be easy, so for the moment, I'm happy with
escaping the quotes properly :)

Is there prior art anywhere? A place where user data gets added to a
command, and has to remain as a single argument?

ChrisA

--=20
You received this message because you are subscribed to the Google Groups "=
scite-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scite-inter=
est/CAPTjJmqX-OwtBNVP%2Bui1cUP9adq0At%3DG-qS7A9msiefB_Fvs1A%40mail.gmail.co=
m.