[jedit:feature-requests] #557 Support syntax highlighting for R

goebbe via jEdit-devel <[email protected]> Thu, 16 Apr 2026 11:48:37 -0000
Newsgroups gmane.editors.jedit.devel
Message-ID </p/jedit/feature-requests/557/009fb3525c0b4f8406df51b597be0d4c01b2b58a.feature-requests@jedit.p.sourceforge.net>
This is a multi-part message in MIME format.
--===============3805447700798852950==
Content-Type: multipart/related; boundary="===============3014771823149467189=="

This is a multi-part message in MIME format.
--===============3014771823149467189==
Content-Type: multipart/alternative; boundary="===============3679881422060875211=="
MIME-Version: 1.0

--===============3679881422060875211==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

I did some final clean-ups and optimizations: 
- delete / optimize redundant regexp
- clean up highlighting of function names
- remove "label:" syntax - which does not exist in R
- add "T" and "F" as short version of "TRUE" and "FALSE" (default aliases in R).

I also attach a test file to check syntax highlighting of R-scripts. 

From my point of view this could go in. 


Attachments:

- [rlang.xml](https://sourceforge.net/p/jedit/feature-requests/_discuss/thread/c96acc3774/472b/attachment/rlang.xml) (3.3 kB; text/xml)
- [syntax_R_test.R](https://sourceforge.net/p/jedit/feature-requests/_discuss/thread/c96acc3774/472b/attachment/syntax_R_test.R) (8.5 kB; text/x-r-source)


---

**[feature-requests:#557] Support syntax highlighting for R  **

**Status:** open
**Group:** none
**Created:** Mon Apr 13, 2026 02:20 PM UTC by goebbe
**Last Updated:** Tue Apr 14, 2026 12:02 PM UTC
**Owner:** nobody
**Attachments:**

- [rlang.xml](https://sourceforge.net/p/jedit/feature-requests/557/attachment/rlang.xml) (2.4 kB; text/xml)


This is a feature request for supporting **syntax highlighting for R.**
R is a popular language for statistical analysis: https://www.r-project.org/about.html

R-programs use the **.R** or** .r** suffix. 
In Jedit 5.5 (LinuxMint), this suffix is used for rebol-language. 

However, 13 years ago, in 2013, rebol moved from .r to .reb as a new standard for suffixes: 
https://www.rebol.com/article/0540.html

I use the following mode entry for R: 
~~~xml
<MODE NAME="rlang"			FILE="rlang.xml"
        FILE_NAME_GLOB="*.{r,R}" />
~~~

The old rebol entry in the catalog file should probably be changed to: 
~~~xml
<MODE NAME="rebol"		FILE="rebol.xml"
        FILE_NAME_GLOB="*.reb" />
~~~

With respect to its syntax, R-lang has strong resemblance to S and Splus. 
For my personnel use, I just copied/ pasted the splus.xml syntax file, renamed it to rlang.xml and commented one single line. (For the use of "_" which is allowed in R, but not in Splus) 

I use this syntax highlighting successfully with different R-projects and didn't spot any problems. 

Best regards.




---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/jedit/feature-requests/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/feature-requests/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
--===============3679881422060875211==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<div class="markdown_content"><p>I did some final clean-ups and optimizations: </p>
<ul>
<li>delete / optimize redundant regexp</li>
<li>clean up highlighting of function names</li>
<li>remove "label:" syntax - which does not exist in R</li>
<li>add "T" and "F" as short version of "TRUE" and "FALSE" (default aliases in R).</li>
</ul>
<p>I also attach a test file to check syntax highlighting of R-scripts. </p>
<p>From my point of view this could go in. </p>
<p>Attachments:</p>
<ul>
<li><a href="https://sourceforge.net/p/jedit/feature-requests/_discuss/thread/c96acc3774/472b/attachment/rlang.xml">rlang.xml</a> (sourceforge.net) (3.3 kB; text/xml)</li>
<li><a href="https://sourceforge.net/p/jedit/feature-requests/_discuss/thread/c96acc3774/472b/attachment/syntax_R_test.R">syntax_R_test.R</a> (sourceforge.net) (8.5 kB; text/x-r-source)</li>
</ul>
<hr/>
<p>**<a class="alink" href="https://sourceforge.net/p/jedit/feature-requests/557/">[feature-requests:#557]</a> Support syntax highlighting for R  **</p>
<p><strong>Status:</strong> open<br/>
<strong>Group:</strong> none<br/>
<strong>Created:</strong> Mon Apr 13, 2026 02:20 PM UTC by goebbe<br/>
<strong>Last Updated:</strong> Tue Apr 14, 2026 12:02 PM UTC<br/>
<strong>Owner:</strong> nobody<br/>
<strong>Attachments:</strong></p>
<ul>
<li><a href="https://sourceforge.net/p/jedit/feature-requests/557/attachment/rlang.xml">rlang.xml</a> (sourceforge.net) (2.4 kB; text/xml)</li>
</ul>
<p>This is a feature request for supporting <strong>syntax highlighting for R.</strong><br/>
R is a popular language for statistical analysis: <a href="https://www.r-project.org/about.html" rel="nofollow">https://www.r-project.org/about.html</a></p>
<p>R-programs use the <strong>.R</strong> or<strong> .r</strong> suffix. <br/>
In Jedit 5.5 (LinuxMint), this suffix is used for rebol-language. </p>
<p>However, 13 years ago, in 2013, rebol moved from .r to .reb as a new standard for suffixes: <br/>
<a href="https://www.rebol.com/article/0540.html" rel="nofollow">https://www.rebol.com/article/0540.html</a></p>
<p>I use the following mode entry for R: </p>
<div class="codehilite"><pre><span></span><code><span class="nt">&lt;MODE</span><span class="w"> </span><span class="na">NAME=</span><span class="s">"rlang"</span><span class="w">          </span><span class="na">FILE=</span><span class="s">"rlang.xml"</span>
<span class="w">        </span><span class="na">FILE_NAME_GLOB=</span><span class="s">"*.{r,R}"</span><span class="w"> </span><span class="nt">/&gt;</span>
</code></pre></div>

<p>The old rebol entry in the catalog file should probably be changed to: </p>
<div class="codehilite"><pre><span></span><code><span class="nt">&lt;MODE</span><span class="w"> </span><span class="na">NAME=</span><span class="s">"rebol"</span><span class="w">      </span><span class="na">FILE=</span><span class="s">"rebol.xml"</span>
<span class="w">        </span><span class="na">FILE_NAME_GLOB=</span><span class="s">"*.reb"</span><span class="w"> </span><span class="nt">/&gt;</span>
</code></pre></div>

<p>With respect to its syntax, R-lang has strong resemblance to S and Splus. <br/>
For my personnel use, I just copied/ pasted the splus.xml syntax file, renamed it to rlang.xml and commented one single line. (For the use of "_" which is allowed in R, but not in Splus) </p>
<p>I use this syntax highlighting successfully with different R-projects and didn't spot any problems. </p>
<p>Best regards.</p>
<hr/>
<p>Sent from sourceforge.net because [email protected] is subscribed to <a href="https://sourceforge.net/p/jedit/feature-requests/">https://sourceforge.net/p/jedit/feature-requests/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/jedit/admin/feature-requests/options.">https://sourceforge.net/p/jedit/admin/feature-requests/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>
--===============3679881422060875211==--

--===============3014771823149467189==--


--===============3805447700798852950==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============3805447700798852950==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
-----------------------------------------------
jEdit Developers' List
[email protected]
https://lists.sourceforge.net/lists/listinfo/jedit-devel

--===============3805447700798852950==--