diff options
Diffstat (limited to 'src/search.c')
| -rw-r--r-- | src/search.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/search.c b/src/search.c index 118cec4af48..4bf4d11c33a 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -278,8 +278,8 @@ looking_at_1 (Lisp_Object string, int posix) | |||
| 278 | save_search_regs (); | 278 | save_search_regs (); |
| 279 | 279 | ||
| 280 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 280 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ |
| 281 | XCHAR_TABLE (BVAR (current_buffer, case_canon_table))->extras[2] | 281 | char_table_set_extras (BVAR (current_buffer, case_canon_table), 2, |
| 282 | = BVAR (current_buffer, case_eqv_table); | 282 | BVAR (current_buffer, case_eqv_table)); |
| 283 | 283 | ||
| 284 | CHECK_STRING (string); | 284 | CHECK_STRING (string); |
| 285 | bufp = compile_pattern (string, | 285 | bufp = compile_pattern (string, |
| @@ -393,8 +393,8 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, int p | |||
| 393 | } | 393 | } |
| 394 | 394 | ||
| 395 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 395 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ |
| 396 | XCHAR_TABLE (BVAR (current_buffer, case_canon_table))->extras[2] | 396 | char_table_set_extras (BVAR (current_buffer, case_canon_table), 2, |
| 397 | = BVAR (current_buffer, case_eqv_table); | 397 | BVAR (current_buffer, case_eqv_table)); |
| 398 | 398 | ||
| 399 | bufp = compile_pattern (regexp, | 399 | bufp = compile_pattern (regexp, |
| 400 | (NILP (Vinhibit_changing_match_data) | 400 | (NILP (Vinhibit_changing_match_data) |
| @@ -990,8 +990,8 @@ search_command (Lisp_Object string, Lisp_Object bound, Lisp_Object noerror, | |||
| 990 | } | 990 | } |
| 991 | 991 | ||
| 992 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ | 992 | /* This is so set_image_of_range_1 in regex.c can find the EQV table. */ |
| 993 | XCHAR_TABLE (BVAR (current_buffer, case_canon_table))->extras[2] | 993 | char_table_set_extras (BVAR (current_buffer, case_canon_table), 2, |
| 994 | = BVAR (current_buffer, case_eqv_table); | 994 | BVAR (current_buffer, case_eqv_table)); |
| 995 | 995 | ||
| 996 | np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE, | 996 | np = search_buffer (string, PT, PT_BYTE, lim, lim_byte, n, RE, |
| 997 | (!NILP (BVAR (current_buffer, case_fold_search)) | 997 | (!NILP (BVAR (current_buffer, case_fold_search)) |
| @@ -2226,6 +2226,9 @@ Otherwise treat `\\' as special: | |||
| 2226 | `\\N' means substitute what matched the Nth `\\(...\\)'. | 2226 | `\\N' means substitute what matched the Nth `\\(...\\)'. |
| 2227 | If Nth parens didn't match, substitute nothing. | 2227 | If Nth parens didn't match, substitute nothing. |
| 2228 | `\\\\' means insert one `\\'. | 2228 | `\\\\' means insert one `\\'. |
| 2229 | `\\?' is treated literally | ||
| 2230 | (for compatibility with `query-replace-regexp'). | ||
| 2231 | Any other character following `\\' signals an error. | ||
| 2229 | Case conversion does not apply to these substitutions. | 2232 | Case conversion does not apply to these substitutions. |
| 2230 | 2233 | ||
| 2231 | FIXEDCASE and LITERAL are optional arguments. | 2234 | FIXEDCASE and LITERAL are optional arguments. |
| @@ -2428,7 +2431,7 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2428 | } | 2431 | } |
| 2429 | else if (c == '\\') | 2432 | else if (c == '\\') |
| 2430 | delbackslash = 1; | 2433 | delbackslash = 1; |
| 2431 | else | 2434 | else if (c != '?') |
| 2432 | error ("Invalid use of `\\' in replacement text"); | 2435 | error ("Invalid use of `\\' in replacement text"); |
| 2433 | } | 2436 | } |
| 2434 | if (substart >= 0) | 2437 | if (substart >= 0) |
| @@ -3054,12 +3057,12 @@ syms_of_search (void) | |||
| 3054 | DEFSYM (Qinvalid_regexp, "invalid-regexp"); | 3057 | DEFSYM (Qinvalid_regexp, "invalid-regexp"); |
| 3055 | 3058 | ||
| 3056 | Fput (Qsearch_failed, Qerror_conditions, | 3059 | Fput (Qsearch_failed, Qerror_conditions, |
| 3057 | pure_cons (Qsearch_failed, pure_cons (Qerror, Qnil))); | 3060 | listn (CONSTYPE_PURE, 2, Qsearch_failed, Qerror)); |
| 3058 | Fput (Qsearch_failed, Qerror_message, | 3061 | Fput (Qsearch_failed, Qerror_message, |
| 3059 | build_pure_c_string ("Search failed")); | 3062 | build_pure_c_string ("Search failed")); |
| 3060 | 3063 | ||
| 3061 | Fput (Qinvalid_regexp, Qerror_conditions, | 3064 | Fput (Qinvalid_regexp, Qerror_conditions, |
| 3062 | pure_cons (Qinvalid_regexp, pure_cons (Qerror, Qnil))); | 3065 | listn (CONSTYPE_PURE, 2, Qinvalid_regexp, Qerror)); |
| 3063 | Fput (Qinvalid_regexp, Qerror_message, | 3066 | Fput (Qinvalid_regexp, Qerror_message, |
| 3064 | build_pure_c_string ("Invalid regexp")); | 3067 | build_pure_c_string ("Invalid regexp")); |
| 3065 | 3068 | ||