Full_Name: Vaidotas Zemlys Version: 2.1.1 OS: Ubuntu 05.10 Submission from: (NULL) (213.197.173.50) Hi, This is really a feature request, not a bug. I wrote the mail to R-devel, but nobody answered it. I use Gnome on my computer and sometimes I use its default text editor gedit. It uses gtksourceview library for syntax highlighting. I decided that it would be nice if gedit supported R syntax. So I created apropriate .lang file: http://bugzilla.gnome.org/show_bug.cgi?id=157370 Gedit picks apropriate lang file according to file mimetype, so I created apropriate mime type for files with extension .R. I filed a bug report at freedesktop.org: https://freedesktop.org/bugzilla/show_bug.cgi?id=1782 There Christophe Fergeau suggested that maybe R could take care of installing this mime type by itself. Is it possible? As I understand it would only concern Linux installations and R should cooperate with shared-mime-info package which is responsible for all mime type definitions. Vaidotas Zemlys
We do not usually put features in R which are specific to just some distributions of some OSes, and in this case to one editor on those. We do not for example include the ESS mode for the much-more-widely-used Emacs family of editors. This looks as if it might be appropriate to the Linux binary packages for R, so I suggest you contact their maintainers. But my understanding is that this is an issue for gedit and not for R. Indeed .R is just a convention (one of many choices, including .r and .q) for R itself. I do wonder why you concentrated on .R files and not .Rd files, where I find syntax highlighting more useful. On Thu, 3 Nov 2005 mpiktas at gmail.com wrote:> Full_Name: Vaidotas Zemlys > Version: 2.1.1 > OS: Ubuntu 05.10 > Submission from: (NULL) (213.197.173.50) > > > Hi, > > This is really a feature request, not a bug. I wrote the mail to R-devel, > but nobody answered it.That's generally a sign of lack of interest, and also in your case that you fail to sign your emails, a basic courtesy especially for people using an anonymous email address.> I use Gnome on my computer and sometimes I use its default text editor > gedit. It uses gtksourceview library for syntax highlighting. I > decided that it would be nice if gedit supported R syntax. So I > created apropriate .lang file: > http://bugzilla.gnome.org/show_bug.cgi?id=157370 > > Gedit picks apropriate lang file according to file mimetype, so I > created apropriate mime type for files with extension .R. I filed a bug > report at freedesktop.org: > https://freedesktop.org/bugzilla/show_bug.cgi?id=1782 > > There Christophe Fergeau suggested that maybe R could take care of > installing this mime type by itself. Is it possible? As I understand it would > only concern Linux installations and R should cooperate with shared-mime-info > package which is responsible for all mime type definitions. > > Vaidotas ZemlysNB: signature missing -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Hi, On 03 Nov 2005 12:41:53 +0100, Peter Dalgaard <p.dalgaard at biostat.ku.dk> wrote:> ripley at stats.ox.ac.uk writes: > > > We do not usually put features in R which are specific to just some > > distributions of some OSes, and in this case to one editor on those. > > We do not for example include the ESS mode for the much-more-widely-used > > Emacs family of editors. > > > > This looks as if it might be appropriate to the Linux binary packages for > > R, so I suggest you contact their maintainers. But my understanding is > > that this is an issue for gedit and not for R. Indeed .R is just a > > convention (one of many choices, including .r and .q) for R itself. > > > > I do wonder why you concentrated on .R files and not .Rd files, where I > > find syntax highlighting more useful. > > Mime-types shouldn't be distribution-specific or even editor-specific, > should they? The whole point is that they can be used for things like > email attachments that pass from one OS to the other. > > It might be useful to have the mime-type definitions for R (and Rd) > files centralized in R core, with the appropriate OS conventions > systematized. But I think we need to know more. Who keeps track of > mime-types? Can we just grab text/x-R (and text/x-Rd and > application/x-Rdata)? To which extent the XML format a standard; is it > only used by particular applications? > >As far as I know, at least in Debian, the mimetypes are tracked by shared-mime-info package. The upstream is freedesktop.org. I do not know about oficial standarts, but Gnome and KDE tries to adher to some of the freedesktop.org standarts. I can confirm that mimetypes provided by shared-mime-info are widely used in Gnome, for some time now. Vaidotas Zemlys -- Doctorate student, http://www.mif.vu.lt/katedros/eka/katedra/zemlys.php Vilnius University
Vaidotas Zemlys <mpiktas at gmail.com> writes:> Hi, > > On 04 Nov 2005 13:51:56 +0100, Peter Dalgaard <p.dalgaard at biostat.ku.dk> wrote: > > > One further thought about this: > > > > On SUSE, > > > > rpm -qif /usr/share/mime/ > > > > points at > > > > http://www.freedesktop.org/wiki/Software_2fshared_2dmime_2dinfo > > > > So I guess that the proper tree to bark at is the upstreams > > maintainers of > > > > http://freedesktop.org/~jrb/shared-mime-info-*.tar.gz > > > > Instructions there say to submit new XML files to > > > > https://bugs.freedesktop.org/buglist.cgi?product=shared-mime-info&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED > > > > It would likely be a good idea to send them first to R-devel for review. > > > > I already barked at upstream. The upstream barked back. The result is here: > > https://bugs.freedesktop.org/show_bug.cgi?id=1782Aha... This is pretty weird, in light of the prescription on the website: << Shared MIME database package The core database and the update-mime-database program for extending it are available from the [WWW]software pages. If you have added types that should go in the common freedesktop.org base list of types, you should create an enhancement request on [WWW]the MIME bugtracker with your new XML file.>>If the procedure is different, perhaps we should ask them what it is? I don't think we have a real problem with maintaining a "freedesktop" subdir somewhere in the sources since it appears to cover quite a wide range of systems, but we don't seem to know what to do with it. The procedure appears to be different between Linuxen: On SUSE, I get viggo:~/>rpm -qf /usr/share/mime/text/x-texinfo.xml shared-mime-info-0.15.cvs20050321-3 whereas FC4 has [pd at janus ~]$ rpm -qf /usr/share/mime/text/x-texinfo.xml file /usr/share/mime/text/x-texinfo.xml is not owned by any package (and likewise 60-odd other .xml files). So it seems that SUSE collects all this stuff in a single RPM and FC4 lets it be handled by the post-install mechanism (on each package or by "exploding" freedesktop.org.xml ??)> There you can find xml file for R scripts. I've made it from some > example. It is really only a proof of a concept. But it would not be > very difficult to produce xml files for mimetypes of all R related > files. We must only decide which R related files would benefit from > having mimetypes. > > My proposal is > 1. R source code, R scripts. Files with extensions .R, .r and others > (.q?, .s?, .S?). Mimetypes text/x-R, text/x-RsrcMy inclination would be to stick with .R, possibly adding .r to guard against Windows case-folding issues, but .r used to be Ratfor files. .q/.s/.S are used by some people supporting both R and S-PLUS, but I don't think they care how such files are displayed by Nautilus and Konqueror...> 2. R documentation files. File extension .Rd. Mimetype text/x-RdOK, modulo case-fold> 3. RData files. File extension .RData, files which at beginning have > RDX2. Mimetype application/x-RData.Why the RDX2 bit?? We do have .RDA from windows, too.> 4. Rhistory files. File extension .Rhistory. Mimetype text/x-RhistoryOK.> 5. R transcript files from ESS/Emacs. File extension .Rt. Mimetype > text/x-Rtranscript.Rout, please. Also .Rout.save and .Rout.fail. (And it's not just ESS that creates them). Also 6. Rprofile files .Rprofile or Rprofile.> The relevant xml code could be pushed upstream to end up in > freedesktop.org.xml, or it could be distributed with R linux package, > and installed into relevant subdirectory of /usr/share/mime. With a > bit more work the result could be, that people using for example > Nautilus (graphical Gnome browser) could see R related files displayed > with R logo, and clicking them could result in various appropriate > actions. For example for .RData R process could be iinvoked and > relevant .RData file could be loaded.Some fun potential with gedit/Kate plugins too (ESS for the 21st century anyone?)> I could write and test the xml code. But first we have to agree on > which files benefit from having mimetypes and how the mimetypes should > be named. Feel free to suggest.-- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Paul Roebuck <roebuck at mdanderson.org> writes:> On Fri, 4 Nov 2005, Peter Dalgaard wrote: > > > Vaidotas Zemlys <mpiktas at gmail.com> writes: > > > > > [SNIP] > > > > > > > Also > > > > 6. Rprofile files .Rprofile or Rprofile. > > > > .Renviron?Yes, but you seem to have forgotten to keep r-devel in the circuit... -- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907