bug-bash
[Top][All Lists]
Advanced

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

Re: What exactly does "read -e" do? bind weirdnesses


From: Rocky Bernstein
Subject: Re: What exactly does "read -e" do? bind weirdnesses
Date: Thu, 11 Sep 2008 19:59:13 -0400

There is a connection between the "set -o emacs",  "set -o vi", and "set -o
history" commands and the way "read -e" works. But there is nothing that I
could find in any of the bash/readline/history documents that make this
connection explicit. Changing one of these "line editing" settings changes
key bindings that are used in "read -e".  But this is not mentioned when
describing either "set" or "read". Of course, if one thinks about line
editing and considers where that might be used, then "read -e" is tempting.

Furthermore, when one puts "read -e" in a file without any line editing
settings, there is by default some sort of key bindings that are in effect.
They look like some of emacs settings, perhaps all of them. But, again, I
don't think one can figure this out by reading available documents and I
don't see it obvious why that this should be the default, yet  "bind" should
not show this.

By the way, is "line editing" also an implied by virtue of a combination of
settings or is there some variable, or status display that makes this
explicit?

At any rate, I have my problems solved, so thanks! I just think some
clarification in documents might help others.



On Thu, Sep 11, 2008 at 2:58 PM, Chet Ramey <chet.ramey@case.edu> wrote:

> > You are correct, here is no problem in bash-4.0 alpha. My apologies.
> >
> > An error message when bind is used and line editing is not enabled would
> > help.
> >
> > Alas, I suspect many will not try to use bind but still use "read" or
> > perhaps a set +o emacs and subsequently expecting some of default key
> > bindings which no longer are in effect. I threw in the bind command just
> to
> > try to help me see what was going on.
>
> Bash will call the appropriate readline initialization hooks in the `read'
> and `set' builtin code paths.  It's just the bind invocation that will fail
> if line editing isn't active.
>
> Chet
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>
> Chet Ramey, ITS, CWRU    chet@case.edu
> http://tiswww.tis.case.edu/~chet/ <http://tiswww.tis.case.edu/%7Echet/>
>


reply via email to

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