diff options
| author | Gerd Moellmann | 2000-01-01 17:24:22 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-01-01 17:24:22 +0000 |
| commit | ee5cd4dba2054bdc6a6140a47287ac4d18b8986a (patch) | |
| tree | 035cf3e57ff3280148732508162f253955f04409 /src | |
| parent | 64aa4eb1f3a694cee3230cf0c8c6ec1853a2dabc (diff) | |
| download | emacs-ee5cd4dba2054bdc6a6140a47287ac4d18b8986a.tar.gz emacs-ee5cd4dba2054bdc6a6140a47287ac4d18b8986a.zip | |
(Fconstrain_to_field): Don't constrain if
inhibit-field-text-motion is non-nil.
(Fline_beginning_position): Undo previous change.
(Fline_end_position): Ditto.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/editfns.c b/src/editfns.c index 3f74b3a8753..76bf5235f8f 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -518,7 +518,9 @@ If the optional argument ONLY-IN-LINE is non-nil and constraining\n\ | |||
| 518 | NEW-POS would move it to a different line, NEW-POS is returned\n\ | 518 | NEW-POS would move it to a different line, NEW-POS is returned\n\ |
| 519 | unconstrained. This useful for commands that move by line, like\n\ | 519 | unconstrained. This useful for commands that move by line, like\n\ |
| 520 | \\[next-line] or \\[beginning-of-line], which should generally respect field boundaries\n\ | 520 | \\[next-line] or \\[beginning-of-line], which should generally respect field boundaries\n\ |
| 521 | only in the case where they can still move to the right line.") | 521 | only in the case where they can still move to the right line.\n\ |
| 522 | \n\ | ||
| 523 | Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil.") | ||
| 522 | (new_pos, old_pos, escape_from_edge, only_in_line) | 524 | (new_pos, old_pos, escape_from_edge, only_in_line) |
| 523 | Lisp_Object new_pos, old_pos, escape_from_edge, only_in_line; | 525 | Lisp_Object new_pos, old_pos, escape_from_edge, only_in_line; |
| 524 | { | 526 | { |
| @@ -532,7 +534,9 @@ only in the case where they can still move to the right line.") | |||
| 532 | XSETFASTINT (new_pos, PT); | 534 | XSETFASTINT (new_pos, PT); |
| 533 | } | 535 | } |
| 534 | 536 | ||
| 535 | if (!EQ (new_pos, old_pos) && !text_property_eq (Qfield, new_pos, old_pos)) | 537 | if (NILP (Vinhibit_field_text_motion) |
| 538 | && !EQ (new_pos, old_pos) | ||
| 539 | && !text_property_eq (Qfield, new_pos, old_pos)) | ||
| 536 | /* NEW_POS is not within the same field as OLD_POS; try to | 540 | /* NEW_POS is not within the same field as OLD_POS; try to |
| 537 | move NEW_POS so that it is. */ | 541 | move NEW_POS so that it is. */ |
| 538 | { | 542 | { |
| @@ -580,8 +584,10 @@ DEFUN ("line-beginning-position", Fline_beginning_position, Sline_beginning_posi | |||
| 580 | With argument N not nil or 1, move forward N - 1 lines first.\n\ | 584 | With argument N not nil or 1, move forward N - 1 lines first.\n\ |
| 581 | If scan reaches end of buffer, return that position.\n\ | 585 | If scan reaches end of buffer, return that position.\n\ |
| 582 | The scan does not cross a field boundary unless it would move\n\ | 586 | The scan does not cross a field boundary unless it would move\n\ |
| 583 | beyond there to a different line. And if N is nil or 1,\n\ | 587 | beyond there to a different line. Field boundaries are not noticed if\n\ |
| 584 | and scan starts at a field boundary, the scan stops as soon as it starts.\n\n\ | 588 | `inhibit-field-text-motion' is non-nil. .And if N is nil or 1,\n\ |
| 589 | and scan starts at a field boundary, the scan stops as soon as it starts.\n\ | ||
| 590 | \n\ | ||
| 585 | This function does not move point.") | 591 | This function does not move point.") |
| 586 | (n) | 592 | (n) |
| 587 | Lisp_Object n; | 593 | Lisp_Object n; |
| @@ -601,11 +607,9 @@ This function does not move point.") | |||
| 601 | SET_PT_BOTH (orig, orig_byte); | 607 | SET_PT_BOTH (orig, orig_byte); |
| 602 | 608 | ||
| 603 | /* Return END constrained to the current input field. */ | 609 | /* Return END constrained to the current input field. */ |
| 604 | if (NILP (Vinhibit_field_text_motion)) | 610 | return Fconstrain_to_field (make_number (end), make_number (orig), |
| 605 | end = Fconstrain_to_field (make_number (end), make_number (orig), | 611 | XINT (n) != 1 ? Qt : Qnil, |
| 606 | XINT (n) != 1 ? Qt : Qnil, | 612 | Qt); |
| 607 | Qt); | ||
| 608 | return end; | ||
| 609 | } | 613 | } |
| 610 | 614 | ||
| 611 | DEFUN ("line-end-position", Fline_end_position, Sline_end_position, | 615 | DEFUN ("line-end-position", Fline_end_position, Sline_end_position, |
| @@ -628,10 +632,8 @@ This function does not move point.") | |||
| 628 | end_pos = find_before_next_newline (orig, 0, XINT (n) - (XINT (n) <= 0)); | 632 | end_pos = find_before_next_newline (orig, 0, XINT (n) - (XINT (n) <= 0)); |
| 629 | 633 | ||
| 630 | /* Return END_POS constrained to the current input field. */ | 634 | /* Return END_POS constrained to the current input field. */ |
| 631 | if (NILP (Vinhibit_field_text_motion)) | 635 | return Fconstrain_to_field (make_number (end_pos), make_number (orig), |
| 632 | end_pos = Fconstrain_to_field (make_number (end_pos), make_number (orig), | 636 | Qnil, Qt); |
| 633 | Qnil, Qt); | ||
| 634 | return end_pos; | ||
| 635 | } | 637 | } |
| 636 | 638 | ||
| 637 | Lisp_Object | 639 | Lisp_Object |