[ESS] Drag and drop files into ESS buffers

Vitalie Spinu spinuvit at gmail.com
Fri Feb 10 13:20:19 CET 2012


>>>> Matthew Fidler <matthew.fidler at gmail.com>
>>>> on Thu, 9 Feb 2012 11:49:02 -0600 wrote:

  > I have created a ess drag and drop component. If you drag a CSV into an R
  > buffer, it writes the appropriate code to read the file.  It is
  > customizable to other ESS languages, dialects, and files.

  > Eventually I may put this on some repo somewhere, but currently it is at:

  > https://github.com/mlf176f2/ess-dnd

This sounds interesting. I think it's a more general idea - configure
dnd actions in accordance to the major mode. It should be a hook or
custom func in dnd itself. May be it's worth pushing to dnd.el
authors. Moreover several actions might be possible and a menu should
pop-up.

I tested it. You forgot to tell us about

(setq ess-drag-and-drop-active t)

to activate it. Also it's the ess-mode buffers and not the R buffer
where the dragging should go.

A couple of comments/ideas.

I am a dired and sunrise-commander user. So I would be interested in
dragging from a dired buffer. Any ideas?

It would be really nice to have automatic assignment of the data
frame. Say if I drag files foo.csv and boo.csv on the inferior *R*
buffer,  two data.frames automatically appear in my workplace - foo and
boo.

The same for  .Rdata file. Sometimes I would like to attach an .Rdata,
sometimes to load it into the workspace, sometimes just to view the
content. Would be really nice to have sort of a popping menu with all
this actions.

Also .R files. Shouldn't they be sourced,  or just opened? If sourced,
should they be sourced into the workspace or into an environment and
then attached?

What if I drag a directory? I would expect that all the files in a
directory to be processed accordingly.

So as you can see there is a lot more than just csv files and in order
for dnd to become a really useful feature it should seek to simplify a
very tedious, repetitive tasks.

It's a good start anyhow. There will be a ESS git mirror on GitHub
soon and I hope you can continue developing this extension as part of
your fork, so we all can easily test and contribute.

Best,
Vitalie.



More information about the ESS-help mailing list