Hi list,

How do I replace the "???" in

  \def\FooBarPlic{Ploc}
  \directlua{
    % ???
  }

by some Lua code that lists all the macros that have "Bar"
in their names?

I've spent the last hours trying to fix the answers that I
found on Google, StackExchange, StackOverflow, etc, but they
all (?) start with this,

  cmds     = token.commands()
  call_cmd = token.command_id("call")

that doesn't look very promising, because cmds is a list
with just 156 elements... I also tried to find hints in the
LuaTeX Reference Manual, and I tried to read some parts of
the files in source/texk/web2c/luatexdir/ that mentioned
"get_macro" and "def_cmd", but... I'm lost.

Is there something obvious that I am missing?
Help, anyone?


--snip--snip--


Now let me explain why I want this. I am the author of this
package, that has very few users...

  https://tug.org/TUGboat/tb39-3/tb123ochs-dednat.pdf
  https://anggtwu.net/dednat6.html

In my presentation about it at the TUG 2018 meeting I
mentioned a REPL,

  https://anggtwu.net/dednat6/tug-slides.pdf#page=21

that I rewrote several times since then.

I am now trying to understand some parts of pgfkeys that are
not well documented, and I thought that it could be nice,
fun, good karma, etc, to explore how those parts work by
inspecting pgfkeys's data structures from a Lua REPL, in
addition to using the "official" debugging tools that are
mentioned in the section "87. Key Management" of the PGF
manual. More concretely, in:

  \documentclass{article}
  \usepackage{pgfkeys}
  \begin{document}
    \pgfkeys{/FooBarPlic/.code=Ploc}
    \pgfkeys{/FooBarPlic}
    % Run the REPL here
  \end{document}

I am trying to use the REPL to list all the macros/control
sequences that contain "FooBarPlic" in their names...

The current code can be inspected and tested with these
commands - but I recommend waiting a few more days:

  rm -rfv /tmp/2026luatex-test.zip
  rm -rfv /tmp/edrx-latex/
  cd /tmp/
  wget https://anggtwu.net/LATEX/2026luatex-test.zip
  mkdir    /tmp/edrx-latex/
  unzip -d /tmp/edrx-latex/ /tmp/2026luatex-test.zip
  cd       /tmp/edrx-latex/
  export RUNREPL3=yes
  lualatex 2026luatex-test.tex

Cheers, and thanks in advance!
  Eduardo Ochs
  https://anggtwu.net/

Reply via email to