Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!bu.edu!bu-cs!snorkelwacker!apple!usc!samsung!think!yale!cs.yale.edu!Duchier-Denys@cs.yale.edu From: Duchier-Denys@cs.yale.edu (Denys Duchier) Newsgroups: gnu.emacs.bug Subject: bug in command_loop_1 Message-ID: <12787@cs.yale.edu> Date: 25 Jan 90 01:33:27 GMT Sender: news@cs.yale.edu Reply-To: Duchier-Denys@cs.yale.edu (Denys Duchier) Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Lines: 33 As I keep optimizing one thing here, another thing there, I seem to run across bugs that did not previously show up. In command_loop_1 (keyboard.c), there is an optimization for the common case of forward-char. The test is: if (lose >= ' ' && lose < 0177 && (XFASTINT (XWINDOW (selected_window)->last_modified) >= bf_modified) && (XFASTINT (XWINDOW (selected_window)->last_point) == point) && !windows_or_buffers_changed && EQ (bf_cur->selective_display, Qnil) && !detect_input_pending () && NULL (Vexecuting_macro)) I find the 4th conjunct really confusing. Shouldn't it be: && (XFASTINT (XWINDOW (selected_window)->last_point) == point - 1) The problem is that, just before the conditional, we have the instruction: SetPoint (point + 1) I don't see how the original test could succeed. Similarly for the optimization of backward-char: point should be point + 1. I just tried this fix, and the behaviour is now as expected. Can somebody tell if I am right? --Denys