<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[UDL: set multicharacters delimitators/keywords that also accept escaping characters to neglet]]></title><description><![CDATA[<p dir="auto">Hello everyone,<br />
I’m trying to extend the (La)Tex markup language by adding some custom commands. To do so, I created a new user-defined language in the UDL window.<br />
I already managed to have it recognised my “sectioning” style (comments +“%#%“to start a section and “%##%” to end it) and other features.<br />
Now I would like to recognize (and possibly fold) the “\if*” - “\else” - “\fi” parts (introduced with package “ifthen”).<br />
If I manually set ALL the possibles “\if*” / “@if*” flags manually (folding style 2), it works, but if I try to generalize it by adding “\if*” to folding style 1, it recognise everything, including the definition of new custom “\if*” (”\newif\if*”) and try to fold it too much.<br />
My idea was then to try to set the “\if*” command as an opening operator, “\fi” as closing one and “\newif” as an escape sequence, but UDL seems to recognise only single escape characters.<br />
What am I doing wrong? Is there a way to fix it? How?<br />
Thanks in advance,<br />
Jacopo</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27642/udl-set-multicharacters-delimitators-keywords-that-also-accept-escaping-characters-to-neglet</link><generator>RSS for Node</generator><lastBuildDate>Tue, 25 Aug 2026 16:08:35 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27642.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Aug 2026 12:29:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to UDL: set multicharacters delimitators/keywords that also accept escaping characters to neglet on Tue, 25 Aug 2026 15:21:13 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jacopo-remondina" aria-label="Profile: Jacopo-Remondina">@<bdi>Jacopo-Remondina</bdi></a> <a href="/post/106180">said</a>:</p>
<p dir="auto">new custom “\if*” (”\newif\if*”)</p>
</blockquote>
<p dir="auto">Hmm, re-reading, I am wondering if I have misunderstood.  Maybe the asterisk really is a literal part of your syntax.  And you weren’t treating it as a wildcard, because <code>\newif</code> doesn’t match the pattern implied by you thinking of asterisk as a wildcard.</p>
<p dir="auto">Maybe if you showed a small snipped of code (use the <code>&lt;/&gt;</code> button in the toolbar to give a place between ``` to paste something like quote-delimiter-MCescape example, or my if/else/fi example:</p>
<pre><code>```
"this is quoted delim"

"a b c MC" x y z"
```

or

```
\if something
    blah
\else something else
    blah
\fi the end
```
</code></pre>
<p dir="auto">And also show a screenshot (you can just paste the screenshot directly into your reply from your Windows clipboard), which shows the syntax-highlighted text in N++ plus the relevant portion of the UDL dialog (similar to my screenshot), it would help with understanding.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106182</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106182</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 25 Aug 2026 15:21:13 GMT</pubDate></item><item><title><![CDATA[Reply to UDL: set multicharacters delimitators/keywords that also accept escaping characters to neglet on Tue, 25 Aug 2026 15:17:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jacopo-remondina" aria-label="Profile: Jacopo-Remondina">@<bdi>Jacopo-Remondina</bdi></a></p>
<p dir="auto"><code>\if*</code> means "literal backslash <code>\</code> followed by literal <code>if</code> followed by literal asterisk <code>*</code> – so it’s not going to match unless there’s a literal asterisk character.  <code>*</code> is not a wildcard that means “anything” in the UDL definitions.</p>
<p dir="auto">But if you just use <code>\if</code> in the no-spaces-required (<strong>folding in code 1 style</strong>), it will allow you to have <code>\if</code> followed by anything, and it will still fold (though, admittedly, it won’t <em>color</em> the stuff after the portion that’s specified in the folding OPEN)</p>
<p dir="auto"><img src="/assets/uploads/files/1787670022362-5ab43856-bb96-4e8a-81c3-d1244e0fd4ed-image.jpeg" alt="5ab43856-bb96-4e8a-81c3-d1244e0fd4ed-image.jpeg" class=" img-fluid img-markdown" /></p>
<blockquote>
<p dir="auto">My idea was then to try to set the “\if*” command as an opening operator, “\fi” as closing one and “\newif” as an escape sequence</p>
</blockquote>
<p dir="auto">There aren’t escape sequences in the folding, so have you switched to a delimiter rather than folding?  If you have <code>\if</code> in <em>both</em> folding <em>and</em> in the delimiter section, the folding will “win” (Notepad++ parses things in a specific order, so if it recognizes it as a folding sequence, it won’t get a chance to see if it’s a delimiter).</p>
<p dir="auto">And <code>*</code> doesn’t mean “wildcard”, even in the delimiters.</p>
<p dir="auto">But I don’t think you <em>want</em> delimiters, because that will highlight everything from the OPEN to the CLOSE of the delimiter as being part of that…  Delimiters are for things like <code>"blah blah blah"</code> and <code>'something goes here' and </code>(one, two, three)`, so that everything from the open to the close it treated as a single unit.  I would assume that you don’t want everything within the if-fi to be treated similar to a string.</p>
<blockquote>
<p dir="auto">UDL seems to recognise only single escape characters.</p>
</blockquote>
<p dir="auto">Not true.  The escape is a sequence that goes before a CLOSE to make it <em>not</em> close, so you have to use it as such.</p>
<p dir="auto">For example, if you have OPEN and CLOSE for delimiter as <code>"</code> double-quote marks, then normally <code>"a b c MC" x y z"</code> would stop the string at the <code>"</code> after the MC:<br />
<img src="/assets/uploads/files/1787670344032-3851f311-28ed-4475-89ec-ecca373e83aa-image.jpeg" alt="3851f311-28ed-4475-89ec-ecca373e83aa-image.jpeg" class=" img-fluid img-markdown" /></p>
<p dir="auto">… but if you use the ESCAPE value of MC (which is obviously multi-character), then if that escape goes right before the quote, then the escaped quote won’t be treated as a CLOSE token, and the string will go all the way to the <code>z"</code> at the end:<br />
<img src="/assets/uploads/files/1787670400953-4d8da7f2-7f55-4d4a-94ec-c6c0c828a123-image.jpeg" alt="4d8da7f2-7f55-4d4a-94ec-c6c0c828a123-image.jpeg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/106181</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106181</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 25 Aug 2026 15:17:23 GMT</pubDate></item></channel></rss>