# HG changeset patch # User Gerd Moellmann # Date 958487367 0 # Node ID bb0cf4868e7041780722d71b087a786fb8bcb256 # Parent f8b0ac62f23832739ee3ae80e2589645e23fdf92 (Fmove_to_column): When ending within a tab, insert spaces first so that markers at the end of the tab get adjusted. diff -r f8b0ac62f238 -r bb0cf4868e70 src/indent.c --- a/src/indent.c Tue May 16 14:29:08 2000 +0000 +++ b/src/indent.c Tue May 16 14:29:27 2000 +0000 @@ -944,14 +944,21 @@ and scan through it again. */ if (!NILP (force) && col > goal && c == '\t' && prev_col < goal) { - int old_point, old_point_byte; + int goal_pt, goal_pt_byte; + + /* Insert spaces in front of the tab to reach GOAL. Do this + first so that a marker at the end of the tab gets + adjusted. */ + SET_PT_BOTH (PT - 1, PT_BYTE - 1); + Finsert_char (make_number (' '), make_number (goal - prev_col), Qt); - del_range (PT - 1, PT); - Findent_to (make_number (goal), Qnil); - old_point = PT; - old_point_byte = PT_BYTE; + /* Now delete the tab, and indent to COL. */ + del_range (PT, PT + 1); + goal_pt = PT; + goal_pt_byte = PT_BYTE; Findent_to (make_number (col), Qnil); - SET_PT_BOTH (old_point, old_point_byte); + SET_PT_BOTH (goal_pt, goal_pt_byte); + /* Set the last_known... vars consistently. */ col = goal; }