[R] Everything You Need for JEdit/R Edit Mode

Zed Shaw zedshaw at zedshaw.com
Wed Apr 24 12:52:20 CEST 2002


After a couple of e-mails asking how to get this to work, I decided that
I would send out a quick message with the stuff you need and
instructions on how to use it.

I've attached the two files you need to get the R syntax coloring and
indenting to work with JEdit.  They are just XML files.

Here's what you do:

1)  Copy these two files to your .jedit/modes directory.  Depending on
what you are running jedit on, this modes directory may be in a
different place.  There are two basic modes directories:  the jedit one
and yours.  The jedit one has lots of XML files already in it.  DO NOT
PUT MY FILES IN THIS DIRECTORY!!!!!  You will be sorry.  The modes
directory you want is probably in your home directory, in the .jedit
directory, and should have nothing in it.

2)  Once these files are in there, you'll have to resolve a conflict
between R file endings and REBOL file endings (both *.r in
case-insensitive land).  To do this, go to Utilities->Global
Options->Mode-Specific.  Select "REBOL" from the pulldown at the top
(look right).  Uncheck the, "Use default settings" check box.  Change
the "File name glob" to be *.rebol.  (NOTE:  If, in the rare event that
you actually do both REBOL and R, then you'll have to figure out how to
resolve this another way).  Click OK to save the changes.

3)  Restart JEdit and try an R file.  Everything should be fine.  If it
still doesn't work, but words like "to do" are bold, then you didn't
resolve the problem with REBOL files.  Try step 2 again.


Most of this was taken from the JEdit help feature, under "Writing Edit
Modes".  Take a look at it and see if you can improve on what I have.
Most of what you see is straight out of the R grammar specs, but I'm not
sure what functions in R should be considered keywords.  For example,
would you consider "plot" a keyword, or a function.

Anyway, enjoy.  And feel free to contact me if you still have problems.


-------------- next part --------------
<?xml version="1.0"?>
<!DOCTYPE MODES SYSTEM "catalog.dtd">

<MODES>

<!-- Add lines like the following, one for each edit mode you add: -->
<!-- <MODE NAME="foo" FILE="foo.xml" FILE_NAME_GLOB="*.foo" /> -->
		<MODE NAME="RS" FILE="RS.xml" FILE_NAME_GLOB="*.R" FIRST_LINE_GLOB="" />
</MODES>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RS.xml
Type: text/xml
Size: 2270 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20020424/fd232401/RS.xml


More information about the R-help mailing list