Re: Adding backslash escapes to find.command

scintillaDotOrg <[email protected]> Sat, 10 May 2025 18:05:54 -0700 (PDT)
Newsgroups gmane.editors.scite.general
Message-ID <[email protected]>
------=_Part_127954_1321366099.1746925554701
Content-Type: multipart/alternative; 
	boundary="----=_Part_127955_349406208.1746925554701"

------=_Part_127955_349406208.1746925554701
Content-Type: text/plain; charset="UTF-8"

ChrisA,

While it looks like there is a single form of variable expansion in SciTE, 
there are actually two with separate implementations: variables that depend 
on a file name and variables that don't. This is most obvious when there is 
an explicit wild card before the '=' in the properties file like
command.go.*.vala=./$(FileName)
but it also occurs indirectly when a variable used in a definition is file 
name dependent. File-name-dependent variables do not process calls like 
"escape" which are processed for other variables.

For file-name-dependent variables, "props.GetNewExpandString" is commonly 
called but for other variables, different methods are called like 
"props.GetExpandedString".

You could try changing the implementation of "find.command" in 
gtk/SciTEGTK.cxx to allow calling "escape" by switching calls although this 
may have unexpected consequences. Then set find.command to something like

find.command=git -C "$(find.directory)" grep -n "$(escape find.what)" -- 
"$(find.files)"

Neil

-- 
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 email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scite-interest/e091e539-e189-457d-8aba-ff967df9ae9fn%40googlegroups.com.

------=_Part_127955_349406208.1746925554701
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

ChrisA,<br /><br /><div><div dir=3D"auto">While it looks like there is a si=
ngle form of variable expansion in SciTE, there are actually two with separ=
ate implementations: variables that depend on a file name and variables tha=
t don't. This is most obvious when there is an explicit wild card before th=
e '=3D' in the properties file like</div><div dir=3D"auto">command.go.*.val=
a=3D./$(FileName)</div><div dir=3D"auto">but it also occurs indirectly when=
 a variable used in a definition is file name dependent. File-name-dependen=
t variables do not process calls like "escape" which are processed for othe=
r variables.</div><div dir=3D"auto"><br /></div><div dir=3D"auto">For file-=
name-dependent variables, "props.GetNewExpandString" is commonly called but=
 for other variables, different methods are called like "props.GetExpandedS=
tring".</div><div dir=3D"auto"><br /></div><div dir=3D"auto"><div dir=3D"au=
to">You could try changing the implementation of "find.command" in gtk/SciT=
EGTK.cxx to allow calling "escape" by switching calls although this may hav=
e unexpected consequences. Then set=C2=A0<span style=3D"color: rgb(80, 0, 8=
0);">find.command to something like</span></div><div dir=3D"auto"><span sty=
le=3D"color: rgb(80, 0, 80);"><br /></span></div><div dir=3D"auto">find.com=
mand=3Dgit -C "$(find.directory)" grep -n "$(escape find.what)" -- "$(find.=
files)"<span style=3D"color: rgb(80, 0, 80);"></span></div><div dir=3D"auto=
"><br /></div>Neil</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;scite-interest&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">scit=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
scite-interest/e091e539-e189-457d-8aba-ff967df9ae9fn%40googlegroups.com?utm=
_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/scit=
e-interest/e091e539-e189-457d-8aba-ff967df9ae9fn%40googlegroups.com</a>.<br=
 />

------=_Part_127955_349406208.1746925554701--

------=_Part_127954_1321366099.1746925554701--