How do you make a keyboard shortcut that inserts a whole tag?

I wanted to make a keyboard shortcut for inserting a blackboard bold semicolon. At first, when I edited progs/math/math-kbd.scm, I thought I could simply add in ("; ;" "<with|font|Bbb*|;>") to the appropriate kbd-map call. But when used in the document, this produces \<with\|font\|Bbb*\|;\>, like when you try to activate a macro TeXmacs doesn’t know.

Is there a way to insert “active” tags through the scheme code?

I managed to get around it in this particular case by using make-with:

(begin (make-with "font" "Bbb*") (insert ";") (go-to-path (rcons (get-focus-path) 1)))

but this doesn’t work for other tags, such as inserting <application-space|0.25fn>.

Does using (insert '(my scheme tree)) (go-to-path ...) works? I think you can use insert with arbitrary texmacs trees as arguments. But I haven’t checked.

1 Like

Yes, the following works:

(insert '(application-space "0.25fn")) (go-to-path (rcons (get-focus-path) 1)))
2 Likes