Re: [rkward-devel] [rkward-cvs] [rkward] rkward: erm, ok, here are the missing files to the last commit...

2014-11-28 Thread meik michalke
hi,

Am Freitag, 28. November 2014, 08:04:57 schrieb Thomas Friedrichsmeier:
 On Friday 28 November 2014 01:07:40 meik michalke wrote:
  are you sure?
 
 no. Except perhaps no the part about shipping both mime-types in one file.

good point -- i did that, and i also renamed the file to vnd.rkward.r.xml, 
which makes it a vendor-specific MIME type declaration. that makes it possible 
for us to define that MIME type without colliding with other packages doing 
the same. the original XML file is now being installed to 
/usr/share/mime/packages, but XDG does also automatically generate 
/usr/share/mime/text/r.xml and /usr/share/mime/application/rdata.xml from it. 
in effect it's the same result.

 I'm still somewhat worried about future clashes. _If_ R ever decides to
 start shipping these mime-types, RKWard is going to get the blame for
 conflicting names, I'm afraid.

i hope this is solved for good now. the hint to libreoffice.xml was useful and 
led me to the vnd.* files.

i'll try and test if this and the protocol handler also works on OS X. can you 
check that on windows?

  and if you click on an *.RData file, you're asked *once* whether the
  workspace should be saved -- after that, the current worspace is just
  silently replaced with the content of any other RData file you click.
 
 I changed that a bit, and yes, it might be buggy, but I think you should
 find, the behavior is now:
 - If a workspace has just been loaded, and not been touched, don't ask
 whether to save it before quitting / replacing it.
 - If you touch some object in between, you should be prompted, again.

right, i missed that part -- i was just baffled that rkward switched from one 
workspace to another without asking, and i was wondering what that would do to 
one's data if you accidentally clicked on a *.RData file... but that's a good 
solution now.

 - Now as to why you're prompted for the initial - probably empty -
 workspace: It's that .Random.seed that gets created some time in the middle
 of starting up. Did not think up a nice way to cope with that, yet.

actually, that is something that has always annoyed me a bit: i start RKWard 
and want to *open* a previous workspace, but the first thing i get is a 
question whether to *save* the workspace. good thing if that was gone.

do we have to care for that single .Random.seed object when one wants to open 
another workspace anyway?

  single objects can't be added to the workspace this way either. there
  should probably be two methods for handling *.RData files: complete
  workspace or individual R objects,
 
 True.

KDE knows this as service menus, i can try to write an according *.desktop 
file as well. then you'd have to actively open the file via right click. that 
would need another option for the rkward binary.

alternatively, RKWard could ask you how to deal with the input: replace 
current workspace or add all objects to the current one. do you know whether 
there's a difference between *.RData files containing saved workspaces and 
saved R objects? if there was, we could add a magic section to the MIME 
type, which would cause the first bits of a file to be read to get its type.

  and you should always be asked before
  your workspace is wiped.
 
 Really?

no, its fine as it is (except maybe for the initial workspace).


viele grüße :: m.eik

-- 
  dipl. psych. meik michalke
  institut fur experimentelle psychologie
  abt. fur diagnostik und differentielle psychologie
  heinrich-heine-universitat d-40204 dusseldorf

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] [rkward-cvs] [rkward] rkward: erm, ok, here are the missing files to the last commit...

2014-11-28 Thread Thomas Friedrichsmeier
On Friday 28 November 2014 16:20:10 meik michalke wrote:
 good point -- i did that, and i also renamed the file to vnd.rkward.r.xml,
 which makes it a vendor-specific MIME type declaration. that makes it
 possible for us to define that MIME type without colliding with other
 packages doing the same.

Ah, yes, that sounds much better!

 i'll try and test if this and the protocol handler also works on OS X. can
 you check that on windows?

Will try to remember. I have an inkling it's going to require adding it to the 
registry, though...

 actually, that is something that has always annoyed me a bit: i start RKWard
 and want to *open* a previous workspace, but the first thing i get is a
 question whether to *save* the workspace. good thing if that was gone.

Yes. I'll try to come up with something.
 
 do we have to care for that single .Random.seed object when one wants to
 open another workspace anyway?

No, but how to tell it apart for other, more interesting objects, reliably. I 
think the solution will have to involve something like marking the workspace 
as clean, at an appropriate point in the startup sequence, and then only 
asking to save, if it was modified after that.

 alternatively, RKWard could ask you how to deal with the input: replace
 current workspace or add all objects to the current one. do you know whether
 there's a difference between *.RData files containing saved workspaces and
 saved R objects? if there was, we could add a magic section to the MIME
 type, which would cause the first bits of a file to be read to get its
 type.

I don't think so. ?save.image says: save.image() is just a short-cut for 
‘save my current workspace’, i.e., save(list = ls(all = TRUE), file = 
.RData). Even if you could tell how it was saved, that still doesn't tell, 
reliably, how you'd like to use it. In general, there are three options:
  - Replace current workspace
  - Merge with current workspace (potentially overwriting objects)
  - Import into a sub-environment
And then, if a .workplace-file exists to go with that, for the first two, 
there's also the question, whether to load that, and if so, whether to close 
all other windows first...

So - a whole lot of options, really. I guess a plan could look like this: In 
the menu, provide two actions: One is the current behavior. The second 
(perhaps called Import Workspace...?) would offer all applicable choices. If 
there is a request to open a workspace file in a running session (from 
RKWard's own filebrowser, or externally), and the current workspace is not 
empty, use that second action, too.

Regards
Thomas

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] [rkward-cvs] [rkward] rkward: erm, ok, here are the missing files to the last commit...

2014-11-27 Thread meik michalke
hi,

Am Donnerstag, 27. November 2014, 19:43:58 schrieb Thomas Friedrichsmeier:
 On Thursday 27 November 2014 15:44:45 m. eik michalke wrote:
  A  +12   -0rkward/r.xml
  A  +13   -0rkward/rdata.xml
 
 these work nicely for me. However, I think they should be merged into one
 mime file, and that should be called rkward.xml . So there's no significant
 risk that this could clash (now or later) with (R-) mime types declared
 from other sides.

are you sure? i mean, these file types are not really RKWard files, but 
ordinary R files, so i'd say their MIME type can only be R or R data, 
respectively. the connection between these MIME types and applications is 
defined in *.desktop files instead, where one MIME type can have multiple 
associations. i'd find it a bit confusing if there were such pseudo-MIME types 
like, say, firefox.xml, chrome.xml and rekonq.xml, all for *.html files.

of course it would be better to have these global MIME types rather defined by 
either R or KDE itself, so RKWard can just assume they're there. but from what 
i found on the net, this has not been accomplished for many many years. there 
still doesn't seem to be any package defining a MIME type for R files yet, at 
least in the realm of ubuntu and CRAN packages.

btw. there's some other issues: RKWard doesn't recognise *.rda files yet; and 
if you click on an *.RData file, you're asked *once* whether the workspace 
should be saved -- after that, the current worspace is just silently replaced 
with the content of any other RData file you click. single objects can't be 
added to the workspace this way either. there should probably be two methods 
for handling *.RData files: complete workspace or individual R objects, and 
you should always be asked before your workspace is wiped.


viele grüße :: m.eik

-- 
  dipl. psych. meik michalke
  institut fur experimentelle psychologie
  abt. fur diagnostik und differentielle psychologie
  heinrich-heine-universitat d-40204 dusseldorf

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] [rkward-cvs] [rkward] rkward: erm, ok, here are the missing files to the last commit...

2014-11-27 Thread Thomas Friedrichsmeier
Hi,

On Friday 28 November 2014 01:07:40 meik michalke wrote:
 Am Donnerstag, 27. November 2014, 19:43:58 schrieb Thomas Friedrichsmeier:
  On Thursday 27 November 2014 15:44:45 m. eik michalke wrote:
   A  +12   -0rkward/r.xml
   A  +13   -0rkward/rdata.xml
  
  these work nicely for me. However, I think they should be merged into one
  mime file, and that should be called rkward.xml . So there's no
  significant
  risk that this could clash (now or later) with (R-) mime types declared
  from other sides.
 
 are you sure?

no. Except perhaps no the part about shipping both mime-types in one file.

 i mean, these file types are not really RKWard files, but
 ordinary R files, so i'd say their MIME type can only be R or R data,
 respectively. the connection between these MIME types and applications is
 defined in *.desktop files instead,

Ah, in fact I had missed that part. Sounds more sane, now that I understand 
that.

 where one MIME type can have multiple
 associations. i'd find it a bit confusing if there were such pseudo-MIME
 types like, say, firefox.xml, chrome.xml and rekonq.xml, all for *.html
 files.
 
 of course it would be better to have these global MIME types rather defined
 by either R or KDE itself, so RKWard can just assume they're there. but
 from what i found on the net, this has not been accomplished for many many
 years. there still doesn't seem to be any package defining a MIME type for
 R files yet, at least in the realm of ubuntu and CRAN packages.

So probably the cleanest solution would be having them added to R... Oh well.

I'm still somewhat worried about future clashes. _If_ R ever decides to start 
shipping these mime-types, RKWard is going to get the blame for conflicting 
names, I'm afraid. That's why my first thought was naming it rkward.xml 
(similar to libreoffice.xml, which also declares .xls, for instance). But no, 
I'm not sure.

 btw. there's some other issues: RKWard doesn't recognise *.rda files yet;

Ok, will add.

 and if you click on an *.RData file, you're asked *once* whether the
 workspace should be saved -- after that, the current worspace is just
 silently replaced with the content of any other RData file you click.

I changed that a bit, and yes, it might be buggy, but I think you should find, 
the behavior is now:
- If a workspace has just been loaded, and not been touched, don't ask whether 
to save it before quitting / replacing it.
- If you touch some object in between, you should be prompted, again.
- Now as to why you're prompted for the initial - probably empty - workspace: 
It's that .Random.seed that gets created some time in the middle of starting 
up. Did not think up a nice way to cope with that, yet.

 single objects can't be added to the workspace this way either. there
 should probably be two methods for handling *.RData files: complete
 workspace or individual R objects,

True.

 and you should always be asked before
 your workspace is wiped.

Really?

Regards
Thomas

signature.asc
Description: This is a digitally signed message part.
--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel