From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Tromey To: Insight List Subject: M-b Date: Mon, 22 May 2000 13:19:00 -0000 Message-id: <87aehimj66.fsf@cygnus.com> X-SW-Source: 2000-q2/msg00200.html Bring up the Console. Hit Meta-b. Note that the cursor appears in the prompt. Oops. I looked at this a bit. It seems like the appended patch should fix the problem, but it doesn't. Experimentation at runtime shows that the Text binding is being run even though my new binding invokes "break". I have no clue why this would fail. In the past I would have suspected our weird itcl, but I haven't kept up with what has happened there and I don't know if these suspicions are still current. Perhaps someone with more time and more recent direct experience could finish this? It shouldn't take too long... 2000-05-22 Tom Tromey * console.itb (Console::_build_win): Handle bindings which are ";". Also, completely override underlying Text binding. Tom Index: console.itb =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v retrieving revision 1.3 diff -u -r1.3 console.itb --- console.itb 2000/04/14 14:45:37 1.3 +++ console.itb 2000/05/22 20:17:29 @@ -97,7 +97,7 @@ %W delete {cmdmark + 1 char} insert %W see {insert linestart} } - + # Control-w deletes previous word. bind_plain_key $_twin Control-w { if {[%W compare {insert -1c wordstart} > cmdmark]} { @@ -116,13 +116,19 @@ # movement. We only need to do this after events we do not # explicitly override. Note that since the edit line is always the # last line, we can't possibly go past it, so we don't bother - # checking that. + # checking that. Note also that we check for a binding which is + # simply `;'; this lets us handle keys already bound via + # bind_plain_key. foreach event [bind Text] { - if {[string match *Key* $event] && [bind $_twin $event] == ""} { - bind $_twin $event { + if {[string match *Key* $event] + && ([bind $_twin $event] == "" + || [bind $_twin $event] == ";")} { + bind $_twin $event [bind Text $event] + bind $_twin $event {+ if {[%W compare insert <= {cmdmark + 1 char}]} { %W mark set insert {cmdmark + 1 char} } + break } } }