A basic programming problem.

David Latreyte <[email protected]> Tue, 7 Apr 2026 15:47:55 +0200
Newsgroups gmane.editors.texmacs.user
Message-ID <[email protected]>
--Apple-Mail=_A41D9D09-3158-40A0-959D-3EC02C00A2E4
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hello

I=E2=80=99m learning TeXmacs programming by trying to write a macro that =
configures the leftlined environment.

So far, I wrote :

<use-module|(my-colors)>

<assign|my-color|<\macro|kind>
  <extern|ext-my-color|<quote-arg|kind>>
</macro>>

<assign|my-env|<\macro|type|body>
  =
<surround|<npage-break*><vspace*|0fn><no-indent>|<vspace*|0fn>|<with|color=
|<my-color|<arg|type>>|<leftlined|<with|color|black|<arg|body>>>>>
</macro>>

my-colors is a function written in Scheme that returns a color code from =
a keyword such as idea, task, tir, and so on.
The my-color macro works perfectly: I do get a color code depending on =
the chosen keyword.
The my-env macro completely freezes TeXmacs. I am starting to wonder =
whether it is actually possible to pass a function call to with.
Sorry if this is a rather basic question, but would you have any idea =
what the problem might be?

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?

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.

Once again, sorry if these are basic questions.

=E2=80=94=E2=80=94=E2=80=94=E2=80=94
David Latreyte
[email protected]







--Apple-Mail=_A41D9D09-3158-40A0-959D-3EC02C00A2E4
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html aria-label=3D"message body"><head><meta http-equiv=3D"content-type" =
content=3D"text/html; charset=3Dutf-8"></head><body =
style=3D"overflow-wrap: break-word; -webkit-nbsp-mode: space; =
line-break: after-white-space;">Hello<div><br></div><div><p =
class=3D"p1">I=E2=80=99m learning TeXmacs programming by trying to write =
a macro that configures the&nbsp;<span =
class=3D"s1">leftlined</span>&nbsp;environment.</p></div><div>So far, I =
wrote =
:</div><div><br></div><div><div><div>&lt;use-module|(my-colors)&gt;</div><=
div><br></div><div>&lt;assign|my-color|&lt;\macro|kind&gt;</div><div>&nbsp=
; =
&lt;extern|ext-my-color|&lt;quote-arg|kind&gt;&gt;</div><div>&lt;/macro&gt=
;&gt;</div><div><br></div><div>&lt;assign|my-env|&lt;\macro|type|body&gt;<=
/div><div>&nbsp; =
&lt;surround|&lt;npage-break*&gt;&lt;vspace*|0fn&gt;&lt;no-indent&gt;|&lt;=
vspace*|0fn&gt;|&lt;with|color|&lt;my-color|&lt;arg|type&gt;&gt;|&lt;leftl=
ined|&lt;with|color|black|&lt;arg|body&gt;&gt;&gt;&gt;&gt;</div><div>&lt;/=
macro&gt;&gt;</div></div><div><br></div><div><p class=3D"p1"><span =
class=3D"s1"></span></p><span class=3D"s1"><ul =
class=3D"MailOutline"><li><span class=3D"s1">my-colors</span>&nbsp;is a =
function written in Scheme that returns a color code from a keyword such =
as&nbsp;<span class=3D"s1">idea</span>,&nbsp;<span =
class=3D"s1">task</span>,&nbsp;<span class=3D"s1">tir</span>, and so =
on.</li><li>The&nbsp;<span class=3D"s1">my-color</span>&nbsp;macro works =
perfectly: I do get a color code depending on the chosen =
keyword.</li><li>The&nbsp;<span class=3D"s1">my-env</span>&nbsp;macro =
completely freezes TeXmacs. I am starting to wonder whether it is =
actually possible to pass a function call to&nbsp;<span =
class=3D"s1">with</span>.</li></ul></span><p class=3D"p3">Sorry if this =
is a rather basic question, but would you have any idea what the problem =
might be?</p><p class=3D"p3">PS 1 : I wrote a Scheme function because =
the documentation seems to say that conditional structures, =
or&nbsp;<span class=3D"s1">case</span>, are not very reliable. Is that =
true?</p><p class=3D"p3">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.</p><p =
class=3D"p1">Once again, sorry if these are basic =
questions.</p></div><div>
<meta charset=3D"UTF-8"><div dir=3D"auto" style=3D"caret-color: rgb(0, =
0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: =
after-white-space;"><div style=3D"color: rgb(0, 0, 0); =
font-variant-ligatures: normal; font-variant-caps: normal; =
font-variant-east-asian: normal; font-variant-position: normal; =
letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
-webkit-auto; text-indent: 0px; text-transform: none; white-space: =
normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
word-wrap: break-word; -webkit-nbsp-mode: space; line-break: =
after-white-space;"><span style=3D"font-style: =
normal;">=E2=80=94=E2=80=94=E2=80=94=E2=80=94<br>David =
Latreyte<br>[email protected]<br></span><br><br><br><br><br></div>=
</div>
</div>

<br></div></body></html>=

--Apple-Mail=_A41D9D09-3158-40A0-959D-3EC02C00A2E4--