Mercurial > emacs
comparison src/search.c @ 16039:855c8d8ba0f0
Change all references from point to PT.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sun, 01 Sep 1996 19:15:05 +0000 |
parents | 9531c03134b6 |
children | cc2b553290aa |
comparison
equal
deleted
inserted
replaced
16038:8cd162ceb1dc | 16039:855c8d8ba0f0 |
---|---|
236 s1 = ZV - BEGV; | 236 s1 = ZV - BEGV; |
237 s2 = 0; | 237 s2 = 0; |
238 } | 238 } |
239 | 239 |
240 i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2, | 240 i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2, |
241 point - BEGV, &search_regs, | 241 PT - BEGV, &search_regs, |
242 ZV - BEGV); | 242 ZV - BEGV); |
243 if (i == -2) | 243 if (i == -2) |
244 matcher_overflow (); | 244 matcher_overflow (); |
245 | 245 |
246 val = (0 <= i ? Qt : Qnil); | 246 val = (0 <= i ? Qt : Qnil); |
760 if (negate) | 760 if (negate) |
761 for (i = 0; i < sizeof fastmap; i++) | 761 for (i = 0; i < sizeof fastmap; i++) |
762 fastmap[i] ^= 1; | 762 fastmap[i] ^= 1; |
763 | 763 |
764 { | 764 { |
765 int start_point = point; | 765 int start_point = PT; |
766 | 766 |
767 immediate_quit = 1; | 767 immediate_quit = 1; |
768 if (syntaxp) | 768 if (syntaxp) |
769 { | 769 { |
770 | 770 |
771 if (forwardp) | 771 if (forwardp) |
772 { | 772 { |
773 while (point < XINT (lim) | 773 while (PT < XINT (lim) |
774 && fastmap[(unsigned char) syntax_code_spec[(int) SYNTAX (FETCH_CHAR (point))]]) | 774 && fastmap[(unsigned char) syntax_code_spec[(int) SYNTAX (FETCH_CHAR (PT))]]) |
775 SET_PT (point + 1); | 775 SET_PT (PT + 1); |
776 } | 776 } |
777 else | 777 else |
778 { | 778 { |
779 while (point > XINT (lim) | 779 while (PT > XINT (lim) |
780 && fastmap[(unsigned char) syntax_code_spec[(int) SYNTAX (FETCH_CHAR (point - 1))]]) | 780 && fastmap[(unsigned char) syntax_code_spec[(int) SYNTAX (FETCH_CHAR (PT - 1))]]) |
781 SET_PT (point - 1); | 781 SET_PT (PT - 1); |
782 } | 782 } |
783 } | 783 } |
784 else | 784 else |
785 { | 785 { |
786 if (forwardp) | 786 if (forwardp) |
787 { | 787 { |
788 while (point < XINT (lim) && fastmap[FETCH_CHAR (point)]) | 788 while (PT < XINT (lim) && fastmap[FETCH_CHAR (PT)]) |
789 SET_PT (point + 1); | 789 SET_PT (PT + 1); |
790 } | 790 } |
791 else | 791 else |
792 { | 792 { |
793 while (point > XINT (lim) && fastmap[FETCH_CHAR (point - 1)]) | 793 while (PT > XINT (lim) && fastmap[FETCH_CHAR (PT - 1)]) |
794 SET_PT (point - 1); | 794 SET_PT (PT - 1); |
795 } | 795 } |
796 } | 796 } |
797 immediate_quit = 0; | 797 immediate_quit = 0; |
798 | 798 |
799 return make_number (point - start_point); | 799 return make_number (PT - start_point); |
800 } | 800 } |
801 } | 801 } |
802 | 802 |
803 /* Subroutines of Lisp buffer search functions. */ | 803 /* Subroutines of Lisp buffer search functions. */ |
804 | 804 |
824 lim = n > 0 ? ZV : BEGV; | 824 lim = n > 0 ? ZV : BEGV; |
825 else | 825 else |
826 { | 826 { |
827 CHECK_NUMBER_COERCE_MARKER (bound, 1); | 827 CHECK_NUMBER_COERCE_MARKER (bound, 1); |
828 lim = XINT (bound); | 828 lim = XINT (bound); |
829 if (n > 0 ? lim < point : lim > point) | 829 if (n > 0 ? lim < PT : lim > PT) |
830 error ("Invalid search bound (wrong side of point)"); | 830 error ("Invalid search bound (wrong side of point)"); |
831 if (lim > ZV) | 831 if (lim > ZV) |
832 lim = ZV; | 832 lim = ZV; |
833 if (lim < BEGV) | 833 if (lim < BEGV) |
834 lim = BEGV; | 834 lim = BEGV; |
835 } | 835 } |
836 | 836 |
837 np = search_buffer (string, point, lim, n, RE, | 837 np = search_buffer (string, PT, lim, n, RE, |
838 (!NILP (current_buffer->case_fold_search) | 838 (!NILP (current_buffer->case_fold_search) |
839 ? XCHAR_TABLE (current_buffer->case_canon_table)->contents | 839 ? XCHAR_TABLE (current_buffer->case_canon_table)->contents |
840 : 0), | 840 : 0), |
841 (!NILP (current_buffer->case_fold_search) | 841 (!NILP (current_buffer->case_fold_search) |
842 ? XCHAR_TABLE (current_buffer->case_eqv_table)->contents | 842 ? XCHAR_TABLE (current_buffer->case_eqv_table)->contents |
1743 struct gcpro gcpro1; | 1743 struct gcpro gcpro1; |
1744 GCPRO1 (newtext); | 1744 GCPRO1 (newtext); |
1745 | 1745 |
1746 for (pos = 0; pos < XSTRING (newtext)->size; pos++) | 1746 for (pos = 0; pos < XSTRING (newtext)->size; pos++) |
1747 { | 1747 { |
1748 int offset = point - search_regs.start[sub]; | 1748 int offset = PT - search_regs.start[sub]; |
1749 | 1749 |
1750 c = XSTRING (newtext)->data[pos]; | 1750 c = XSTRING (newtext)->data[pos]; |
1751 if (c == '\\') | 1751 if (c == '\\') |
1752 { | 1752 { |
1753 c = XSTRING (newtext)->data[++pos]; | 1753 c = XSTRING (newtext)->data[++pos]; |
1771 insert_char (c); | 1771 insert_char (c); |
1772 } | 1772 } |
1773 UNGCPRO; | 1773 UNGCPRO; |
1774 } | 1774 } |
1775 | 1775 |
1776 inslen = point - (search_regs.start[sub]); | 1776 inslen = PT - (search_regs.start[sub]); |
1777 del_range (search_regs.start[sub] + inslen, search_regs.end[sub] + inslen); | 1777 del_range (search_regs.start[sub] + inslen, search_regs.end[sub] + inslen); |
1778 | 1778 |
1779 if (case_action == all_caps) | 1779 if (case_action == all_caps) |
1780 Fupcase_region (make_number (point - inslen), make_number (point)); | 1780 Fupcase_region (make_number (PT - inslen), make_number (PT)); |
1781 else if (case_action == cap_initial) | 1781 else if (case_action == cap_initial) |
1782 Fupcase_initials_region (make_number (point - inslen), make_number (point)); | 1782 Fupcase_initials_region (make_number (PT - inslen), make_number (PT)); |
1783 return Qnil; | 1783 return Qnil; |
1784 } | 1784 } |
1785 | 1785 |
1786 static Lisp_Object | 1786 static Lisp_Object |
1787 match_limit (num, beginningp) | 1787 match_limit (num, beginningp) |