comparison src/editfns.c @ 27077:19a664c654ab

(Vinhibit_field_text_motion): New variable. (inhibit-field-text-motion): New DEFVAR_LISP. (Fline_beginning_position, Fline_end_position): Notice field boundaries only if inhibit-field-text-motion is nil.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 01 Jan 2000 17:06:00 +0000
parents bf700e4957ec
children f068649f1c28
comparison
equal deleted inserted replaced
27076:40c18bc759e9 27077:19a664c654ab
60 Lisp_Object Vbuffer_access_fontify_functions; 60 Lisp_Object Vbuffer_access_fontify_functions;
61 Lisp_Object Qbuffer_access_fontify_functions; 61 Lisp_Object Qbuffer_access_fontify_functions;
62 Lisp_Object Vbuffer_access_fontified_property; 62 Lisp_Object Vbuffer_access_fontified_property;
63 63
64 Lisp_Object Fuser_full_name (); 64 Lisp_Object Fuser_full_name ();
65
66 /* Non-nil means don't stop at field boundary in text motion commands. */
67
68 Lisp_Object Vinhibit_field_text_motion;
65 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;
69 Lisp_Object Vuser_real_login_name; /* login name of current user ID */ 73 Lisp_Object Vuser_real_login_name; /* login name of current user ID */
595 end = PT; 599 end = PT;
596 600
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,
606 0, 1, 0, 612 0, 1, 0,
607 "Return the character position of the last character on the current line.\n\ 613 "Return the character position of the last character on the current line.\n\
620 CHECK_NUMBER (n, 0); 626 CHECK_NUMBER (n, 0);
621 627
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
630 save_excursion_save () 638 save_excursion_save ()
631 { 639 {
3666 3674
3667 Qbuffer_access_fontify_functions 3675 Qbuffer_access_fontify_functions
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\
3674 Each function is called with two arguments which specify the range\n\ 3686 Each function is called with two arguments which specify the range\n\
3675 of the buffer being accessed."); 3687 of the buffer being accessed.");