octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interest in selectively deleting history entries.


From: Philip Nienhuis
Subject: Re: Interest in selectively deleting history entries.
Date: Sun, 21 Sep 2014 14:23:37 -0700 (PDT)

Daniel Sebald wrote
> On 09/21/2014 12:50 PM, Philip Nienhuis wrote:
>> Daniel Sebald wrote
>>> I'm curious what people's thoughts are on the ability to selectively
>>> delete individual lines of history.  What I see it used for, in
> <snip>
>> And it doesn't only hold for Octave but also for shells etc.
> 
> Yes, I know.  At least in that case one can clear the screen fairly 
> quickly. 

Sure, but it remains in the shell's history, also for a looong time.


> <snip>
>> If the relevant code is in .m-shape (rather than C++) I could have a look
>> myself.
> 
> history is a builtin command.  It would need to be C++.

I just found that out myself ("which history"). Then I'm out of the game -
C++ is not my cup of tea :-(


>>>                       The question is
>>> what to do with the numbering.  If a line is deleted, should there just
>>> be a hole in the numbering sequence where the line used to be?  I think
>>> it is probably preferred to not change the number of a line in history
>>> once it is assigned.  So that would make an extra level of mapping the
>>> list number to a command-line number.
> <snip>
>> All of this makes me assume that the history entry number makes most
>> sense
>> as a per-session counter. But that's just me.
> 
> It is per-session, yes.

I'd say just forget about the re-mapping then:

(1) It would add a potentially confusing interpretation layer over command
sequences;

(2) Your motives appear to lie primarily in the GUI, with wiping inadvertent
lines containing sensitive info.
Now in the GUI it is extremely easy to select a block of lines with the
mouse cursor and copy them into the editor / terminal / whatever. So I see
little need to painstakingly keep track of what history line number holds
which command, as command and blocks of commands can much more easily be
selected with scroll bars / arrow / PGUP / PGDN keys and a mouse cursor
swipe.
IOW, the need for some specific parts of the history command set gets moot
in the GUI.

(3) Maybe replace a wiped line by a (hidden?) comment (##) if line numbering
is to remain consecutive (w/o holes). 

Again, just my opinion :-)

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Interest-in-selectively-deleting-history-entries-tp4666612p4666618.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]