[Robert Abitbol] This is a real drag as we used to say in the seventies.:) With a TCL program I use the backspace key and instead of going backwards, the function stays still and I get the impression that letters are falling in a sort of hole. How could I fix the problem? Thanks once more teclers! ---- Instead of creating a new page, how about asking questions here: [Ask, and it shall be given # 2] [Robert Abitbol] Good point! I did hesitate between writing my question in [Ask, and it shall be given # 2] or in a separate page. I opted for a separate page because this way, anyone who has a similar problem can enter the word backspace on the search for titles and he/she will get his/her answer to the problem right away instead of having the answer buried in a huge [Ask, and it shall be given # 2] page. It's just a matter of being more efficient, more functional. ----- [FW]: To me it sounds like you're saying the insertion cursor stays at the same place in the line when you backspace. This doesn't happen for me, so it may be specific to the program you're using (perhaps alters the bindings?) If you try a simple text widget pack [text .t] does it still happen? [LES]: My guess is that text in his widget (an entry widget, I suppose) is aligned "center". So the text gets shorter on the "edges" and it looks like the cursor (the editing point) does not ever move. [Robert Abitbol] Thanks gentlemen for your answers. You are both right: the backspace feels like it is centered and it stays in the same location, in the same column. I'll try to put the code you suggest [FW]. Where do I enter it (excuse my ignorance :-)) If I put the text widget you suggest, will it also solve the problem of the home function that returns to the beginning of the paragraph instead of going to the beginning of the line? Thanks again for your answers. ---- [AMG]: This is a different sort of backspace problem, but I encounter it frequently enough. Most likely I'm not the only one with such badly misconfigured machines as to experience it, so I imagine others may come to this page looking for a solution. In [tclsh] sometimes backspace just writes a '''^H'''. Fix? I type '''stty erase ^H'''. And I generate that '''^H''' by hitting my backspace key rather than typing '''^''' followed by '''H'''. This isn't tclsh-specific, of course. tclsh is just one of many, many programs that don't use [readline] but rather depend on the terminal to do all line editing and buffering. So all we do is reconfigure the terminal via [stty]. ----- '''Mike Griffiths comes up with the answer''' [Robert Abitbol], 2nd April 2005 On an editor, when pressing the backspace key, the previous character is deleted, and then the cursor is moved to the right one space. I'm just uncertain whether the problem is the mark set insert or the uplevel #0 ... delete insert The lines of code causing the problem are in the hypertext.instance proc. The lines are: } else { #.w delete/insert n.n ?n.n? set old_cur [${w}_orig index insert] ${w}_orig mark set insert $i set s [${w}_orig index "insert linestart"] if {"insert" eq $cmd} { uplevel #0 [concat [list ${w}_orig] insert insert [lrange $args 2 end]] } else { uplevel #0 [concat [list ${w}_orig] delete insert [lrange $args 2 end]] } set e [${w}_orig index "insert lineend"] ${w}_orig mark set insert $old_cur } I believe that the $args value that is causing the problem is: delete insert-1c What could be done to fix the problem? Thanks! [MG] April 2 2005 - If you remove the line ${w}_orig mark set insert $old_cur near the very end, the cursor should stop moving after deletion. [Robert Abitbol] It works exactly as you recommended Mike... Many many thanks! You are a heck of a programmer... A magician even... Say, what was the intention of the programmer when he wrote the line: ${w}_orig mark set insert $old_cur What was the line for originally? Thanks again Mike! ----- [Category Tutorial]