Skip to Content.
Sympa Menu

texmacs-users - Re: [texmacs-users] A basic programming problem.

Subject: mailing-list for TeXmacs Users

List archive

Chronological Thread  
  • From: Giovanni Piredda <address@concealed>
  • To: address@concealed
  • Subject: Re: [texmacs-users] A basic programming problem.
  • Date: Tue, 07 Apr 2026 19:36:30 +0000

Hi David,

I don't think that these are basic questions, in that you are programming with an interface for which there are just a few examples so you may have to test your programs step by step on your own.

This said, I got the following to work

<assign|mc|<macro|type|<extern|set-color|<arg|type>>>>

<assign|testextern|<macro|type|<with|color|<mc|<arg|type>>|testwrite>>>

(tm-define (set-color type)
  (stree->tree 
   (cond ((equal? (tree->stree type) "emph") "red")
        ((equal? (tree->stree type) "stat") "blue")
        (else "black"))))


Perhaps you will find by comparison what is not working in your code. I can test your code too if necessary, I would need the Scheme code as well.

PS 1 : I wrote a Scheme function because the documentation seems to say that conditional structures, or case, are not very reliable. Is that true?

I don't know, let's see if someone else answers

PS 2 : Could you tell me which keyboard configuration is needed to work efficiently on a style file under macOS? The keyboard shortcuts for writing work fine, but the ones for programming do not. It is therefore quite frustrating to have to keep using the mouse and the drop-down menus all the time.

I think you need to absorb the keyboard behaviour for programming "by osmosis". I am not aware of a document where the keyboard behaviour is explained. While I do think such a document would be very helpful, I don't think I am able to write one, both because I do not have the time *and* I do not know the behaviour in a complete and systematic way.

Let me give you one tip: you need to observe what the keys return, backspace and the arrows do according to the cursor position (maybe according to the surrounding code too, but I may be wrong and there is no such dependency). For example when you are inside a macro argument, next to the macro name, backspace will let you edit the macro name.




Archive powered by MHonArc 2.6.24.

Top of Page