This page is no longer maintained — Please continue to the home page at www.scala-lang.org

:paste and history in the REPL

7 replies
Seth Tisue
Joined: 2008-12-16,
User offline. Last seen 34 weeks 3 days ago.

I love :paste. I use it many times a day.

It occurred to me today that stuff pasted into the REPL via :paste
probably shouldn't become part of the history when you up-arrow through
it. I'm typically pasting 5 or 10 or 20 or 50 lines of code, and it's
annoying to have to up-arrow through all that stuff to get to the last
expression I actually typed myself with my fingers.

Would this change be a bad idea for some reason? If I opened a ticket,
would it just get closed as invalid for some reason I'm not seeing...?

I can imagine this might not be totally trivial to implement since
:paste'd code should certainly be considered part of the history for
:replay purposes, just not for up-arrow-ing purposes.

Viktor Klang
Joined: 2008-12-17,
User offline. Last seen 1 year 27 weeks ago.
Re: :paste and history in the REPL
Shouldn't each :paste be considered to be 1 up/down arrow

On Thu, Aug 4, 2011 at 8:21 PM, Seth Tisue <seth@tisue.net> wrote:

I love :paste.  I use it many times a day.

It occurred to me today that stuff pasted into the REPL via :paste
probably shouldn't become part of the history when you up-arrow through
it.  I'm typically pasting 5 or 10 or 20 or 50 lines of code, and it's
annoying to have to up-arrow through all that stuff to get to the last
expression I actually typed myself with my fingers.

Would this change be a bad idea for some reason?  If I opened a ticket,
would it just get closed as invalid for some reason I'm not seeing...?

I can imagine this might not be totally trivial to implement since
:paste'd code should certainly be considered part of the history for
:replay purposes, just not for up-arrow-ing purposes.

--
Seth Tisue | Northwestern University | http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/



--
Viktor Klang

Akka Tech LeadTypesafe - Enterprise-Grade Scala from the Experts

Twitter: @viktorklang
Richard Wallace
Joined: 2009-07-14,
User offline. Last seen 42 years 45 weeks ago.
Re: :paste and history in the REPL

+1. I've wished for this several times in the past week.

2011/8/4 √iktor Ҡlang :
> Shouldn't each :paste be considered to be 1 up/down arrow
>
> On Thu, Aug 4, 2011 at 8:21 PM, Seth Tisue wrote:
>>
>> I love :paste.  I use it many times a day.
>>
>> It occurred to me today that stuff pasted into the REPL via :paste
>> probably shouldn't become part of the history when you up-arrow through
>> it.  I'm typically pasting 5 or 10 or 20 or 50 lines of code, and it's
>> annoying to have to up-arrow through all that stuff to get to the last
>> expression I actually typed myself with my fingers.
>>
>> Would this change be a bad idea for some reason?  If I opened a ticket,
>> would it just get closed as invalid for some reason I'm not seeing...?
>>
>> I can imagine this might not be totally trivial to implement since
>> :paste'd code should certainly be considered part of the history for
>> :replay purposes, just not for up-arrow-ing purposes.
>>
>> --
>> Seth Tisue | Northwestern University | http://tisue.net
>> lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/
>
>
>
> --
> Viktor Klang
>
> Akka Tech Lead
> Typesafe - Enterprise-Grade Scala from the Experts
>
> Twitter: @viktorklang
>

extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: :paste and history in the REPL

On 8/4/11 11:24 AM, √iktor Ҡlang wrote:
> Shouldn't each :paste be considered to be 1 up/down arrow

https://issues.scala-lang.org/browse/SI-1067

It's harder than it looks. I have implemented it a few different ways
by now, none of which I found acceptable. It is possible that recent
jline improvements reopen formerly failed avenues.

> It occurred to me today that stuff pasted into the REPL via :paste
> probably shouldn't become part of the history when you up-arrow through
> it.

Yes, it's highly suboptimal as it is, it's just that ideal fixes are
time consuming and it's not clear what the right expediences are.

Seth Tisue 2
Joined: 2011-07-21,
User offline. Last seen 42 years 45 weeks ago.
Re: :paste and history in the REPL
On Thursday, August 4, 2011 2:52:52 PM UTC-4, Paul Phillips wrote:
On 8/4/11 11:24 AM, √iktor Ҡlang wrote:
> Shouldn't each :paste be considered to be 1 up/down arrow

https://issues.scala-lang.org/browse/SI-1067


Ah. My JIRA fu failed me. Well, I added a comment about :paste to the ticket and edited the description to make it easier to find. Thanks.
-- Seth Tisue | Northwestern University | http://tisue.netlead developer, NetLogo: http://ccl.northwestern.edu/netlogo/

Stefan Wagner
Joined: 2011-04-08,
User offline. Last seen 42 years 45 weeks ago.
Re: :paste and history in the REPL

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Seth, Hi List,

> I love :paste. I use it many times a day.
>
> It occurred to me today that stuff pasted into the REPL via :paste
> probably shouldn't become part of the history when you up-arrow through
> it.

When a question with code is written to StackOverflow for example, I
paste it into my REPL, and then look what's wrong, and want to edit it.
Then I need to iterate over the lines, to pick the one, that I wish to
modify.

Sometimes, jumping over a block would be useful, but not always, for me.

Alex Repain
Joined: 2010-07-27,
User offline. Last seen 1 year 31 weeks ago.
Re: :paste and history in the REPL


2011/8/8 Stefan Wagner <hirnstrom@arcor.de>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Seth, Hi List,

> I love :paste.  I use it many times a day.
>
> It occurred to me today that stuff pasted into the REPL via :paste
> probably shouldn't become part of the history when you up-arrow through
> it.

When a question with code is written to StackOverflow for example, I
paste it into my REPL, and then look what's wrong, and want to edit it.
Then I need to iterate over the lines, to pick the one, that I wish to
modify.

Sometimes, jumping over a block would be useful, but not always, for me.


Then would it be possible to divide the command into two distinct commands ? upArrow to go line by line and [something]+upArrow to go block by block (the two would become equivalent for one-liner blocks) ? It would be almost transparent for people who currently use the line-by-line, and big plus for those who wiqsh to travel block by block.


- --

Tschööö--->...Stefan
- ---------------------------
Don't visit my homepage at:
http://home.arcor-online.net/hirnstrom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4/8DwACgkQQeATqGpDnRpJ9ACfcoRtYxQ6Zpo8KoyEyGvxbQEj
9FMAoKGYX51agtK62eknW+LWygXK2J5V
=r/Bn
-----END PGP SIGNATURE-----



--
Alex REPAIN
ENSEIRB-MATMECA - student
TECHNICOLOR R&D - intern
BORDEAUX I      - master's student
SCALA           - enthusiast


Stefan Wagner
Joined: 2011-04-08,
User offline. Last seen 42 years 45 weeks ago.
Re: :paste and history in the REPL

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 08.08.2011 18:35, schrieb Alex Repain:
> 2011/8/8 Stefan Wagner
>
> Hi Seth, Hi List,
> ...
> Sometimes, jumping over a block would be useful, but not always, for me.
>
>
>> Then would it be possible to divide the command into two distinct commands ?
>> upArrow to go line by line and [something]+upArrow to go block by block (the
>> two would become equivalent for one-liner blocks) ? It would be almost
>> transparent for people who currently use the line-by-line, and big plus for
>> those who wiqsh to travel block by block.

Yes, that would be useful. From my ignorant perspective, Shift+Arrow-Up
or Page-Up comes to mind, but maybe they're already used for something else.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland