> Is window-point set to 1 as a side effect of making the temporary > buffer? No. It happens because I used BEG instead of the buffer's point. >> Rather _you_ did set the old >> buffer's window point to 1 and it stays put there when you set w->buffer >> to old_buffer upon exiting `vertical-motion'. > > Do you have a suggestion how to reset point? I attached I patch. It compiles but is hardly trustworthy. For example, old_buffer might have got killed in the meantime. > /* If select_window is called with inhibit_point_swap non-zero it will > not store point of the old selected window's buffer back into that > window's pointm slot. This is needed by Fset_window_configuration to > avoid that the display routine is called with selected_window set to > Qnil causing a subsequent crash. */ > > However, when I set a conditional breakpoint inhibit_point_swap!=0 this > did not interrupt execution, whereas with breakpoint select_window, > execution interrupts with inhibit_point_swap == 0, so I guess I don't > understand the comment. IIRC this part is only relevant when you restore a window configuration, for example, when leaving a `save-window-excursion'. But I wouldn't believe my own comments. martin