Suggestions

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Suggestions

Eyal Doron
Hi,
   Some suggestions:

1) Let the user define a default extension that will be appended to
   saved and loaded files. I am specifically thinking of appending
   ".mat" to matlab-format files, to be compatible with MATLAB.
2) Improve the command line history feature (is that possible) to
   match the text already typed on the line (again, like in MATLAB).
3) Is someone maintaining a "home" for octave .m files?

Eyal

Reply | Threaded
Open this post in threaded view
|

Re: Suggestions

torsten martinsen-2
>>>>> Eyal Doron <[hidden email]> writes:

Eyal>    Some suggestions:

Eyal> 1) Let the user define a default extension that will be appended to
Eyal>    saved and loaded files. I am specifically thinking of appending
Eyal>    ".mat" to matlab-format files, to be compatible with MATLAB.

This is probably a good idea.

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.

-Torsten

Reply | Threaded
Open this post in threaded view
|

Re: Suggestions

John W. Eaton-6
[Still catching up on old mail...  --jwe]

Long ago, torsten martinsen <[hidden email]> wrote:

: >>>>> Eyal Doron <[hidden email]> 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