[R-SIG-Mac] built-in editor underlining

jiho jo.irisson at gmail.com
Mon Sep 18 15:28:52 CEST 2006

Hello all,

I am adding some thoughts to this thread as I've been wanting to  
write about these matters for a while. First of all: I mostly use  
R.app and R.app built in editor on mac OS X 10.4 and find my workflow  
very productive this way so thank you for this great interface (which  
surpasses any of it's windows of linux counterparts IMHO).  
Nevertheless, things can always be better :-)

On 17 Sep 2006, at 04:52 , Simon Urbanek wrote:
> The build-in editor doesn't store any text attribute changes as the
> output is plain text. It does, however, allow text attribute changes,
> because they are used e.g. for syntax highlighting. Strictly speaking
> the bug is that you can use the <Cmd><U> command at all.
> Another approach would be to enhance the editor to support RTF format
> (internally it actually does allow it) which would allow you to use
> formatted text and store it. The drawback is that such a text is no
> longer executable directly in R, so you couldn't "source" it. I not
> quite sure what is more useful - I'm almost inclined to think that
> banning text format changes makes more sense, but I'm open to other
> suggestions...

everything in R (R files but console output also) being only text, I  
think it should be treated as such: i.e. no text attributes changes  
_by the user_ should be allowed.
In fact I personally find it annoying to see fonts faces and sizes  
conserved when I copy-paste code from a web page to the editor for  
example. Another "buggy" behavior: hitting CMD+I in R console by  
mistake, after a long time of work, causes a very long delay to  
format all console text in italics and the same delay is necessary to  
put everything back as it was in the first place.

IMHO a "better" behavior would be:
- to remove Format menu or restrict it to "Bigger" and "Smaller"  
given that this changes the size of all the text in the focused  
window (i.e. it is not possible to select text and make only this  
text bigger: this has no meaning for a text file)
- to set font and font size for console and editor in their  
respective tabs (syntax and console), for those (like me) who do not  
like system defaults

In the long run, if people absolutely want to have italics or  
underline text, more advanced syntax highlighting where fonts, font  
decorations, colors, etc. can be changed for each code category, can  
be a solution. (cf. as Xcode advanced syntax highlighting)

> From: Simon Urbanek <simon.urbanek at r-project.org>
> On Sep 17, 2006, at 3:05 AM, Parlamis Franklin wrote:
>> Re: syntax coloring.  I've turned it off because, when editing the
>> beginning of a long file, I would get a long delay (multiple
>> seconds) after I entered an open quotes (") as the rest of the
>> document changed color because all quotes were now matched
>> differently.
> Ok, I see - this is definitely something we can work on. I tend to
> split long scripts, because they are easier to manage, so I didn't
> see that behavior. Currently R.app does full highlighting for the
> entire file each time you change something. I guess a better approach
> would be to do the immediate highlighting only for a few dozen lines
> and update it asynchronously later (or on-demand). This shouldn't be
> too hard to do, I'll see if I can implement that it in the next few
> days..

I remarked this also. The solution many editors adopt is to colour  
until the end of the line only. For example in smultron, there is a  
check box in the preferences which says:
"Only colour till the end of the line if it can't find closing tag"

> From: Jörg Beyer <Beyerj at students.uni-marburg.de>
> a tip regarding syntax highlighting you may (or may not ;-) find  
> useful:
> I'm using BBEdit 7.1 to edit my R-files. Of course, as a  
> specialized tool,
> it is far superior compared with R.app's built-in editor (no insult
> intended). My workflow of editing-sourcing-editing is quite  
> comfortable --
> whether you switch to an internal or an external editor window  
> makes no
> difference.

One thing which make using R.app built in editor very comfortable is  
the ability to send code to R using CMD+E and CMD+ENTER. Do you  
emulate these functions in BBEdit? If yes how? I would really like to  
be able to use an external editor also, just for consistency between  
my different projects. Smultron is my editor of choice and it has R  
syntax highlighting but I don't know how to emulate these functions  
in it.

Once again, I am really happy with R.app as it is now. These are some  
features which could make me (and hopefully other people) even happier:
- multi-document editor window (with tabs or a drawer with documents  
names or...)
- quicker console output. I write this here because it may be related  
to syntax highlighting. when using R from the command line I never  
see any delay between console output (from commands such as cat or  
print) and the execution of R code while delay can be introduced when  
using R.app
- all-in-one-window interface (this has a name in GUI design which I  
cannot remember). if the editor is made multi-document capable,  
having one window with console on the left and editor + help on the  
right would be awesome IMHO. this would avoid having to dig through  
editor windows to find the help file you're looking for.

and last addition (but not really related to all this): if text  
inside help windows could be searchable that would greatly help too.

thanks again.



More information about the R-SIG-Mac mailing list