# HG changeset patch # User Gerd Moellmann # Date 946747462 0 # Node ID f068649f1c284baeaa7f1ef23a0f3e05bf911f85 # Parent b1afaefff57606f7a0bc91fed206772ebf745990 (Fconstrain_to_field): Don't constrain if inhibit-field-text-motion is non-nil. (Fline_beginning_position): Undo previous change. (Fline_end_position): Ditto. diff -r b1afaefff576 -r f068649f1c28 src/editfns.c --- a/src/editfns.c Sat Jan 01 17:23:34 2000 +0000 +++ b/src/editfns.c Sat Jan 01 17:24:22 2000 +0000 @@ -518,7 +518,9 @@ NEW-POS would move it to a different line, NEW-POS is returned\n\ unconstrained. This useful for commands that move by line, like\n\ \\[next-line] or \\[beginning-of-line], which should generally respect field boundaries\n\ -only in the case where they can still move to the right line.") +only in the case where they can still move to the right line.\n\ +\n\ +Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil.") (new_pos, old_pos, escape_from_edge, only_in_line) Lisp_Object new_pos, old_pos, escape_from_edge, only_in_line; { @@ -532,7 +534,9 @@ XSETFASTINT (new_pos, PT); } - if (!EQ (new_pos, old_pos) && !text_property_eq (Qfield, new_pos, old_pos)) + if (NILP (Vinhibit_field_text_motion) + && !EQ (new_pos, old_pos) + && !text_property_eq (Qfield, new_pos, old_pos)) /* NEW_POS is not within the same field as OLD_POS; try to move NEW_POS so that it is. */ { @@ -580,8 +584,10 @@ With argument N not nil or 1, move forward N - 1 lines first.\n\ If scan reaches end of buffer, return that position.\n\ The scan does not cross a field boundary unless it would move\n\ -beyond there to a different line. And if N is nil or 1,\n\ -and scan starts at a field boundary, the scan stops as soon as it starts.\n\n\ +beyond there to a different line. Field boundaries are not noticed if\n\ +`inhibit-field-text-motion' is non-nil. .And if N is nil or 1,\n\ +and scan starts at a field boundary, the scan stops as soon as it starts.\n\ +\n\ This function does not move point.") (n) Lisp_Object n; @@ -601,11 +607,9 @@ SET_PT_BOTH (orig, orig_byte); /* Return END constrained to the current input field. */ - if (NILP (Vinhibit_field_text_motion)) - end = Fconstrain_to_field (make_number (end), make_number (orig), - XINT (n) != 1 ? Qt : Qnil, - Qt); - return end; + return Fconstrain_to_field (make_number (end), make_number (orig), + XINT (n) != 1 ? Qt : Qnil, + Qt); } DEFUN ("line-end-position", Fline_end_position, Sline_end_position, @@ -628,10 +632,8 @@ end_pos = find_before_next_newline (orig, 0, XINT (n) - (XINT (n) <= 0)); /* Return END_POS constrained to the current input field. */ - if (NILP (Vinhibit_field_text_motion)) - end_pos = Fconstrain_to_field (make_number (end_pos), make_number (orig), - Qnil, Qt); - return end_pos; + return Fconstrain_to_field (make_number (end_pos), make_number (orig), + Qnil, Qt); } Lisp_Object