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 <span = class=3D"s1">leftlined</span> environment.</p></div><div>So far, I = wrote = :</div><div><br></div><div><div><div><use-module|(my-colors)></div><= div><br></div><div><assign|my-color|<\macro|kind></div><div> = ; = <extern|ext-my-color|<quote-arg|kind>></div><div></macro>= ;></div><div><br></div><div><assign|my-env|<\macro|type|body><= /div><div> = <surround|<npage-break*><vspace*|0fn><no-indent>|<= vspace*|0fn>|<with|color|<my-color|<arg|type>>|<leftl= ined|<with|color|black|<arg|body>>>>></div><div></= macro>></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> is a = function written in Scheme that returns a color code from a keyword such = as <span class=3D"s1">idea</span>, <span = class=3D"s1">task</span>, <span class=3D"s1">tir</span>, and so = on.</li><li>The <span class=3D"s1">my-color</span> macro works = perfectly: I do get a color code depending on the chosen = keyword.</li><li>The <span class=3D"s1">my-env</span> macro = completely freezes TeXmacs. I am starting to wonder whether it is = actually possible to pass a function call to <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 <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--