From p.dalgaard at biostat.ku.dk  Wed Jan 14 18:26:25 2004
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Wed Jan 14 18:24:26 2004
Subject: [Rd] automatic "paste" filter to paste only the commands from a
	transcript on the clipboard
In-Reply-To: <5.2.1.1.2.20040113093145.037c3480@mailhost.blackmesacapital.com>
References: <5.2.1.1.2.20040113093145.037c3480@mailhost.blackmesacapital.com>
Message-ID: <x24quy4f26.fsf@biostat.ku.dk>

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


[Rd] automatic "paste" filter to paste only the commands from a transcript on the clipboard
Peter Dalgaard