Article View: gnu.bash.bug
Article #584Novice question on binding keys
From: Brian Fox
Date: Wed, 13 Sep 1989 14:58
Date: Wed, 13 Sep 1989 14:58
56 lines
2978 bytes
2978 bytes
Date: Wed, 13 Sep 89 16:36:28 +1200
From: Ray Nickson <nickson@comp.vuw.ac.nz>
From: Martin Farach <mpf@MIMSY.UMD.EDU>
Date: 9 Sep 89 18:01:00 GMT
- readline reads .keymaprc in $HOME (or file specified in KEYMAPRC);
this contains lines of the form
bind <keyseq> <readline_function>
unbind <keyseq>
mbind <keyseq> <macro>
clear
include <file>
<keyseq> is a sequence of characters, with the following special
interpretations:
\C- control
\M- meta
\F- lookup termcap; eg. \F-ku represents the up-arrow key
<readline-function> is the name of a function (previous-line etc)
<macro> is a sequence of characters to dispatch on
<file> is the name of a file to include
- bind, unbind are new shell builtins, for changing bindings on the fly
- extra readline functions:
signal-{stop, quit, interrupt} - send signals
redraw-line - tidy up messy displays
yank-previous-nth-arg - pull words down from history
I have sent my readline hacks to Brian. The code I have written works
in the limited environments I have tried it, but is not at all
well-written, and is certainly not portable, so I'd rather not
generally distribute it. I also haven't got around to slotting it
into 1.03, so it still exists only as 1.02 patches. Anyone care to
comment on the value of these ideas?
Whoa, slow down there big guy! I have rewritten the way keymaps in
readline work (this last day) which should allow us to use multiple key
bindings. I have added a new command called load-bindings, so you can
re-read your .inoputrc file on the fly. I plan to merge your F- (lookup
terminal string) stuff into readline because I think that it is a really
good idea. I had planned to do yank-previous-nth-arg, but if your
implementation is clean, I will be glad to use it instead!
SUSP (C-z) and INTR (C-c) are not available for binding in my version of
readline. STOPC (C-s) is. If you have turned off flow-control, then
so is STARTC (C-q). Otherwise, it is automatically bound to
restart-ouput-flow.
In 1.03 (and later versions) a numeric arg to clear-screen (C-l) says to
only redraw the current line instead of clearing the whole screen. This
can be called as a separate function, so you could bind C-l to it
instead.
Next: Marks within a line for region hacking.
Brian
Technical Details
Message-ID:
<8909131458.AA20290@aurel.caltech.edu>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfoxReferences:
<8909130438.AA23567@comp.vuw.ac.nz>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfox From: bfox@AUREL.CALTECH.EDU (Brian Fox) Newsgroups: gnu.bash.bug Subject: Novice question on binding keys Message-ID: <8909131458.AA20290@aurel.caltech.edu> Date: 13 Sep 89 14:58:15 GMT References: <8909130438.AA23567@comp.vuw.ac.nz> Sender: daemon@tut.cis.ohio-state.edu Reply-To: bfox@aurel.caltech.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 56