Kate Guide to develop TeXmacs/Mogan in scheme on Debian bookworm

The key is to build the patched ctags for tm-define by @darcy :
https://codeberg.org/XmacsLabs/ctags

And then replaced the system one with the patched one.

Here are the detailed steps:

Step 1: Replace ctags with the patched ctags for tm-define

Install ctags on Debian bookworm first:

sudo apt install universal-ctags

Clone and build the patched ctags:

git clone https://codeberg.org/XmacsLabs/ctags.git /tmp/ctags
cd /tmp/ctags
./autogen.sh
./configure
make -j10
./ctags --version

Replace the debian ctags with the patched ctags:

sudo cp ctags /usr/bin/ctags

Step 2: Launch Kate and test the Index

  • Use File->Open Folder... to open the project directory of TeXmacs or Mogan
  • Click Project in the bottom of the Kate
  • Click Enable indexing to enable indexing for Kate
  • And then you can search the tm-define-ed symbols now

WARNING: for Project -> Code Index, we have to open the tools and then search for the symbols. For better integration of Go to definition, please see Step 3.

Step 3: Enable the CTags plugin and test Go to Definition

  • Click Settings -> Configure Kate
  • Check the CTags plugin
  • Save the session by Sessions -> Save Session as
  • Click CTags -> Configure
  • Add the Mogan/TeXmacs folder (a bit tricky, you have to insert the folder name in the file dialog)
  • Set the CTags command to ctags -R --languages=C,C++,Scheme and click the Update button
  • Select the Scheme function like tmfile-extract and then right click to clik the CTags -> Go to definition
1 Like