aboutsummaryrefslogtreecommitdiffstats
path: root/src/search.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* (looking_at_1): Reset immediate_quit before modifyingGerd Moellmann1999-12-251-1/+2
| | | | global data.
* (Freplace_match): For nonliteral replacement,Richard M. Stallman1999-12-231-14/+53
| | | | construct all the new text first, then insert all at once.
* (search_buffer): Adjusted for the change of CHAR_STRING.Kenichi Handa1999-12-151-5/+3
|
* Add support for large files, 64-bit Solaris, system locale codings.Paul Eggert1999-10-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in (emacs): Set the LC_ALL environment variable to "C" when dumping, so that the dumped Emacs doesn't have stray locale info. (dired.o): Depend on systime.h. (editfns.o): Depend on coding.h. * alloc.c, buffer.c, callproc.c, ccl.c, charset.c, coding.c, data.c, dispnew.c, editfns.c, emacs.c, filelock.c, floatfns.c, hftctl.c, keyboard.c, process.c, sysdep.c, unexelf.c, unexhp9k800.c, unexsunos4.c, vmsfns.c, vmsgmalloc.c, w32faces.c, w32menu.c, w32term.c, w32xfns.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Include <config.h> before any system include files. * alloc.c, buffer.c, ccl.c, data.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, frame.c, insdel.c, keymap.c, lread.c, m/alpha.h, print.c, search.c, sysdep.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Do not include <stdlib.h>, as <config.h> does this now. * callproc.c (Fcall_process): Synchronize messages locale before invoking strerror. Decode resulting string with locale-coding-system. * coding.c (Vlocale_coding_system): New var. (syms_of_coding): Adjust to above change. (emacs_strerror): New function. * coding.h (emacs_strerror, Vlocale_coding_system): New decls. * config.in (HAVE_STDIO_EXT_H, HAVE_TM_GMTOFF, HAVE___FPENDING, HAVE_FTELLO, HAVE_GETLOADAVG, HAVE_MBLEN, HAVE_MBRLEN, HAVE_STRSIGNAL): New macros. (BITS_PER_LONG): Default to 64 if _LP64 is defined. <stdlib.h>: Include if HAVE_STDLIB_H is defined and NOT_C_CODE isn't. * dired.c: Include "systime.h". (Ffile_attributes): Do not cast s.st_size to int; this loses information if int is 32 bits but st_size and EMACS_INT are larger. Treat large device numbers like large inode numbers. * dispnew.c (PENDING_OUTPUT_COUNT): Use __fpending if available. * editfns.c: Include coding.h. (emacs_strftime): Remove decl. (emacs_strftimeu): New decl. (emacs_memftimeu): Renamed from emacs_memftime; new arg UT. Use emacs_strftimeu instead of emacs_strftime. (Fformat_time_string): Convert format string using Vlocale_coding_system, and convert result back. Synchronize time locale before invoking lower level function. Invoke emacs_memftimeu, passing ut, instead of emacs_memftime. * emacs.c: Include <locale.h> if HAVE_SETLOCALE is defined. (Vmessages_locale, Vprevious_messages_locale, Vtime_locale, Vprevious_time_locale): New variables. (main): Invoke setlocale early, so that initial error messages are localized properly. But skip locale-setting if LC_ALL is "C". Fix up locale when it's safe to do so. (fixup_locale): Moved here from xterm.c. (synchronize_locale, synchronize_time_locale, synchronize_messages_locale): New functions. (syms_of_emacs): Accommodate above changes. * fileio.c (report_file_error): Convert strerror output according to Vlocale_coding_system. (Finsert_file_contents): Check for arithmetic overflow in computations that depend on file size. Report IO errors with emacs_strerror, not strerror. * fns.c (Fgethash): Declare dflt parameter. * gmalloc.c: Do not define const to nothing if HAVE_CONFIG_H is defined; that's config.h's job. * lisp.h (EMACS_INT, BITS_PER_EMACS_INT, EMACS_UINT): If _LP64, default these values to long, BITS_PER_LONG, and unsigned long. (VALBITS, MARKBIT, XINT): Do not assume 32-bit EMACS_INT. (PNTR_COMPARISON_TYPE): Default to EMACS_UINT, not to unsigned int. (code_convert_string_norecord, fixup_locale, synchronize_messages_locale, synchronize_time_locale, emacs_open, emacs_close, emacs_read, emacs_write): New decls. All Emacs callers of open, close, read, write changed to use emacs_open, emacs_close, emacs_read, emacs_write. * lread.c (file_offset, file_tell): New macros. All uses of ftell changed to file_tell. (saved_doc_string_position, prev_saved_doc_string_position): Now of type file_offset. (init_lread): Do not fix locale here; fixup_locale now does this. * m/amdahl.h, s/usg5-4.h: (NSIG): Remove. (NSIG_MINIMUM): New macro. * m/cydra5.h, m/dpx2.h, m/mips.h, m/pfa50.h, m/sps7.h, m/stride.h, m/ustation.h, s/gnu-linux.h, s/hpux.h, s/iris3-5.h, s/iris3-6.h, s/umips.h, s/usg5-4.h: (SIGIO): Do not undef. (BROKEN_SIGIO): New macro. * m/ustation.h: (SIGTSTP): Do not undef. (BROKEN_SIGTSTP): New macro. * s/gnu-linux.h: (SIGPOLL, SIGURG): Do not undef. (BROKEN_SIGPOLL, BROKEN_SIGURG): New macros. * s/ptx4.h: (SIGINFO): Do not undef. (BROKEN_SIGINFO): New macros. * m/delta.h, s/ptx.h, s/template.h: Doc fix. * mktime.c, strftime.c: Update to glibc 2.1.2 version, with some Emacs-related changes merged. * print.c (float_to_string): Prepend "-" to representation of a NaN if the NaN is negative. * process.c (sys_siglist): Omit if HAVE_STRSIGNAL. (wait_reading_process_input): Use emacs_strerror, not strerror. * process.c (status_message, sigchld_handler): Synchronize locale, then use strsignal istead of sys_siglist. * w32proc.c (sys_wait): Likewise. * s/aix3-1.h, s/bsd4-1.h, s/dgux.h, s/gnu-linux.h, s/hiuxmpp.h, s/hpux.h, s/iris3-5.h, s/iris3-6.h, s/irix3-3.h, s/osf1.h, s/rtu.h, s/sunos4-1.h, s/unipl5-0.h, s/unipl5-2.h, s/usg5-0.h, s/usg5-2-2.h, s/usg5-2.h, s/usg5-3.h, s/xenix.h: (open, close, read, write, INTERRUPTIBLE_OPEN, INTERRUPTIBLE_CLOSE, INTERRUPTIBLE_IO): Remove. * s/sol2-5.h (_LARGEFILE_SOURCE, _FILE_OFFSET_BITS): New macros. * sysdep.c (sys_read, sys_write, read, write, sys_close, close, sys_open, open): Remove. (emacs_open, emacs_close, emacs_read, emacs_write): Always define; the old INTERRUPTIBLE_OPEN, INTERRUPTIBLE_CLOSE, and INTERRUPTIBLE_IO macros are no longer used. (emacs_open): Renamed from sys_open. Merge BSD4_1 version. (emacs_close): Renamed from sys_close. (emacs_read): Renamed from sys_read. (emacs_write): Renamed from sys_write. (sys_siglist): Do not declare if HAVE_STRSIGNAL. (dup2): Do not print error on failure; the real dup2 doesn't. (strsignal): New function, defined if !HAVE_STRSIGNAL. * syssignal.h (SIGINFO): Undef if defined and if BROKEN_SIGINFO is defined. (SIGIO, SIGPOLL, SIGTSTP, SIGURG): Likewise. (NSIG): If less than NSIG_MINIMUM, define to NSIG_MINIMUM. (strsignal): Declare if !HAVE_STRSIGNAL. * unexelf.c (ElfBitsW, ELFSIZE, ElfExpandBitsW): New macros. (ElfW): Define in terms of ElfExpandBitsW. * w32proc.c (sys_siglist): Remove decl. * xdisp.c (decode_mode_spec): 3rd arg is int, not char, to comply with ANSI C. (display_string): Declare face_string_pos arg. * xfns.c (Fx_show_tip): Declare timeout param. * xterm.c: No need to include locale.h. (x_alloc_lighter_color, x_setup_relief_color): Pass arg as double, not float, for compatibility with ANSI C. (fixup_locale): Move to emacs.c. (x_term_init): Do not setlocale or fixup locale; the main program does this now.
* Use XCAR and XCDR instead of explicit member access.Ken Raeburn1999-09-131-4/+4
|
* (compile_pattern_1): Enable RE_CHAR_CLASSES for regexp.Richard M. Stallman1999-08-291-1/+1
|
* (boyer_moore): Get charset base value of `untranslated'Kenichi Handa1999-05-111-1/+1
| | | | by masking by ~CHAR_FIELD3_MASK (instead of ~0xff).
* (Fstring_match, Fposix_string_match): Doc fix.Karl Heuer1999-03-041-0/+2
|
* (search_buffer): Fix previous change.Richard M. Stallman1999-01-061-6/+9
|
* (search_buffer): Don't use Boyer-MooreKenichi Handa1998-12-151-21/+13
| | | | | | to search for an invalid multibyte code. In unibyte case, no need to check whether there are translations in more than one charset; just set charset_base to 0.
* (Freplace_match): Set OPOINT clearly for the caseRichard M. Stallman1998-12-011-1/+3
| | | | where point is in the middle of the text to be replaced.
* (wordify): Fix i_byte even in unibyte case for copy loop.Richard M. Stallman1998-06-291-3/+10
| | | | If input is unibyte, make the output unibyte.
* (Freplace_match): Work by chars, not by bytes,Karl Heuer1998-06-201-16/+20
| | | | for scanning the old text, and for inserting new string in buffer.
* (shrink_regexp_cache): New function.Richard M. Stallman1998-05-241-0/+17
|
* (search_buffer): Set search regs for all success with an empty string.Richard M. Stallman1998-05-151-6/+13
| | | | (set_search_regs): Clear out all regs except 0.
* (Freplace_match): Fix the loop for copying textRichard M. Stallman1998-05-071-12/+12
| | | | from a string, in handling lastpos and pos.
* (boyer_moore): Check more reliably for ptr[1] beingRichard M. Stallman1998-05-051-6/+12
| | | | out of range. Use pat_end to point at the pattern's end.
* (search_buffer): Fix casts when assigning raw_pattern.Richard M. Stallman1998-05-031-8/+9
| | | | | | (compile_pattern_1): Declare raw_pattern as unsigned char *. Fix casts when assigning raw_pattern. Cast raw_pattern when calling re_compile_pattern.
* (wordify): Do the second loop by chars, not by bytes.Richard M. Stallman1998-05-011-11/+28
|
* (compile_pattern, compile_pattern_1): Fix mixing ofAndreas Schwab1998-04-141-2/+2
| | | | Lisp_Object and int.
* Fix -Wimplicit warnings.Andreas Schwab1998-04-141-0/+5
|
* (min, max): Make these macros, not functions.Karl Heuer1998-04-091-27/+25
| | | | (scan_buffer, boyer_moore): Simplify args to those macros.
* (Fregexp_quote): Use make_specified_string.Richard M. Stallman1998-03-211-2/+3
|
* Use STRING_BYTES and SET_STRING_BYTES.Richard M. Stallman1998-03-211-15/+15
|
* (Fset_match_data): Renamed from Fstore_match_data.Richard M. Stallman1998-03-141-2/+2
| | | | (syms_of_search): Corresponding change.
* (simple_search): Don't count a character until it matches!Richard M. Stallman1998-03-091-35/+59
| | | | | | Call set_search_regs differently in a forward search. (boyer_moore): Fix up the code that translates the pattern and loops thru equivalent characters.
* (scan_newline): Delete duplicated code.Kenichi Handa1998-02-241-1/+0
|
* (search_buffer): Update POS_BYTE for regexp search.Kenichi Handa1998-02-201-0/+2
|
* (search_command): Check LIM in valid rangeKarl Heuer1998-02-181-2/+3
| | | | before calling CHAR_TO_BYTE.
* (simple_search): Call set_search_regs.Richard M. Stallman1998-02-141-27/+54
| | | | | | | | | (boyer_moore): New arg CHARSET_BASE says which chars to use the translate tables for. (search_buffer): Properly test which chars participate in translation. (TRANSLATE): New arg OUT. Handle non-integer in TRT. All calls changed.
* (search_command): Fix call to search_buffer.Richard M. Stallman1998-02-091-2/+2
|
* (boyer_moore, simple_search): New subroutines.Richard M. Stallman1998-02-081-283/+704
| | | | | | | (search_buffer): For non-regexp, use one of those subroutines. Args TRT and INVERSE_TRT are now Lisp_Object. Callers changed. (compile_pattern_1): Arg TRANSLATE is now Lisp_Object. Calls changed. (compile_pattern): Arg TRANSLATE is now Lisp_Object. Calls changed.
* (search_buffer): New args pos_byte and lim_byte.Richard M. Stallman1998-02-031-11/+16
| | | | (search_command): Pass new args.
* (fast_string_match): Give re_search byte size ofKenichi Handa1998-01-281-6/+10
| | | | | | | STRING. (trivial_regexp_p): Initialize LEN to byte size of REGEXP. (search_buffer): Give re_search_2 STARTPOS, RANGE and STOP by counting them by bytes.
* Update copyright year.Richard M. Stallman1998-01-211-1/+1
|
* (compile_pattern_1): If representation of STRINGKarl Heuer1998-01-181-4/+74
| | | | | | | | does not fit MULTIBYTE, convert its contents. (fast_c_string_match_ignore_case): Pass 0 to compile_pattern as MULTIBYTE. (search_buffer): If representation of STRING does not fit MULTIBYTE, convert its contents.
* (search_buffer): Handle bytes vs chars in non-RE case.Richard M. Stallman1998-01-051-61/+113
| | | | | | | | | | | | | | | Have two locals len and len_byte. (fast_c_string_match_ignore_case): Use string_make_unibyte. (compile_pattern): New arg MULTIBYTE. Callers changed. (wordify): Use make_uninit_multibyte_string. Scan by chars and bytes. (string_match_1): Convert string indices to/from bytes. (Freplace_match): Convert string indices to/from bytes. (Fregexp_quote): Convert string indices to/from bytes.
* (scan_newline): Always restore prev value of immediate_quit.Richard M. Stallman1998-01-011-4/+8
|
* (looking_at_1): Use bytepos to call re_search_2.Richard M. Stallman1998-01-011-102/+236
| | | | | | | | | | | Convert search regs to charpos, if search succeeded. (search_buffer): Likewise. Also convert charpos <-> bytepos in non-regexp case. (scan_buffer): Convert charpos <-> bytepos. (scan_newline): New function. (find_next_newline): Function deleted. (set_search_regs): Args now in bytes; convert to charpos. (Freplace_match): Convert charpos <-> bytepos when scanning case.
* Include "intervals.h" for prototypes.Andreas Schwab1997-11-251-0/+1
|
* (Fsearch_backward): Inherit the current input method onKenichi Handa1997-08-261-2/+2
| | | | | reading STRING. (Fsearch_forward): Likewise.
* (compile_pattern_1): Don't declare val with CONST.Richard M. Stallman1997-07-131-3/+3
|
* (fast_c_string_match_ignore_case):Richard M. Stallman1997-06-091-1/+2
| | | | Renamed from fast_string_match_ignore_case. Set re_match_object.
* (Freplace_match): If opoint is 0, that's relative to ZV.Richard M. Stallman1997-06-021-1/+1
|
* (search_buffer): Use XINT around refs to trt.Richard M. Stallman1997-06-021-5/+5
|
* (Freplace_match): Fix previous change.Richard M. Stallman1997-05-311-2/+4
|
* (Freplace_match): Use move_if_not_intangibleRichard M. Stallman1997-05-311-3/+21
| | | | | | | to handle intangible text better. (looking_at_1): Change using DOWNCASE_TABLE. (string_match_1): Likewise.
* (looking_at_1): Set re_match_object.Richard M. Stallman1997-04-151-297/+8
| | | | | | | | | | | | (string_match_1): Set re_match_object. (fast_string_match): Set re_match_object. (Fskip_chars_forward): Move to syntax.c. (Fskip_chars_backward): Move to syntax.c. (Fskip_syntax_forward): Move to syntax.c. (Fskip_syntax_backward): Move to syntax.c. (skip_chars): Move to syntax.c. (search_buffer): Set re_match_object. (syms_of_search): Move initialization of skip* to syntax.c.
* (skip_chars): Make `c' an unsigned int.Richard M. Stallman1997-04-021-1/+1
|
* (Freplace_match): Give error ifRichard M. Stallman1997-03-221-2/+8
| | | | NEWTEXT uses backslash in an invalid way.