[R-SIG-Mac] Xcode and R

David Winsemius dwinsemius at comcast.net
Fri Sep 18 23:20:56 CEST 2009

On Sep 18, 2009, at 4:49 PM, thatsanicehatyouhave at mac.com wrote:

> On 11 Sep 2009, at 04:21, Christophe Dutang wrote:
>> Does someone know if there is a way Xcode highlights the R syntax?  
>> just like aquamacs does?
> I think that's something you'd have to do yourself. It involves  
> creating two files, e.g.
> R.xclangspec
> R.pbfilespec
> that include the keywords and directions to Xcode. I don't know the  
> details of the internals of these files, but you can Google the  
> terms "xclangspec" and "pbfilespec". I'm attaching two files that  
> you can use as a starting point (I copied the python files to use as  
> a template). I haven't been able to get them to work though.  
> Finally, you'll need to install them in:
> ~/Library/Application Support/Apple/Developer Tools/Specifications

Thats not where I find such files on my system. All the .xclangspec  
files are in one directory
~me$ find /Developer -name \*.xclangspec
Snipped remaining 20 or so versions

Some of the .pbfilespec files are there althought there a acouple of  
other spots as well:

~me$ find /Developer -name \*.pbfilespec
Resources/Built-in file types.pbfilespec
Resources/Standard file types.pbfilespec
Resources/Interface Builder File Types.pbfilespec
Contents/Resources/Xdesign file types.pbfilespec

> I think. :)
> Let us know if you can get it to work.

When I drag those two files to that directory, Xcode does some  
highlighting but only of non-reserved words and comments, and also  
does "(" and "{" matching if you move the cursor forward over a ")" or  
"}", but not if the cursor is moved backwards.)  Also shows some code  
completion. I'm not sure what was _supposed_ to happen, but I do see  
some behavior that suggests _some_ of those efforts were having a  
desired effect.


> Cheers,
> Demitri
> < 
> R 
> .pbfilespec 
> ><R.xclangspec>_______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

More information about the R-SIG-Mac mailing list