Tony Plate
2004-Jan-14 17:46 UTC
[Rd] automatic "paste" filter to paste only the commands from a transcript on the clipboard
Just for fun (and actually because I would use it too) I wrote a version of the "paste" menu command that assumes the clipboard contains a transcript, and just pastes the commands from it into the R console window (Windows GUI only). So, if something like this: > foo <- + 33 > foo * 3 [1] 99 > foo [1] 33 is on the clipboard, then the "paste commands" menu command will just paste foo <- 33 foo * 3 foo into the console window. (Resulting in this case in the original contents of the clipboard being reproduced in the console window.) Is anyone interested in having this functionality in R? If there's enough interest in this to incorporate it into R, I'll package it up as a patch (I did it in R 1.8.1). (BTW, I only implemented it for the Windows GUI, but it was pretty simple, so I'm sure if there's much interest someone could easily port it to other GUIs). -- Tony Plate
Peter Dalgaard
2004-Jan-14 18:24 UTC
[Rd] automatic "paste" filter to paste only the commands from a transcript on the clipboard
Tony Plate <tplate@blackmesacapital.com> writes:> Just for fun (and actually because I would use it too) I wrote a > version of the "paste" menu command that assumes the clipboard > contains a transcript, and just pastes the commands from it into > the R console window (Windows GUI only). > > So, if something like this: > > > foo <- > + 33 > > foo * 3 > [1] 99 > > foo > [1] 33 > > is on the clipboard, then the "paste commands" menu command will just paste > > foo <- > 33 > foo * 3 > foo > > into the console window. (Resulting in this case in the original contents > of the clipboard being reproduced in the console window.) > > Is anyone interested in having this functionality in R? > > If there's enough interest in this to incorporate it into R, I'll package it > up as a patch (I did it in R 1.8.1). (BTW, I only implemented it for the > Windows GUI, but it was pretty simple, so I'm sure if there's much > interest someone could easily port it to other GUIs).A similar item exists in ESS (Emacs Speaks Statistics): "M-x ess-clean-transcript" or thereabouts. Much loved by those who know it is there. A version that works on the contents of a Tk text widget might not be a half bad idea to have. -p -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907
Tony Plate
2004-Jan-14 18:40 UTC
[Rd] automatic "paste" filter to paste only the commands from a transcript on the clipboard
Yup, I use a version in Emacs -- didn't know about the ESS version, so I wrote my own... :-(. I use it all the time and I have it bound globally to C-x M-w so that I can use it from a buffer of any mode. However, it's a little cumbersome to go via Emacs when pasting from other applications. That's why I proposed a version that could work within R. -- Tony Plate At Wednesday 06:26 PM 1/14/2004 +0100, Peter Dalgaard wrote:>Tony Plate <tplate@blackmesacapital.com> writes: > > [deleted...] >A similar item exists in ESS (Emacs Speaks Statistics): "M-x >ess-clean-transcript" or thereabouts. Much loved by those who know it >is there. > >A version that works on the contents of a Tk text widget might not be >a half bad idea to have. > > -p > >-- > O__ ---- Peter Dalgaard Blegdamsvej 3 > c/ /'_ --- Dept. of Biostatistics 2200 Cph. N > (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 >~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907