diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/editfns.c b/src/editfns.c index 3f713f1f134..3f74b3a8753 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -63,6 +63,10 @@ Lisp_Object Vbuffer_access_fontified_property; | |||
| 63 | 63 | ||
| 64 | Lisp_Object Fuser_full_name (); | 64 | Lisp_Object Fuser_full_name (); |
| 65 | 65 | ||
| 66 | /* Non-nil means don't stop at field boundary in text motion commands. */ | ||
| 67 | |||
| 68 | Lisp_Object Vinhibit_field_text_motion; | ||
| 69 | |||
| 66 | /* Some static data, and a function to initialize it for each run */ | 70 | /* Some static data, and a function to initialize it for each run */ |
| 67 | 71 | ||
| 68 | Lisp_Object Vsystem_name; | 72 | Lisp_Object Vsystem_name; |
| @@ -597,9 +601,11 @@ This function does not move point.") | |||
| 597 | SET_PT_BOTH (orig, orig_byte); | 601 | SET_PT_BOTH (orig, orig_byte); |
| 598 | 602 | ||
| 599 | /* Return END constrained to the current input field. */ | 603 | /* Return END constrained to the current input field. */ |
| 600 | return Fconstrain_to_field (make_number (end), make_number (orig), | 604 | if (NILP (Vinhibit_field_text_motion)) |
| 601 | XINT (n) != 1 ? Qt : Qnil, | 605 | end = Fconstrain_to_field (make_number (end), make_number (orig), |
| 602 | Qt); | 606 | XINT (n) != 1 ? Qt : Qnil, |
| 607 | Qt); | ||
| 608 | return end; | ||
| 603 | } | 609 | } |
| 604 | 610 | ||
| 605 | DEFUN ("line-end-position", Fline_end_position, Sline_end_position, | 611 | DEFUN ("line-end-position", Fline_end_position, Sline_end_position, |
| @@ -622,8 +628,10 @@ This function does not move point.") | |||
| 622 | end_pos = find_before_next_newline (orig, 0, XINT (n) - (XINT (n) <= 0)); | 628 | end_pos = find_before_next_newline (orig, 0, XINT (n) - (XINT (n) <= 0)); |
| 623 | 629 | ||
| 624 | /* Return END_POS constrained to the current input field. */ | 630 | /* Return END_POS constrained to the current input field. */ |
| 625 | return | 631 | if (NILP (Vinhibit_field_text_motion)) |
| 626 | Fconstrain_to_field (make_number (end_pos), make_number (orig), Qnil, Qt); | 632 | end_pos = Fconstrain_to_field (make_number (end_pos), make_number (orig), |
| 633 | Qnil, Qt); | ||
| 634 | return end_pos; | ||
| 627 | } | 635 | } |
| 628 | 636 | ||
| 629 | Lisp_Object | 637 | Lisp_Object |
| @@ -3668,6 +3676,10 @@ syms_of_editfns () | |||
| 3668 | = intern ("buffer-access-fontify-functions"); | 3676 | = intern ("buffer-access-fontify-functions"); |
| 3669 | staticpro (&Qbuffer_access_fontify_functions); | 3677 | staticpro (&Qbuffer_access_fontify_functions); |
| 3670 | 3678 | ||
| 3679 | DEFVAR_LISP ("inhibit-field-text-motion", &Vinhibit_field_text_motion, | ||
| 3680 | "Non-nil means.text motion commands don't notice fields."); | ||
| 3681 | Vinhibit_field_text_motion = Qnil; | ||
| 3682 | |||
| 3671 | DEFVAR_LISP ("buffer-access-fontify-functions", | 3683 | DEFVAR_LISP ("buffer-access-fontify-functions", |
| 3672 | &Vbuffer_access_fontify_functions, | 3684 | &Vbuffer_access_fontify_functions, |
| 3673 | "List of functions called by `buffer-substring' to fontify if necessary.\n\ | 3685 | "List of functions called by `buffer-substring' to fontify if necessary.\n\ |