help-octave
[Top][All Lists]
Advanced

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

Re: Suggestions


From: John Eaton
Subject: Re: Suggestions
Date: Tue, 19 Sep 1995 04:13:34 -0500

[Still catching up on old mail...  --jwe]

Long ago, torsten martinsen <address@hidden> wrote:

: >>>>> Eyal Doron <address@hidden> writes:
: 
: Eyal> 2) Improve the command line history feature (is that possible) to
: Eyal>    match the text already typed on the line (again, like in MATLAB).
: 
: I do not think this should be the default behaviour (i.e., bound to the
: arrow keys). The GNU readline library (which I asssume Octave uses)
: already provides the bindable functions
: `history-search-[forward,backward]'. These could perhaps be bound to M-n/M-p
: (like tcsh does) as default, and users who want complete MATLAB
: compliance could then bind them to the arrow keys.

It was not possible with Octave 1.1.1 unless you swapped out the
readline library for a newer version yourself.  For 1.2, I'm using the
readline library from bash 1.14.5, which does have this function.
You'll still need something like

  "\ep": history-search-backward
  "\en": history-search-forward

or

  "\e[A": history-search-backward
  "\e[B": history-search-forward

in your ~/.inputrc file.

Also, it might not be *exactly* what you want, because it is not
sensitive to whether there is already something on the line.  If
there is something on the line, it appears that Matlab searches
backwards, otherwise, it just moves through the history list, one
element at a time, and it appears that the list is circular.
Readline's history-search-{for,back}ward functions always use the text
on the line as a hint and attempt to search.

In any case, I don't think it should be too hard to add a function to
Octave that will do exactly what you want, but I'm not particularly
interested in doing it myself.  If someone contributes it, I'd
probably add it (though it would probably be better to submit it to
the readline maintainer instead, since it wouldn't really be specific
to Octave.)

Thanks,

jwe



reply via email to

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