diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/search.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/search.c b/src/search.c index 81d2be58e9e..e77528311d4 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -1802,24 +1802,28 @@ match_limit (num, beginningp) | |||
| 1802 | 1802 | ||
| 1803 | DEFUN ("match-beginning", Fmatch_beginning, Smatch_beginning, 1, 1, 0, | 1803 | DEFUN ("match-beginning", Fmatch_beginning, Smatch_beginning, 1, 1, 0, |
| 1804 | "Return position of start of text matched by last search.\n\ | 1804 | "Return position of start of text matched by last search.\n\ |
| 1805 | NUM specifies which parenthesized expression in the last regexp.\n\ | 1805 | SUBEXP, a number, specifies which parenthesized expression in the last\n\ |
| 1806 | Value is nil if NUMth pair didn't match, or there were less than NUM pairs.\n\ | 1806 | regexp.\n\ |
| 1807 | Value is nil if SUBEXPth pair didn't match, or there were less than\n\ | ||
| 1808 | SUBEXP pairs.\n\ | ||
| 1807 | Zero means the entire text matched by the whole regexp or whole string.") | 1809 | Zero means the entire text matched by the whole regexp or whole string.") |
| 1808 | (num) | 1810 | (subexp) |
| 1809 | Lisp_Object num; | 1811 | Lisp_Object subexp; |
| 1810 | { | 1812 | { |
| 1811 | return match_limit (num, 1); | 1813 | return match_limit (subexp, 1); |
| 1812 | } | 1814 | } |
| 1813 | 1815 | ||
| 1814 | DEFUN ("match-end", Fmatch_end, Smatch_end, 1, 1, 0, | 1816 | DEFUN ("match-end", Fmatch_end, Smatch_end, 1, 1, 0, |
| 1815 | "Return position of end of text matched by last search.\n\ | 1817 | "Return position of end of text matched by last search.\n\ |
| 1816 | ARG, a number, specifies which parenthesized expression in the last regexp.\n\ | 1818 | SUBEXP, a number, specifies which parenthesized expression in the last\n\ |
| 1817 | Value is nil if ARGth pair didn't match, or there were less than ARG pairs.\n\ | 1819 | regexp.\n\ |
| 1820 | Value is nil if SUBEXPth pair didn't match, or there were less than\n\ | ||
| 1821 | SUBEXP pairs.\n\ | ||
| 1818 | Zero means the entire text matched by the whole regexp or whole string.") | 1822 | Zero means the entire text matched by the whole regexp or whole string.") |
| 1819 | (num) | 1823 | (subexp) |
| 1820 | Lisp_Object num; | 1824 | Lisp_Object subexp; |
| 1821 | { | 1825 | { |
| 1822 | return match_limit (num, 0); | 1826 | return match_limit (subexp, 0); |
| 1823 | } | 1827 | } |
| 1824 | 1828 | ||
| 1825 | DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 0, 0, | 1829 | DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 0, 0, |
| @@ -2001,20 +2005,20 @@ restore_match_data () | |||
| 2001 | 2005 | ||
| 2002 | DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, | 2006 | DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, |
| 2003 | "Return a regexp string which matches exactly STRING and nothing else.") | 2007 | "Return a regexp string which matches exactly STRING and nothing else.") |
| 2004 | (str) | 2008 | (string) |
| 2005 | Lisp_Object str; | 2009 | Lisp_Object string; |
| 2006 | { | 2010 | { |
| 2007 | register unsigned char *in, *out, *end; | 2011 | register unsigned char *in, *out, *end; |
| 2008 | register unsigned char *temp; | 2012 | register unsigned char *temp; |
| 2009 | 2013 | ||
| 2010 | CHECK_STRING (str, 0); | 2014 | CHECK_STRING (string, 0); |
| 2011 | 2015 | ||
| 2012 | temp = (unsigned char *) alloca (XSTRING (str)->size * 2); | 2016 | temp = (unsigned char *) alloca (XSTRING (string)->size * 2); |
| 2013 | 2017 | ||
| 2014 | /* Now copy the data into the new string, inserting escapes. */ | 2018 | /* Now copy the data into the new string, inserting escapes. */ |
| 2015 | 2019 | ||
| 2016 | in = XSTRING (str)->data; | 2020 | in = XSTRING (string)->data; |
| 2017 | end = in + XSTRING (str)->size; | 2021 | end = in + XSTRING (string)->size; |
| 2018 | out = temp; | 2022 | out = temp; |
| 2019 | 2023 | ||
| 2020 | for (; in != end; in++) | 2024 | for (; in != end; in++) |