1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-30 17:10:51 -08:00
Commit graph

136 commits

Author SHA1 Message Date
Gerd Moellmann
de182d7041 (looking_at_1): Reset immediate_quit before modifying
global data.
1999-12-25 12:55:46 +00:00
Richard M. Stallman
68e69fbd44 (Freplace_match): For nonliteral replacement,
construct all the new text first, then insert all at once.
1999-12-23 04:45:26 +00:00
Kenichi Handa
daaa6ed868 (search_buffer): Adjusted for the change of CHAR_STRING. 1999-12-15 00:20:26 +00:00
Paul Eggert
68c45bf065 Add support for large files, 64-bit Solaris, system locale codings.
* 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.
1999-10-19 07:25:11 +00:00
Ken Raeburn
c1d497be70 Use XCAR and XCDR instead of explicit member access. 1999-09-13 03:35:33 +00:00
Richard M. Stallman
d24873d402 (compile_pattern_1): Enable RE_CHAR_CLASSES for regexp. 1999-08-29 20:40:00 +00:00
Kenichi Handa
6397418aa1 (boyer_moore): Get charset base value of `untranslated'
by masking by ~CHAR_FIELD3_MASK (instead of ~0xff).
1999-05-11 01:34:28 +00:00
Karl Heuer
21e01890f8 (Fstring_match, Fposix_string_match): Doc fix. 1999-03-04 09:15:37 +00:00
Richard M. Stallman
5ffaf437c9 (search_buffer): Fix previous change. 1999-01-06 22:46:20 +00:00
Kenichi Handa
040272ceb2 (search_buffer): Don't use Boyer-Moore
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.
1998-12-15 04:35:38 +00:00
Richard M. Stallman
9160906f27 (Freplace_match): Set OPOINT clearly for the case
where point is in the middle of the text to be replaced.
1998-12-01 05:17:11 +00:00
Richard M. Stallman
8a2df9371a (wordify): Fix i_byte even in unibyte case for copy loop.
If input is unibyte, make the output unibyte.
1998-06-29 17:20:52 +00:00
Karl Heuer
ac3b28b194 (Freplace_match): Work by chars, not by bytes,
for scanning the old text, and for inserting new string in buffer.
1998-06-20 22:28:28 +00:00
Richard M. Stallman
6efc788795 (shrink_regexp_cache): New function. 1998-05-24 23:24:25 +00:00
Richard M. Stallman
a7e4cdde61 (search_buffer): Set search regs for all success with an empty string.
(set_search_regs): Clear out all regs except 0.
1998-05-15 22:23:01 +00:00
Richard M. Stallman
d131e79c3a (Freplace_match): Fix the loop for copying text
from a string, in handling lastpos and pos.
1998-05-07 23:15:14 +00:00
Richard M. Stallman
cb6792d2db (boyer_moore): Check more reliably for ptr[1] being
out of range.  Use pat_end to point at the pattern's end.
1998-05-05 06:25:58 +00:00
Richard M. Stallman
7276d3d802 (search_buffer): Fix casts when assigning raw_pattern.
(compile_pattern_1): Declare raw_pattern as unsigned char *.
Fix casts when assigning raw_pattern.
Cast raw_pattern when calling re_compile_pattern.
1998-05-03 02:32:58 +00:00
Richard M. Stallman
1e9582d459 (wordify): Do the second loop by chars, not by bytes. 1998-05-01 04:51:20 +00:00
Andreas Schwab
59fab36902 (compile_pattern, compile_pattern_1): Fix mixing of
Lisp_Object and int.
1998-04-14 13:09:08 +00:00
Andreas Schwab
dfcf069d56 Fix -Wimplicit warnings. 1998-04-14 12:25:56 +00:00
Karl Heuer
67ce527d26 (min, max): Make these macros, not functions.
(scan_buffer, boyer_moore): Simplify args to those macros.
1998-04-09 18:50:53 +00:00
Richard M. Stallman
3f8100f1d8 (Fregexp_quote): Use make_specified_string. 1998-03-21 17:50:03 +00:00
Richard M. Stallman
fc932ac6c7 Use STRING_BYTES and SET_STRING_BYTES. 1998-03-21 07:06:14 +00:00
Richard M. Stallman
3f1c005b56 (Fset_match_data): Renamed from Fstore_match_data.
(syms_of_search): Corresponding change.
1998-03-14 04:57:20 +00:00
Richard M. Stallman
ab228c24d5 (simple_search): Don't count a character until it matches!
Call set_search_regs differently in a forward search.
(boyer_moore): Fix up the code that translates the pattern
and loops thru equivalent characters.
1998-03-09 00:25:30 +00:00
Kenichi Handa
dbfab20562 (scan_newline): Delete duplicated code. 1998-02-24 06:57:15 +00:00
Kenichi Handa
26aff1500f (search_buffer): Update POS_BYTE for regexp search. 1998-02-20 01:40:47 +00:00
Karl Heuer
588d2fd5ff (search_command): Check LIM in valid range
before calling CHAR_TO_BYTE.
1998-02-18 22:54:43 +00:00
Richard M. Stallman
aff2ce94e2 (simple_search): Call set_search_regs.
(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.
1998-02-14 08:43:17 +00:00
Richard M. Stallman
3135e9fd79 (search_command): Fix call to search_buffer. 1998-02-09 00:21:15 +00:00
Richard M. Stallman
facdc75048 (boyer_moore, simple_search): New subroutines.
(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.
1998-02-08 21:33:56 +00:00
Richard M. Stallman
9f43ad8568 (search_buffer): New args pos_byte and lim_byte.
(search_command): Pass new args.
1998-02-03 06:15:42 +00:00
Kenichi Handa
4996330bfb (fast_string_match): Give re_search byte size of
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.
1998-01-28 12:37:25 +00:00
Richard M. Stallman
31c8f88101 Update copyright year. 1998-01-21 22:22:17 +00:00
Karl Heuer
f8bd51c41a (compile_pattern_1): If representation of STRING
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.
1998-01-18 04:53:32 +00:00
Richard M. Stallman
0c8533c604 (search_buffer): Handle bytes vs chars in non-RE case.
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.
1998-01-05 17:22:52 +00:00
Richard M. Stallman
d5d57b92e2 (scan_newline): Always restore prev value of immediate_quit. 1998-01-01 06:35:47 +00:00
Richard M. Stallman
fa8ed3e084 (looking_at_1): Use bytepos to call re_search_2.
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.
1998-01-01 02:52:20 +00:00
Andreas Schwab
bf1760bb9d Include "intervals.h" for prototypes. 1997-11-25 13:28:06 +00:00
Kenichi Handa
6af4397485 (Fsearch_backward): Inherit the current input method on
reading STRING.
(Fsearch_forward): Likewise.
1997-08-26 11:42:33 +00:00
Richard M. Stallman
d451e4dbed (compile_pattern_1): Don't declare val with CONST. 1997-07-13 06:36:36 +00:00
Richard M. Stallman
b4577c63a7 (fast_c_string_match_ignore_case):
Renamed from fast_string_match_ignore_case.  Set re_match_object.
1997-06-09 18:01:02 +00:00
Richard M. Stallman
8d808a65ec (Freplace_match): If opoint is 0, that's relative to ZV. 1997-06-02 18:30:09 +00:00
Richard M. Stallman
2fd7a4a4e2 (search_buffer): Use XINT around refs to trt. 1997-06-02 02:19:29 +00:00
Richard M. Stallman
3e18eecf35 (Freplace_match): Fix previous change. 1997-05-31 19:20:26 +00:00
Richard M. Stallman
b0eba99132 (Freplace_match): Use move_if_not_intangible
to handle intangible text better.

(looking_at_1): Change using DOWNCASE_TABLE.
(string_match_1): Likewise.
1997-05-31 07:40:46 +00:00
Richard M. Stallman
8bb43c28a3 (looking_at_1): Set re_match_object.
(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.
1997-04-15 04:52:38 +00:00
Richard M. Stallman
0118dcd343 (skip_chars): Make `c' an unsigned int. 1997-04-02 04:24:41 +00:00
Richard M. Stallman
636a5e284a (Freplace_match): Give error if
NEWTEXT uses backslash in an invalid way.
1997-03-22 04:17:06 +00:00