[Rd] feature request for page() and options()

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Thu, 31 May 2007 13:54:44 -0700


I have been playing around with a Qt based pager. One of the things I would like to be able to do is syntax highlighting for R code. This is mostly relevant with the page function, e.g.


The problem in this case is that the pager has no way of knowing whether the file it is showing contains R code (e.g. page(, method="print") need not produce valid R code); the name of the file is always produced by tempfile("Rpage."), so it looks like "/tmp/RtmpQfmyH8/Rpage.4a43d33f".

A simple solution is to use an appropriate file extension. Here's a trivial patch that implements this:

Index: src/library/utils/R/page.R

Unless there is a downside (or a better solution), I would like to see this feature added.

My second feature request is a bit more involved. options("pager") can be a function, which is how I have implemented my pager. I would like options("browser") and options("editor") to behave similarly, i.e. to have them be settable to functions as well. This seems to allow more flexibility, be consistent with S philosophy, and there shouldn't be any incompatibility as the defaults do not change.

This needs changes in a few different places, but if the idea seems acceptable, I am happy to supply a patch (I have a working implementation).


R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 31 May 2007 - 21:55:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 May 2007 - 22:33:58 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.