searching in the source browser
Hi, this is probably for Taco: Is there a possibility in the source browser to search for macros (\something) or anything containing dots (logs.errors)? Because neither “simple” nor with Lua patterns I get any results. E.g. I wanted to look for all trackers and/or directives. Hraban
Henning Hraban Ramm via ntg-context schrieb am 05.09.2022 um 20:28:
Hi, this is probably for Taco:
Is there a possibility in the source browser to search for macros (\something) or anything containing dots (logs.errors)? Because neither “simple” nor with Lua patterns I get any results.
E.g. I wanted to look for all trackers and/or directives.
To get a list of trackers and directives you can use \showtrackers \showdirectives in a document (the list appear in the log file and terminal) or you use the following two modules: context --global m-trackers.mkiv context --global m-directives.mkiv Wolfgang
Am 05.09.22 um 20:59 schrieb Wolfgang Schuster via ntg-context:
Henning Hraban Ramm via ntg-context schrieb am 05.09.2022 um 20:28:
Hi, this is probably for Taco:
Is there a possibility in the source browser to search for macros (\something) or anything containing dots (logs.errors)? Because neither “simple” nor with Lua patterns I get any results.
E.g. I wanted to look for all trackers and/or directives.
To get a list of trackers and directives you can use
\showtrackers \showdirectives
in a document (the list appear in the log file and terminal) or you use the following two modules:
context --global m-trackers.mkiv context --global m-directives.mkiv
Thank you! While this was just an example for a search, I will include these in my book and somewhere on the wiki. I’m not looking forward to trying all of these options to find out what they do (and document it, of course). Hraban
On 9/5/22 20:28, Henning Hraban Ramm via ntg-context wrote:
Hi, this is probably for Taco:
Is there a possibility in the source browser to search for macros (\something) or anything containing dots (logs.errors)? Because neither “simple” nor with Lua patterns I get any results.
E.g. I wanted to look for all trackers and/or directives.
Hi Hraban, has it to be the source browser? I mean, I use grep in Linux (MSYS2 in Windows [and brew.sh is available for macOS]) and it works perfectly fine with ConTeXt. $ grep -irl fi[eë][eë] context context/tex/texmf-context/tex/context/base/mkiv/char-def.lua context/tex/texmf-modules/tex/context/third/lilypond/t-lilypond.tex Althought regular expressions are fine, I don’t know why "fi[eë]+" doesn’t work in this case. Just in case it might help, Pablo
On 9/5/2022 9:07 PM, Pablo Rodriguez via ntg-context wrote:
On 9/5/22 20:28, Henning Hraban Ramm via ntg-context wrote:
Hi, this is probably for Taco:
Is there a possibility in the source browser to search for macros (\something) or anything containing dots (logs.errors)? Because neither “simple” nor with Lua patterns I get any results.
E.g. I wanted to look for all trackers and/or directives.
Hi Hraban,
has it to be the source browser?
I mean, I use grep in Linux (MSYS2 in Windows [and brew.sh is available for macOS]) and it works perfectly fine with ConTeXt.
$ grep -irl fi[eë][eë] context context/tex/texmf-context/tex/context/base/mkiv/char-def.lua context/tex/texmf-modules/tex/context/third/lilypond/t-lilypond.tex
Althought regular expressions are fine, I don’t know why "fi[eë]+" doesn’t work in this case.
Just in case it might help, an oldie (the one i use):
mtxrun --script grep Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Am 05.09.22 um 21:07 schrieb Pablo Rodriguez via ntg-context:
On 9/5/22 20:28, Henning Hraban Ramm via ntg-context wrote:
Hi, this is probably for Taco:
Is there a possibility in the source browser to search for macros (\something) or anything containing dots (logs.errors)? Because neither “simple” nor with Lua patterns I get any results.
E.g. I wanted to look for all trackers and/or directives.
Hi Hraban,
has it to be the source browser?
I mean, I use grep in Linux (MSYS2 in Windows [and brew.sh is available for macOS]) and it works perfectly fine with ConTeXt.
$ grep -irl fi[eë][eë] context context/tex/texmf-context/tex/context/base/mkiv/char-def.lua context/tex/texmf-modules/tex/context/third/lilypond/t-lilypond.tex
Althought regular expressions are fine, I don’t know why "fi[eë]+" doesn’t work in this case.
Just in case it might help,
Thank you – I found grep -R "regex" ~/context to be most easy. But I like the source browser with its syntax highlighting, and it’s a pity that the search is so limited. Hraban
Hi Hraban,
Am 05.09.22 um 21:07 schrieb Pablo Rodriguez via ntg-context:
has it to be the source browser?
I mean, I use grep in Linux (MSYS2 in Windows [and brew.sh is available for macOS]) and it works perfectly fine with ConTeXt.
$ grep -irl fi[eë][eë] context context/tex/texmf-context/tex/context/base/mkiv/char-def.lua context/tex/texmf-modules/tex/context/third/lilypond/t-lilypond.tex
Althought regular expressions are fine, I don’t know why "fi[eë]+" doesn’t work in this case.
Just in case it might help,
Thank you – I found
grep -R "regex" ~/context
to be most easy.
But I like the source browser with its syntax highlighting, and it’s a pity that the search is so limited.
I usually use the new GitHub "Code Search". This works pretty well, although you need a (free) account to use it: https://cs.github.com/contextgarden/context-mirror?q=%5Cstarttext Sourcegraph should work pretty much the same way. I don't usually use it, but it has the advantage of not requiring an account: https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/contextgarden/context-mirror%24+%5Cstarttext&patternType=standard Both of these have syntax highlighting and work with literal strings or regexes. -- Max
On 5 Sep 2022, at 20:28, Henning Hraban Ramm via ntg-context
wrote: Hi, this is probably for Taco:
Is there a possibility in the source browser to search for macros (\something) or anything containing dots (logs.errors)? Because neither “simple” nor with Lua patterns I get any results.
That is something we can look at next week. The sourcebrowser is using an lpeg-based lua script to create its search index, meaning it is not impossible to extend it. :) Best wishes, Taco — Taco Hoekwater E: taco@bittext.nl genderfluid (all pronouns)
participants (6)
-
Hans Hagen
-
Henning Hraban Ramm
-
Max Chernoff
-
Pablo Rodriguez
-
Taco Hoekwater
-
Wolfgang Schuster