Skip to content

shared-mime-info (PR#8278)

5 messages · Vaidotas Zemlys, Peter Dalgaard, Paul Roebuck

#
Hi,

On 03 Nov 2005 12:41:53 +0100, Peter Dalgaard <p.dalgaard at biostat.ku.dk> wr=
ote:
d
or
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
#
mpiktas at gmail.com writes:
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.
#
Hi,
On 04 Nov 2005 13:51:56 +0100, Peter Dalgaard <p.dalgaard at biostat.ku.dk> wrote:

            
I already barked at upstream. The upstream barked back. The result is here:

https://bugs.freedesktop.org/show_bug.cgi?id=1782

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-Rsrc
2. R documentation files. File extension .Rd. Mimetype text/x-Rd
3. RData files. File extension .RData, files which at beginning have
RDX2. Mimetype application/x-RData.
4. Rhistory files. File extension .Rhistory. Mimetype text/x-Rhistory
5. R transcript files from ESS/Emacs. File extension .Rt. Mimetype
text/x-Rtranscript

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.

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.

Vaidotas Zemlys
--
Doctorate student, http://www.mif.vu.lt/katedros/eka/katedra/zemlys.php
Vilnius University
#
Vaidotas Zemlys <mpiktas at gmail.com> writes:
Aha... 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 ??)
My 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...
OK, modulo case-fold
Why the RDX2 bit?? We do have .RDA from windows, too.
OK.
.Rout, please. Also .Rout.save and .Rout.fail. (And it's not just
ESS that creates them).

Also

6. Rprofile files .Rprofile or Rprofile.
Some fun potential with gedit/Kate plugins too (ESS for the 21st
century anyone?)

  
    
17 days later
#
On Fri, 4 Nov 2005, Peter Dalgaard wrote:

            
What is the status of this problem report? Was a standard
set of MIME types ever established for the various R file
types? If so, where can I find them? The following seem
reasonable comparing against various sources, blended
with the above.


File types			MIME types
------------------------------	------------------------
.R				text/x-r,
                                text/x-r-source,
                                text/plain

.Rd				text/x-r-doc,
                                text/plain

.RData				application/x-r-data

.Rhistory			text/x-r-history,
                                text/plain

.Rout, .Rout.save, .Rout.fail	text/x-r-transcript,
                                text/plain

.Rprofile, Rprofile.site	text/x-r-profile,
				text/plain

.Renviron, Renviron		text/x-r-environ,
                                text/plain

I read long ago about suggestion for using dot-q for S
source but don't recall ever having seen it in the wild.
Peter mentioned dot-r as having been previously used for
Ratfor. It was also used by Rez on Mac OS. Also note that
dot-s is for assembly source.

Not sure if all of these even deserve MIME types. The first
three seem useful though the latter four could be dropped.

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)