diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 77 | ||||
| -rw-r--r-- | src/alloc.c | 8 | ||||
| -rw-r--r-- | src/casetab.c | 7 | ||||
| -rw-r--r-- | src/coding.c | 2 | ||||
| -rw-r--r-- | src/editfns.c | 9 | ||||
| -rw-r--r-- | src/eval.c | 7 | ||||
| -rw-r--r-- | src/fileio.c | 179 | ||||
| -rw-r--r-- | src/keyboard.c | 14 | ||||
| -rw-r--r-- | src/lisp.h | 3 | ||||
| -rw-r--r-- | src/ralloc.c | 5 | ||||
| -rw-r--r-- | src/search.c | 223 | ||||
| -rw-r--r-- | src/xdisp.c | 9 | ||||
| -rw-r--r-- | src/xterm.c | 29 |
13 files changed, 344 insertions, 228 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4ea174bdc60..34bf8b41b45 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,6 +1,81 @@ | |||
| 1 | 2005-04-04 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * alloc.c (Fgarbage_collect): Call CHECK_CONS_LIST before and after gc. | ||
| 4 | |||
| 5 | * eval.c (Ffuncall): Always call CHECK_CONS_LIST on entry. | ||
| 6 | Call it again after autoload. | ||
| 7 | |||
| 8 | 2005-04-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 9 | |||
| 10 | * alloc.c (allocate_string_data): Call BLOCK_INPUT before calling | ||
| 11 | mallopt. | ||
| 12 | |||
| 13 | * ralloc.c (r_alloc_init): Ditto. | ||
| 14 | |||
| 15 | 2005-04-01 Kenichi Handa <handa@m17n.org> | ||
| 16 | |||
| 17 | * lisp.h (Vascii_upcase_table, Vascii_canon_table, | ||
| 18 | Vascii_eqv_table): Extern them. | ||
| 19 | |||
| 20 | * casetab.c (set_case_table): If standard is nonzero, setup | ||
| 21 | Vascii_upcase_table, Vascii_canon_table, and Vascii_eqv_table. | ||
| 22 | |||
| 23 | * search.c (looking_at_1): Use current_buffer->case_canon_table, | ||
| 24 | not DOWNCASE_TABLE. | ||
| 25 | (string_match_1): Likewise. | ||
| 26 | (fast_c_string_match_ignore_case): Use Vascii_canon_table, not | ||
| 27 | Vascii_downcase_table. | ||
| 28 | (fast_string_match_ignore_case): Likewise. | ||
| 29 | (search_buffer): Fix checking of boyer-moore usability. | ||
| 30 | (boyer_moore): Calculate translate_prev_byte1/2/3 in advance. No | ||
| 31 | need of tranlating characters in PAT. Fix calculation of | ||
| 32 | simple_translate. | ||
| 33 | |||
| 34 | 2005-03-31 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 35 | |||
| 36 | * xterm.c [HAVE_XAW3D]: Include ThreeD.h for XtNbeNiceToColormap. | ||
| 37 | (x_create_toolkit_scroll_bar): Test XtNbeNiceToColormap before using it. | ||
| 38 | Use XtNtopShadowPixel and XtNbottomShadowPixel. | ||
| 39 | (x_set_toolkit_scroll_bar_thumb): Remove ugly old hack that didn't | ||
| 40 | really work and that breaks with some versions of Xaw3d. | ||
| 41 | |||
| 42 | 2005-03-31 Kenichi Handa <handa@m17n.org> | ||
| 43 | |||
| 44 | * coding.c (syms_of_coding): Fix previous change. | ||
| 45 | |||
| 46 | 2005-03-30 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 47 | |||
| 48 | * fileio.c (search_embedded_absfilename): Fix last change. | ||
| 49 | |||
| 50 | 2005-03-25 Kenichi Handa <handa@m17n.org> | ||
| 51 | |||
| 52 | * coding.c (syms_of_coding): Suggest to use set-coding-category in | ||
| 53 | the docstring of coding-category-list. | ||
| 54 | |||
| 55 | 2005-03-31 Kim F. Storm <storm@cua.dk> | ||
| 56 | |||
| 57 | * keyboard.c (Qmouse_fixup_help_message): New var. | ||
| 58 | (syms_of_keyboard): Intern and staticpro it. | ||
| 59 | (show_help_echo): Apply mouse-fixup-help-message to help string. | ||
| 60 | |||
| 61 | 2005-03-30 Kim F. Storm <storm@cua.dk> | ||
| 62 | |||
| 63 | * xdisp.c (display_line): Allow multiple overlay arrows in window. | ||
| 64 | |||
| 65 | 2005-03-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 66 | |||
| 67 | * fileio.c (Fexpand_file_name): Use IS_DEVICE_SEP. | ||
| 68 | (file_name_absolute_p): New fun, extracted from Ffile_name_absolute_p. | ||
| 69 | (Ffile_name_absolute_p): Use it. | ||
| 70 | (search_embedded_absfilename): New fun, extracted from | ||
| 71 | Fsubstitute_in_file_name. Use file_name_absolute_p. | ||
| 72 | Free the pw data after use. | ||
| 73 | (Fsubstitute_in_file_name): Use it. | ||
| 74 | After cutting a prefix, re-check file-name-handler. | ||
| 75 | |||
| 1 | 2005-03-26 Lennart Borgman <lennart.borgman.073@student.lu.se> | 76 | 2005-03-26 Lennart Borgman <lennart.borgman.073@student.lu.se> |
| 2 | 77 | ||
| 3 | * w32term.h (x_output): add focus_state. | 78 | * w32term.h (x_output): Add focus_state. |
| 4 | 79 | ||
| 5 | * w32term.c (x_focus_changed, w32_detect_focus_change): New functions. | 80 | * w32term.c (x_focus_changed, w32_detect_focus_change): New functions. |
| 6 | (w32_read_socket) [WM_SETFOCUS]: Call w32_detect_focus_change. | 81 | (w32_read_socket) [WM_SETFOCUS]: Call w32_detect_focus_change. |
diff --git a/src/alloc.c b/src/alloc.c index dbb77f77128..c29c4c8e7f6 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1934,14 +1934,18 @@ allocate_string_data (s, nchars, nbytes) | |||
| 1934 | mmap'ed data typically have an address towards the top of the | 1934 | mmap'ed data typically have an address towards the top of the |
| 1935 | address space, which won't fit into an EMACS_INT (at least on | 1935 | address space, which won't fit into an EMACS_INT (at least on |
| 1936 | 32-bit systems with the current tagging scheme). --fx */ | 1936 | 32-bit systems with the current tagging scheme). --fx */ |
| 1937 | BLOCK_INPUT; | ||
| 1937 | mallopt (M_MMAP_MAX, 0); | 1938 | mallopt (M_MMAP_MAX, 0); |
| 1939 | UNBLOCK_INPUT; | ||
| 1938 | #endif | 1940 | #endif |
| 1939 | 1941 | ||
| 1940 | b = (struct sblock *) lisp_malloc (size + GC_STRING_EXTRA, MEM_TYPE_NON_LISP); | 1942 | b = (struct sblock *) lisp_malloc (size + GC_STRING_EXTRA, MEM_TYPE_NON_LISP); |
| 1941 | 1943 | ||
| 1942 | #ifdef DOUG_LEA_MALLOC | 1944 | #ifdef DOUG_LEA_MALLOC |
| 1943 | /* Back to a reasonable maximum of mmap'ed areas. */ | 1945 | /* Back to a reasonable maximum of mmap'ed areas. */ |
| 1946 | BLOCK_INPUT; | ||
| 1944 | mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); | 1947 | mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); |
| 1948 | UNBLOCK_INPUT; | ||
| 1945 | #endif | 1949 | #endif |
| 1946 | 1950 | ||
| 1947 | b->next_free = &b->first_data; | 1951 | b->next_free = &b->first_data; |
| @@ -4684,6 +4688,8 @@ returns nil, because real GC can't be done. */) | |||
| 4684 | if (pure_bytes_used_before_overflow) | 4688 | if (pure_bytes_used_before_overflow) |
| 4685 | return Qnil; | 4689 | return Qnil; |
| 4686 | 4690 | ||
| 4691 | CHECK_CONS_LIST (); | ||
| 4692 | |||
| 4687 | /* Don't keep undo information around forever. | 4693 | /* Don't keep undo information around forever. |
| 4688 | Do this early on, so it is no problem if the user quits. */ | 4694 | Do this early on, so it is no problem if the user quits. */ |
| 4689 | { | 4695 | { |
| @@ -4878,6 +4884,8 @@ returns nil, because real GC can't be done. */) | |||
| 4878 | 4884 | ||
| 4879 | UNBLOCK_INPUT; | 4885 | UNBLOCK_INPUT; |
| 4880 | 4886 | ||
| 4887 | CHECK_CONS_LIST (); | ||
| 4888 | |||
| 4881 | /* clear_marks (); */ | 4889 | /* clear_marks (); */ |
| 4882 | gc_in_progress = 0; | 4890 | gc_in_progress = 0; |
| 4883 | 4891 | ||
diff --git a/src/casetab.c b/src/casetab.c index 5ba025e2b5a..d7dcb420c83 100644 --- a/src/casetab.c +++ b/src/casetab.c | |||
| @@ -162,7 +162,12 @@ set_case_table (table, standard) | |||
| 162 | XCHAR_TABLE (canon)->extras[2] = eqv; | 162 | XCHAR_TABLE (canon)->extras[2] = eqv; |
| 163 | 163 | ||
| 164 | if (standard) | 164 | if (standard) |
| 165 | Vascii_downcase_table = table; | 165 | { |
| 166 | Vascii_downcase_table = table; | ||
| 167 | Vascii_upcase_table = up; | ||
| 168 | Vascii_canon_table = canon; | ||
| 169 | Vascii_eqv_table = eqv; | ||
| 170 | } | ||
| 166 | else | 171 | else |
| 167 | { | 172 | { |
| 168 | current_buffer->downcase_table = table; | 173 | current_buffer->downcase_table = table; |
diff --git a/src/coding.c b/src/coding.c index 3b6b82aeea4..a1dd77872f5 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -7821,7 +7821,7 @@ associated with each coding-category one by one in this order. When | |||
| 7821 | one algorithm agrees with a byte sequence of source text, the coding | 7821 | one algorithm agrees with a byte sequence of source text, the coding |
| 7822 | system bound to the corresponding coding-category is selected. | 7822 | system bound to the corresponding coding-category is selected. |
| 7823 | 7823 | ||
| 7824 | Don't modify this variable directly, but use `set-coding-category'. */); | 7824 | Don't modify this variable directly, but use `set-coding-priority'. */); |
| 7825 | { | 7825 | { |
| 7826 | int i; | 7826 | int i; |
| 7827 | 7827 | ||
diff --git a/src/editfns.c b/src/editfns.c index 0587d66bb0f..f77b9cafc80 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Lisp functions pertaining to editing. | 1 | /* Lisp functions pertaining to editing. |
| 2 | Copyright (C) 1985,86,87,89,93,94,95,96,97,98,1999,2000,01,02,03,2004 | 2 | Copyright (C) 1985, 1986, 1987, 1989, 1993, 1994, 1995, 1996, 1997, 1998, |
| 3 | Free Software Foundation, Inc. | 3 | 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -265,10 +265,7 @@ clip_to_bounds (lower, num, upper) | |||
| 265 | 265 | ||
| 266 | DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ", | 266 | DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ", |
| 267 | doc: /* Set point to POSITION, a number or marker. | 267 | doc: /* Set point to POSITION, a number or marker. |
| 268 | Beginning of buffer is position (point-min), end is (point-max). | 268 | Beginning of buffer is position (point-min), end is (point-max). */) |
| 269 | If the position is in the middle of a multibyte form, | ||
| 270 | the actual point is set at the head of the multibyte form | ||
| 271 | except in the case that `enable-multibyte-characters' is nil. */) | ||
| 272 | (position) | 269 | (position) |
| 273 | register Lisp_Object position; | 270 | register Lisp_Object position; |
| 274 | { | 271 | { |
diff --git a/src/eval.c b/src/eval.c index bf4fec4f8a1..8700ca222ce 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -2742,6 +2742,8 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) | |||
| 2742 | if (debug_on_next_call) | 2742 | if (debug_on_next_call) |
| 2743 | do_debug_on_call (Qlambda); | 2743 | do_debug_on_call (Qlambda); |
| 2744 | 2744 | ||
| 2745 | CHECK_CONS_LIST (); | ||
| 2746 | |||
| 2745 | retry: | 2747 | retry: |
| 2746 | 2748 | ||
| 2747 | fun = args[0]; | 2749 | fun = args[0]; |
| @@ -2750,9 +2752,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) | |||
| 2750 | 2752 | ||
| 2751 | if (SUBRP (fun)) | 2753 | if (SUBRP (fun)) |
| 2752 | { | 2754 | { |
| 2753 | CHECK_CONS_LIST (); | 2755 | if (numargs < XSUBR (fun)->min_args |
| 2754 | |||
| 2755 | if (numargs < XSUBR (fun)->min_args | ||
| 2756 | || (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < numargs)) | 2756 | || (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < numargs)) |
| 2757 | { | 2757 | { |
| 2758 | XSETFASTINT (lisp_numargs, numargs); | 2758 | XSETFASTINT (lisp_numargs, numargs); |
| @@ -2844,6 +2844,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) | |||
| 2844 | else if (EQ (funcar, Qautoload)) | 2844 | else if (EQ (funcar, Qautoload)) |
| 2845 | { | 2845 | { |
| 2846 | do_autoload (fun, args[0]); | 2846 | do_autoload (fun, args[0]); |
| 2847 | CHECK_CONS_LIST (); | ||
| 2847 | goto retry; | 2848 | goto retry; |
| 2848 | } | 2849 | } |
| 2849 | else | 2850 | else |
diff --git a/src/fileio.c b/src/fileio.c index 60d9c46b6eb..e1da0fc6918 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1016,7 +1016,7 @@ probably use `make-temp-file' instead, except in three circumstances: | |||
| 1016 | DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, | 1016 | DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, |
| 1017 | doc: /* Convert filename NAME to absolute, and canonicalize it. | 1017 | doc: /* Convert filename NAME to absolute, and canonicalize it. |
| 1018 | Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative | 1018 | Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative |
| 1019 | (does not start with slash); if DEFAULT-DIRECTORY is nil or missing, | 1019 | \(does not start with slash); if DEFAULT-DIRECTORY is nil or missing, |
| 1020 | the current buffer's value of default-directory is used. | 1020 | the current buffer's value of default-directory is used. |
| 1021 | File name components that are `.' are removed, and | 1021 | File name components that are `.' are removed, and |
| 1022 | so are file name components followed by `..', along with the `..' itself; | 1022 | so are file name components followed by `..', along with the `..' itself; |
| @@ -1466,7 +1466,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1466 | indirectly by prepending newdir to nm if necessary, and using | 1466 | indirectly by prepending newdir to nm if necessary, and using |
| 1467 | cwd (or the wd of newdir's drive) as the new newdir. */ | 1467 | cwd (or the wd of newdir's drive) as the new newdir. */ |
| 1468 | 1468 | ||
| 1469 | if (IS_DRIVE (newdir[0]) && newdir[1] == ':') | 1469 | if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1])) |
| 1470 | { | 1470 | { |
| 1471 | drive = newdir[0]; | 1471 | drive = newdir[0]; |
| 1472 | newdir += 2; | 1472 | newdir += 2; |
| @@ -1489,7 +1489,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1489 | } | 1489 | } |
| 1490 | 1490 | ||
| 1491 | /* Strip off drive name from prefix, if present. */ | 1491 | /* Strip off drive name from prefix, if present. */ |
| 1492 | if (IS_DRIVE (newdir[0]) && newdir[1] == ':') | 1492 | if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1])) |
| 1493 | { | 1493 | { |
| 1494 | drive = newdir[0]; | 1494 | drive = newdir[0]; |
| 1495 | newdir += 2; | 1495 | newdir += 2; |
| @@ -1723,7 +1723,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1723 | DEAFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, | 1723 | DEAFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, |
| 1724 | "Convert FILENAME to absolute, and canonicalize it.\n\ | 1724 | "Convert FILENAME to absolute, and canonicalize it.\n\ |
| 1725 | Second arg DEFAULT is directory to start with if FILENAME is relative\n\ | 1725 | Second arg DEFAULT is directory to start with if FILENAME is relative\n\ |
| 1726 | (does not start with slash); if DEFAULT is nil or missing,\n\ | 1726 | \(does not start with slash); if DEFAULT is nil or missing,\n\ |
| 1727 | the current buffer's value of default-directory is used.\n\ | 1727 | the current buffer's value of default-directory is used.\n\ |
| 1728 | Filenames containing `.' or `..' as components are simplified;\n\ | 1728 | Filenames containing `.' or `..' as components are simplified;\n\ |
| 1729 | initial `~/' expands to your home directory.\n\ | 1729 | initial `~/' expands to your home directory.\n\ |
| @@ -2042,6 +2042,75 @@ See also the function `substitute-in-file-name'.") | |||
| 2042 | } | 2042 | } |
| 2043 | #endif | 2043 | #endif |
| 2044 | 2044 | ||
| 2045 | /* If /~ or // appears, discard everything through first slash. */ | ||
| 2046 | static int | ||
| 2047 | file_name_absolute_p (filename) | ||
| 2048 | const unsigned char *filename; | ||
| 2049 | { | ||
| 2050 | return | ||
| 2051 | (IS_DIRECTORY_SEP (*filename) || *filename == '~' | ||
| 2052 | #ifdef VMS | ||
| 2053 | /* ??? This criterion is probably wrong for '<'. */ | ||
| 2054 | || index (filename, ':') || index (filename, '<') | ||
| 2055 | || (*filename == '[' && (filename[1] != '-' | ||
| 2056 | || (filename[2] != '.' && filename[2] != ']')) | ||
| 2057 | && filename[1] != '.') | ||
| 2058 | #endif /* VMS */ | ||
| 2059 | #ifdef DOS_NT | ||
| 2060 | || (IS_DRIVE (*filename) && IS_DEVICE_SEP (filename[1]) | ||
| 2061 | && IS_DIRECTORY_SEP (filename[2])) | ||
| 2062 | #endif | ||
| 2063 | ); | ||
| 2064 | } | ||
| 2065 | |||
| 2066 | static unsigned char * | ||
| 2067 | search_embedded_absfilename (nm, endp) | ||
| 2068 | unsigned char *nm, *endp; | ||
| 2069 | { | ||
| 2070 | unsigned char *p, *s; | ||
| 2071 | |||
| 2072 | for (p = nm + 1; p < endp; p++) | ||
| 2073 | { | ||
| 2074 | if ((0 | ||
| 2075 | #ifdef VMS | ||
| 2076 | || p[-1] == ':' || p[-1] == ']' || p[-1] == '>' | ||
| 2077 | #endif /* VMS */ | ||
| 2078 | || IS_DIRECTORY_SEP (p[-1])) | ||
| 2079 | && file_name_absolute_p (p) | ||
| 2080 | #if defined (APOLLO) || defined (WINDOWSNT) || defined(CYGWIN) | ||
| 2081 | /* // at start of file name is meaningful in Apollo, | ||
| 2082 | WindowsNT and Cygwin systems. */ | ||
| 2083 | && !(IS_DIRECTORY_SEP (p[0]) && p - 1 == nm) | ||
| 2084 | #endif /* not (APOLLO || WINDOWSNT || CYGWIN) */ | ||
| 2085 | ) | ||
| 2086 | { | ||
| 2087 | for (s = p; *s && (!IS_DIRECTORY_SEP (*s) | ||
| 2088 | #ifdef VMS | ||
| 2089 | && *s != ':' | ||
| 2090 | #endif /* VMS */ | ||
| 2091 | ); s++); | ||
| 2092 | if (p[0] == '~' && s > p + 1) /* we've got "/~something/" */ | ||
| 2093 | { | ||
| 2094 | unsigned char *o = alloca (s - p + 1); | ||
| 2095 | struct passwd *pw; | ||
| 2096 | bcopy (p, o, s - p); | ||
| 2097 | o [s - p] = 0; | ||
| 2098 | |||
| 2099 | /* If we have ~user and `user' exists, discard | ||
| 2100 | everything up to ~. But if `user' does not exist, leave | ||
| 2101 | ~user alone, it might be a literal file name. */ | ||
| 2102 | if ((pw = getpwnam (o + 1))) | ||
| 2103 | return p; | ||
| 2104 | else | ||
| 2105 | xfree (pw); | ||
| 2106 | } | ||
| 2107 | else | ||
| 2108 | return p; | ||
| 2109 | } | ||
| 2110 | } | ||
| 2111 | return NULL; | ||
| 2112 | } | ||
| 2113 | |||
| 2045 | DEFUN ("substitute-in-file-name", Fsubstitute_in_file_name, | 2114 | DEFUN ("substitute-in-file-name", Fsubstitute_in_file_name, |
| 2046 | Ssubstitute_in_file_name, 1, 1, 0, | 2115 | Ssubstitute_in_file_name, 1, 1, 0, |
| 2047 | doc: /* Substitute environment variables referred to in FILENAME. | 2116 | doc: /* Substitute environment variables referred to in FILENAME. |
| @@ -2063,7 +2132,6 @@ duplicates what `expand-file-name' does. */) | |||
| 2063 | int total = 0; | 2132 | int total = 0; |
| 2064 | int substituted = 0; | 2133 | int substituted = 0; |
| 2065 | unsigned char *xnm; | 2134 | unsigned char *xnm; |
| 2066 | struct passwd *pw; | ||
| 2067 | Lisp_Object handler; | 2135 | Lisp_Object handler; |
| 2068 | 2136 | ||
| 2069 | CHECK_STRING (filename); | 2137 | CHECK_STRING (filename); |
| @@ -2083,61 +2151,17 @@ duplicates what `expand-file-name' does. */) | |||
| 2083 | endp = nm + SBYTES (filename); | 2151 | endp = nm + SBYTES (filename); |
| 2084 | 2152 | ||
| 2085 | /* If /~ or // appears, discard everything through first slash. */ | 2153 | /* If /~ or // appears, discard everything through first slash. */ |
| 2086 | 2154 | p = search_embedded_absfilename (nm, endp); | |
| 2087 | for (p = nm; p != endp; p++) | 2155 | if (p) |
| 2088 | { | 2156 | /* Start over with the new string, so we check the file-name-handler |
| 2089 | if ((p[0] == '~' | 2157 | again. Important with filenames like "/home/foo//:/hello///there" |
| 2090 | #if defined (APOLLO) || defined (WINDOWSNT) || defined(CYGWIN) | 2158 | which whould substitute to "/:/hello///there" rather than "/there". */ |
| 2091 | /* // at start of file name is meaningful in Apollo, | 2159 | return Fsubstitute_in_file_name |
| 2092 | WindowsNT and Cygwin systems. */ | 2160 | (make_specified_string (p, -1, endp - p, |
| 2093 | || (IS_DIRECTORY_SEP (p[0]) && p - 1 != nm) | 2161 | STRING_MULTIBYTE (filename))); |
| 2094 | #else /* not (APOLLO || WINDOWSNT || CYGWIN) */ | ||
| 2095 | || IS_DIRECTORY_SEP (p[0]) | ||
| 2096 | #endif /* not (APOLLO || WINDOWSNT || CYGWIN) */ | ||
| 2097 | ) | ||
| 2098 | && p != nm | ||
| 2099 | && (0 | ||
| 2100 | #ifdef VMS | ||
| 2101 | || p[-1] == ':' || p[-1] == ']' || p[-1] == '>' | ||
| 2102 | #endif /* VMS */ | ||
| 2103 | || IS_DIRECTORY_SEP (p[-1]))) | ||
| 2104 | { | ||
| 2105 | for (s = p; *s && (!IS_DIRECTORY_SEP (*s) | ||
| 2106 | #ifdef VMS | ||
| 2107 | && *s != ':' | ||
| 2108 | #endif /* VMS */ | ||
| 2109 | ); s++); | ||
| 2110 | if (p[0] == '~' && s > p + 1) /* we've got "/~something/" */ | ||
| 2111 | { | ||
| 2112 | o = (unsigned char *) alloca (s - p + 1); | ||
| 2113 | bcopy ((char *) p, o, s - p); | ||
| 2114 | o [s - p] = 0; | ||
| 2115 | |||
| 2116 | pw = (struct passwd *) getpwnam (o + 1); | ||
| 2117 | } | ||
| 2118 | /* If we have ~/ or ~user and `user' exists, discard | ||
| 2119 | everything up to ~. But if `user' does not exist, leave | ||
| 2120 | ~user alone, it might be a literal file name. */ | ||
| 2121 | if (IS_DIRECTORY_SEP (p[0]) || s == p + 1 || pw) | ||
| 2122 | { | ||
| 2123 | nm = p; | ||
| 2124 | substituted = 1; | ||
| 2125 | } | ||
| 2126 | } | ||
| 2127 | #ifdef DOS_NT | ||
| 2128 | /* see comment in expand-file-name about drive specifiers */ | ||
| 2129 | else if (IS_DRIVE (p[0]) && p[1] == ':' | ||
| 2130 | && p > nm && IS_DIRECTORY_SEP (p[-1])) | ||
| 2131 | { | ||
| 2132 | nm = p; | ||
| 2133 | substituted = 1; | ||
| 2134 | } | ||
| 2135 | #endif /* DOS_NT */ | ||
| 2136 | } | ||
| 2137 | 2162 | ||
| 2138 | #ifdef VMS | 2163 | #ifdef VMS |
| 2139 | return make_specified_string (nm, -1, strlen (nm), | 2164 | return filename; |
| 2140 | STRING_MULTIBYTE (filename)); | ||
| 2141 | #else | 2165 | #else |
| 2142 | 2166 | ||
| 2143 | /* See if any variables are substituted into the string | 2167 | /* See if any variables are substituted into the string |
| @@ -2263,22 +2287,11 @@ duplicates what `expand-file-name' does. */) | |||
| 2263 | *x = 0; | 2287 | *x = 0; |
| 2264 | 2288 | ||
| 2265 | /* If /~ or // appears, discard everything through first slash. */ | 2289 | /* If /~ or // appears, discard everything through first slash. */ |
| 2266 | 2290 | while ((p = search_embedded_absfilename (xnm, x))) | |
| 2267 | for (p = xnm; p != x; p++) | 2291 | /* This time we do not start over because we've already expanded envvars |
| 2268 | if ((p[0] == '~' | 2292 | and replaced $$ with $. Maybe we should start over as well, but we'd |
| 2269 | #if defined (APOLLO) || defined (WINDOWSNT) || defined(CYGWIN) | 2293 | need to quote some $ to $$ first. */ |
| 2270 | || (IS_DIRECTORY_SEP (p[0]) && p - 1 != xnm) | 2294 | xnm = p; |
| 2271 | #else /* not (APOLLO || WINDOWSNT || CYGWIN) */ | ||
| 2272 | || IS_DIRECTORY_SEP (p[0]) | ||
| 2273 | #endif /* not (APOLLO || WINDOWSNT || CYGWIN) */ | ||
| 2274 | ) | ||
| 2275 | && p != xnm && IS_DIRECTORY_SEP (p[-1])) | ||
| 2276 | xnm = p; | ||
| 2277 | #ifdef DOS_NT | ||
| 2278 | else if (IS_DRIVE (p[0]) && p[1] == ':' | ||
| 2279 | && p > xnm && IS_DIRECTORY_SEP (p[-1])) | ||
| 2280 | xnm = p; | ||
| 2281 | #endif | ||
| 2282 | 2295 | ||
| 2283 | return make_specified_string (xnm, -1, x - xnm, STRING_MULTIBYTE (filename)); | 2296 | return make_specified_string (xnm, -1, x - xnm, STRING_MULTIBYTE (filename)); |
| 2284 | 2297 | ||
| @@ -2961,24 +2974,8 @@ On Unix, this is a name starting with a `/' or a `~'. */) | |||
| 2961 | (filename) | 2974 | (filename) |
| 2962 | Lisp_Object filename; | 2975 | Lisp_Object filename; |
| 2963 | { | 2976 | { |
| 2964 | const unsigned char *ptr; | ||
| 2965 | |||
| 2966 | CHECK_STRING (filename); | 2977 | CHECK_STRING (filename); |
| 2967 | ptr = SDATA (filename); | 2978 | return file_name_absolute_p (SDATA (filename)) ? Qt : Qnil; |
| 2968 | if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' | ||
| 2969 | #ifdef VMS | ||
| 2970 | /* ??? This criterion is probably wrong for '<'. */ | ||
| 2971 | || index (ptr, ':') || index (ptr, '<') | ||
| 2972 | || (*ptr == '[' && (ptr[1] != '-' || (ptr[2] != '.' && ptr[2] != ']')) | ||
| 2973 | && ptr[1] != '.') | ||
| 2974 | #endif /* VMS */ | ||
| 2975 | #ifdef DOS_NT | ||
| 2976 | || (IS_DRIVE (*ptr) && ptr[1] == ':' && IS_DIRECTORY_SEP (ptr[2])) | ||
| 2977 | #endif | ||
| 2978 | ) | ||
| 2979 | return Qt; | ||
| 2980 | else | ||
| 2981 | return Qnil; | ||
| 2982 | } | 2979 | } |
| 2983 | 2980 | ||
| 2984 | /* Return nonzero if file FILENAME exists and can be executed. */ | 2981 | /* Return nonzero if file FILENAME exists and can be executed. */ |
diff --git a/src/keyboard.c b/src/keyboard.c index f29a7676d34..39891b1a95d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -514,6 +514,10 @@ Lisp_Object Qmake_frame_visible; | |||
| 514 | Lisp_Object Qselect_window; | 514 | Lisp_Object Qselect_window; |
| 515 | Lisp_Object Qhelp_echo; | 515 | Lisp_Object Qhelp_echo; |
| 516 | 516 | ||
| 517 | #ifdef HAVE_MOUSE | ||
| 518 | Lisp_Object Qmouse_fixup_help_message; | ||
| 519 | #endif | ||
| 520 | |||
| 517 | /* Symbols to denote kinds of events. */ | 521 | /* Symbols to denote kinds of events. */ |
| 518 | Lisp_Object Qfunction_key; | 522 | Lisp_Object Qfunction_key; |
| 519 | Lisp_Object Qmouse_click; | 523 | Lisp_Object Qmouse_click; |
| @@ -2298,6 +2302,11 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo) | |||
| 2298 | return; | 2302 | return; |
| 2299 | } | 2303 | } |
| 2300 | 2304 | ||
| 2305 | #ifdef HAVE_MOUSE | ||
| 2306 | if (!noninteractive && STRINGP (help)) | ||
| 2307 | help = call1 (Qmouse_fixup_help_message, help); | ||
| 2308 | #endif | ||
| 2309 | |||
| 2301 | if (STRINGP (help) || NILP (help)) | 2310 | if (STRINGP (help) || NILP (help)) |
| 2302 | { | 2311 | { |
| 2303 | if (!NILP (Vshow_help_function)) | 2312 | if (!NILP (Vshow_help_function)) |
| @@ -11010,6 +11019,11 @@ syms_of_keyboard () | |||
| 11010 | Qmenu_bar = intern ("menu-bar"); | 11019 | Qmenu_bar = intern ("menu-bar"); |
| 11011 | staticpro (&Qmenu_bar); | 11020 | staticpro (&Qmenu_bar); |
| 11012 | 11021 | ||
| 11022 | #ifdef HAVE_MOUSE | ||
| 11023 | Qmouse_fixup_help_message = intern ("mouse-fixup-help-message"); | ||
| 11024 | staticpro (&Qmouse_fixup_help_message); | ||
| 11025 | #endif | ||
| 11026 | |||
| 11013 | Qabove_handle = intern ("above-handle"); | 11027 | Qabove_handle = intern ("above-handle"); |
| 11014 | staticpro (&Qabove_handle); | 11028 | staticpro (&Qabove_handle); |
| 11015 | Qhandle = intern ("handle"); | 11029 | Qhandle = intern ("handle"); |
diff --git a/src/lisp.h b/src/lisp.h index f770a29cf4f..e1727697802 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1861,7 +1861,8 @@ extern Lisp_Object case_temp2; | |||
| 1861 | NATNUMP (case_temp2)) \ | 1861 | NATNUMP (case_temp2)) \ |
| 1862 | ? XFASTINT (case_temp2) : case_temp1) | 1862 | ? XFASTINT (case_temp2) : case_temp1) |
| 1863 | 1863 | ||
| 1864 | extern Lisp_Object Vascii_downcase_table; | 1864 | extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table; |
| 1865 | extern Lisp_Object Vascii_canon_table, Vascii_eqv_table; | ||
| 1865 | 1866 | ||
| 1866 | /* Number of bytes of structure consed since last GC. */ | 1867 | /* Number of bytes of structure consed since last GC. */ |
| 1867 | 1868 | ||
diff --git a/src/ralloc.c b/src/ralloc.c index 75c25258a9d..fd0d62e1977 100644 --- a/src/ralloc.c +++ b/src/ralloc.c | |||
| @@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 28 | 28 | ||
| 29 | #include <config.h> | 29 | #include <config.h> |
| 30 | #include "lisp.h" /* Needed for VALBITS. */ | 30 | #include "lisp.h" /* Needed for VALBITS. */ |
| 31 | #include "blockinput.h" | ||
| 31 | 32 | ||
| 32 | #ifdef HAVE_UNISTD_H | 33 | #ifdef HAVE_UNISTD_H |
| 33 | #include <unistd.h> | 34 | #include <unistd.h> |
| @@ -1255,7 +1256,9 @@ r_alloc_init () | |||
| 1255 | #endif | 1256 | #endif |
| 1256 | 1257 | ||
| 1257 | #ifdef DOUG_LEA_MALLOC | 1258 | #ifdef DOUG_LEA_MALLOC |
| 1258 | mallopt (M_TOP_PAD, 64 * 4096); | 1259 | BLOCK_INPUT; |
| 1260 | mallopt (M_TOP_PAD, 64 * 4096); | ||
| 1261 | UNBLOCK_INPUT; | ||
| 1259 | #else | 1262 | #else |
| 1260 | #ifndef SYSTEM_MALLOC | 1263 | #ifndef SYSTEM_MALLOC |
| 1261 | /* Give GNU malloc's morecore some hysteresis | 1264 | /* Give GNU malloc's morecore some hysteresis |
diff --git a/src/search.c b/src/search.c index 7e990f2bfd7..d86a7cca7b2 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -293,7 +293,7 @@ looking_at_1 (string, posix) | |||
| 293 | CHECK_STRING (string); | 293 | CHECK_STRING (string); |
| 294 | bufp = compile_pattern (string, &search_regs, | 294 | bufp = compile_pattern (string, &search_regs, |
| 295 | (!NILP (current_buffer->case_fold_search) | 295 | (!NILP (current_buffer->case_fold_search) |
| 296 | ? DOWNCASE_TABLE : Qnil), | 296 | ? current_buffer->case_canon_table : Qnil), |
| 297 | posix, | 297 | posix, |
| 298 | !NILP (current_buffer->enable_multibyte_characters)); | 298 | !NILP (current_buffer->enable_multibyte_characters)); |
| 299 | 299 | ||
| @@ -399,7 +399,7 @@ string_match_1 (regexp, string, start, posix) | |||
| 399 | 399 | ||
| 400 | bufp = compile_pattern (regexp, &search_regs, | 400 | bufp = compile_pattern (regexp, &search_regs, |
| 401 | (!NILP (current_buffer->case_fold_search) | 401 | (!NILP (current_buffer->case_fold_search) |
| 402 | ? DOWNCASE_TABLE : Qnil), | 402 | ? current_buffer->case_canon_table : Qnil), |
| 403 | posix, | 403 | posix, |
| 404 | STRING_MULTIBYTE (string)); | 404 | STRING_MULTIBYTE (string)); |
| 405 | immediate_quit = 1; | 405 | immediate_quit = 1; |
| @@ -499,7 +499,7 @@ fast_c_string_match_ignore_case (regexp, string) | |||
| 499 | regexp = string_make_unibyte (regexp); | 499 | regexp = string_make_unibyte (regexp); |
| 500 | re_match_object = Qt; | 500 | re_match_object = Qt; |
| 501 | bufp = compile_pattern (regexp, 0, | 501 | bufp = compile_pattern (regexp, 0, |
| 502 | Vascii_downcase_table, 0, | 502 | Vascii_canon_table, 0, |
| 503 | 0); | 503 | 0); |
| 504 | immediate_quit = 1; | 504 | immediate_quit = 1; |
| 505 | val = re_search (bufp, string, len, 0, len, 0); | 505 | val = re_search (bufp, string, len, 0, len, 0); |
| @@ -516,7 +516,7 @@ fast_string_match_ignore_case (regexp, string) | |||
| 516 | int val; | 516 | int val; |
| 517 | struct re_pattern_buffer *bufp; | 517 | struct re_pattern_buffer *bufp; |
| 518 | 518 | ||
| 519 | bufp = compile_pattern (regexp, 0, Vascii_downcase_table, | 519 | bufp = compile_pattern (regexp, 0, Vascii_canon_table, |
| 520 | 0, STRING_MULTIBYTE (string)); | 520 | 0, STRING_MULTIBYTE (string)); |
| 521 | immediate_quit = 1; | 521 | immediate_quit = 1; |
| 522 | re_match_object = string; | 522 | re_match_object = string; |
| @@ -1175,7 +1175,9 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1175 | unsigned char *patbuf; | 1175 | unsigned char *patbuf; |
| 1176 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 1176 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); |
| 1177 | unsigned char *base_pat = SDATA (string); | 1177 | unsigned char *base_pat = SDATA (string); |
| 1178 | int charset_base = -1; | 1178 | /* Set to nozero if we find a non-ASCII char that need |
| 1179 | translation. */ | ||
| 1180 | int charset_base = 0; | ||
| 1179 | int boyer_moore_ok = 1; | 1181 | int boyer_moore_ok = 1; |
| 1180 | 1182 | ||
| 1181 | /* MULTIBYTE says whether the text to be searched is multibyte. | 1183 | /* MULTIBYTE says whether the text to be searched is multibyte. |
| @@ -1221,9 +1223,17 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1221 | base_pat = raw_pattern; | 1223 | base_pat = raw_pattern; |
| 1222 | if (multibyte) | 1224 | if (multibyte) |
| 1223 | { | 1225 | { |
| 1226 | /* Fill patbuf by translated characters in STRING while | ||
| 1227 | checking if we can use boyer-moore search. If TRT is | ||
| 1228 | non-nil, we can use boyer-moore search only if TRT can be | ||
| 1229 | represented by the byte array of 256 elements. For that, | ||
| 1230 | all non-ASCII case-equivalents of all case-senstive | ||
| 1231 | characters in STRING must belong to the same charset and | ||
| 1232 | row. */ | ||
| 1233 | |||
| 1224 | while (--len >= 0) | 1234 | while (--len >= 0) |
| 1225 | { | 1235 | { |
| 1226 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 1236 | unsigned char str_base[MAX_MULTIBYTE_LENGTH], *str; |
| 1227 | int c, translated, inverse; | 1237 | int c, translated, inverse; |
| 1228 | int in_charlen, charlen; | 1238 | int in_charlen, charlen; |
| 1229 | 1239 | ||
| @@ -1233,50 +1243,62 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1233 | if (RE && *base_pat == '\\') | 1243 | if (RE && *base_pat == '\\') |
| 1234 | { | 1244 | { |
| 1235 | len--; | 1245 | len--; |
| 1246 | raw_pattern_size--; | ||
| 1236 | len_byte--; | 1247 | len_byte--; |
| 1237 | base_pat++; | 1248 | base_pat++; |
| 1238 | } | 1249 | } |
| 1239 | 1250 | ||
| 1240 | c = STRING_CHAR_AND_LENGTH (base_pat, len_byte, in_charlen); | 1251 | c = STRING_CHAR_AND_LENGTH (base_pat, len_byte, in_charlen); |
| 1241 | 1252 | ||
| 1242 | /* Translate the character, if requested. */ | 1253 | if (NILP (trt)) |
| 1243 | TRANSLATE (translated, trt, c); | ||
| 1244 | /* If translation changed the byte-length, go back | ||
| 1245 | to the original character. */ | ||
| 1246 | charlen = CHAR_STRING (translated, str); | ||
| 1247 | if (in_charlen != charlen) | ||
| 1248 | { | 1254 | { |
| 1249 | translated = c; | 1255 | str = base_pat; |
| 1250 | charlen = CHAR_STRING (c, str); | 1256 | charlen = in_charlen; |
| 1251 | } | 1257 | } |
| 1252 | 1258 | else | |
| 1253 | /* If we are searching for something strange, | ||
| 1254 | an invalid multibyte code, don't use boyer-moore. */ | ||
| 1255 | if (! ASCII_BYTE_P (translated) | ||
| 1256 | && (charlen == 1 /* 8bit code */ | ||
| 1257 | || charlen != in_charlen /* invalid multibyte code */ | ||
| 1258 | )) | ||
| 1259 | boyer_moore_ok = 0; | ||
| 1260 | |||
| 1261 | TRANSLATE (inverse, inverse_trt, c); | ||
| 1262 | |||
| 1263 | /* Did this char actually get translated? | ||
| 1264 | Would any other char get translated into it? */ | ||
| 1265 | if (translated != c || inverse != c) | ||
| 1266 | { | 1259 | { |
| 1267 | /* Keep track of which character set row | 1260 | /* Translate the character. */ |
| 1268 | contains the characters that need translation. */ | 1261 | TRANSLATE (translated, trt, c); |
| 1269 | int charset_base_code = c & ~CHAR_FIELD3_MASK; | 1262 | charlen = CHAR_STRING (translated, str_base); |
| 1270 | int inverse_charset_base = inverse & ~CHAR_FIELD3_MASK; | 1263 | str = str_base; |
| 1271 | 1264 | ||
| 1272 | if (charset_base_code != inverse_charset_base) | 1265 | /* Check if C has any other case-equivalents. */ |
| 1273 | boyer_moore_ok = 0; | 1266 | TRANSLATE (inverse, inverse_trt, c); |
| 1274 | else if (charset_base == -1) | 1267 | /* If so, check if we can use boyer-moore. */ |
| 1275 | charset_base = charset_base_code; | 1268 | if (c != inverse && boyer_moore_ok) |
| 1276 | else if (charset_base != charset_base_code) | 1269 | { |
| 1277 | /* If two different rows appear, needing translation, | 1270 | /* Check if all equivalents belong to the same |
| 1278 | then we cannot use boyer_moore search. */ | 1271 | charset & row. Note that the check of C |
| 1279 | boyer_moore_ok = 0; | 1272 | itself is done by the last iteration. Note |
| 1273 | also that we don't have to check ASCII | ||
| 1274 | characters because boyer-moore search can | ||
| 1275 | always handle their translation. */ | ||
| 1276 | while (1) | ||
| 1277 | { | ||
| 1278 | if (! ASCII_BYTE_P (inverse)) | ||
| 1279 | { | ||
| 1280 | if (SINGLE_BYTE_CHAR_P (inverse)) | ||
| 1281 | { | ||
| 1282 | /* Boyer-moore search can't handle a | ||
| 1283 | translation of an eight-bit | ||
| 1284 | character. */ | ||
| 1285 | boyer_moore_ok = 0; | ||
| 1286 | break; | ||
| 1287 | } | ||
| 1288 | else if (charset_base == 0) | ||
| 1289 | charset_base = inverse & ~CHAR_FIELD3_MASK; | ||
| 1290 | else if ((inverse & ~CHAR_FIELD3_MASK) | ||
| 1291 | != charset_base) | ||
| 1292 | { | ||
| 1293 | boyer_moore_ok = 0; | ||
| 1294 | break; | ||
| 1295 | } | ||
| 1296 | } | ||
| 1297 | if (c == inverse) | ||
| 1298 | break; | ||
| 1299 | TRANSLATE (inverse, inverse_trt, inverse); | ||
| 1300 | } | ||
| 1301 | } | ||
| 1280 | } | 1302 | } |
| 1281 | 1303 | ||
| 1282 | /* Store this character into the translated pattern. */ | 1304 | /* Store this character into the translated pattern. */ |
| @@ -1300,6 +1322,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1300 | if (RE && *base_pat == '\\') | 1322 | if (RE && *base_pat == '\\') |
| 1301 | { | 1323 | { |
| 1302 | len--; | 1324 | len--; |
| 1325 | raw_pattern_size--; | ||
| 1303 | base_pat++; | 1326 | base_pat++; |
| 1304 | } | 1327 | } |
| 1305 | c = *base_pat++; | 1328 | c = *base_pat++; |
| @@ -1533,16 +1556,18 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte) | |||
| 1533 | return n; | 1556 | return n; |
| 1534 | } | 1557 | } |
| 1535 | 1558 | ||
| 1536 | /* Do Boyer-Moore search N times for the string PAT, | 1559 | /* Do Boyer-Moore search N times for the string BASE_PAT, |
| 1537 | whose length is LEN/LEN_BYTE, | 1560 | whose length is LEN/LEN_BYTE, |
| 1538 | from buffer position POS/POS_BYTE until LIM/LIM_BYTE. | 1561 | from buffer position POS/POS_BYTE until LIM/LIM_BYTE. |
| 1539 | DIRECTION says which direction we search in. | 1562 | DIRECTION says which direction we search in. |
| 1540 | TRT and INVERSE_TRT are translation tables. | 1563 | TRT and INVERSE_TRT are translation tables. |
| 1564 | Characters in PAT are already translated by TRT. | ||
| 1541 | 1565 | ||
| 1542 | This kind of search works if all the characters in PAT that have | 1566 | This kind of search works if all the characters in BASE_PAT that |
| 1543 | nontrivial translation are the same aside from the last byte. This | 1567 | have nontrivial translation are the same aside from the last byte. |
| 1544 | makes it possible to translate just the last byte of a character, | 1568 | This makes it possible to translate just the last byte of a |
| 1545 | and do so after just a simple test of the context. | 1569 | character, and do so after just a simple test of the context. |
| 1570 | CHARSET_BASE is nonzero iff there is such a non-ASCII character. | ||
| 1546 | 1571 | ||
| 1547 | If that criterion is not satisfied, do not call this function. */ | 1572 | If that criterion is not satisfied, do not call this function. */ |
| 1548 | 1573 | ||
| @@ -1569,8 +1594,13 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, | |||
| 1569 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 1594 | int multibyte = ! NILP (current_buffer->enable_multibyte_characters); |
| 1570 | 1595 | ||
| 1571 | unsigned char simple_translate[0400]; | 1596 | unsigned char simple_translate[0400]; |
| 1572 | int translate_prev_byte = 0; | 1597 | /* These are set to the preceding bytes of a byte to be translated |
| 1573 | int translate_anteprev_byte = 0; | 1598 | if charset_base is nonzero. As the maximum byte length of a |
| 1599 | multibyte character is 4, we have to check at most three previous | ||
| 1600 | bytes. */ | ||
| 1601 | int translate_prev_byte1 = 0; | ||
| 1602 | int translate_prev_byte2 = 0; | ||
| 1603 | int translate_prev_byte3 = 0; | ||
| 1574 | 1604 | ||
| 1575 | #ifdef C_ALLOCA | 1605 | #ifdef C_ALLOCA |
| 1576 | int BM_tab_space[0400]; | 1606 | int BM_tab_space[0400]; |
| @@ -1636,6 +1666,23 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, | |||
| 1636 | for (i = 0; i < 0400; i++) | 1666 | for (i = 0; i < 0400; i++) |
| 1637 | simple_translate[i] = i; | 1667 | simple_translate[i] = i; |
| 1638 | 1668 | ||
| 1669 | if (charset_base) | ||
| 1670 | { | ||
| 1671 | /* Setup translate_prev_byte1/2/3 from CHARSET_BASE. Only a | ||
| 1672 | byte following them are the target of translation. */ | ||
| 1673 | int sample_char = charset_base | 0x20; | ||
| 1674 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | ||
| 1675 | int len = CHAR_STRING (sample_char, str); | ||
| 1676 | |||
| 1677 | translate_prev_byte1 = str[len - 2]; | ||
| 1678 | if (len > 2) | ||
| 1679 | { | ||
| 1680 | translate_prev_byte2 = str[len - 3]; | ||
| 1681 | if (len > 3) | ||
| 1682 | translate_prev_byte3 = str[len - 4]; | ||
| 1683 | } | ||
| 1684 | } | ||
| 1685 | |||
| 1639 | i = 0; | 1686 | i = 0; |
| 1640 | while (i != infinity) | 1687 | while (i != infinity) |
| 1641 | { | 1688 | { |
| @@ -1645,57 +1692,37 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, | |||
| 1645 | i = infinity; | 1692 | i = infinity; |
| 1646 | if (! NILP (trt)) | 1693 | if (! NILP (trt)) |
| 1647 | { | 1694 | { |
| 1648 | int ch; | 1695 | /* If the byte currently looking at is a head of a character |
| 1649 | int untranslated; | 1696 | to check case-equivalents, set CH to that character. An |
| 1650 | int this_translated = 1; | 1697 | ASCII character and a non-ASCII character matching with |
| 1651 | 1698 | CHARSET_BASE are to be checked. */ | |
| 1652 | if (multibyte | 1699 | int ch = -1; |
| 1653 | /* Is *PTR the last byte of a character? */ | 1700 | |
| 1654 | && (pat_end - ptr == 1 || CHAR_HEAD_P (ptr[1]))) | 1701 | if (ASCII_BYTE_P (*ptr) || ! multibyte) |
| 1702 | ch = *ptr; | ||
| 1703 | else if (charset_base && CHAR_HEAD_P (*ptr)) | ||
| 1655 | { | 1704 | { |
| 1656 | unsigned char *charstart = ptr; | 1705 | ch = STRING_CHAR (ptr, pat_end - ptr); |
| 1657 | while (! CHAR_HEAD_P (*charstart)) | 1706 | if (charset_base != (ch & ~CHAR_FIELD3_MASK)) |
| 1658 | charstart--; | 1707 | ch = -1; |
| 1659 | untranslated = STRING_CHAR (charstart, ptr - charstart + 1); | ||
| 1660 | if (charset_base == (untranslated & ~CHAR_FIELD3_MASK)) | ||
| 1661 | { | ||
| 1662 | TRANSLATE (ch, trt, untranslated); | ||
| 1663 | if (! CHAR_HEAD_P (*ptr)) | ||
| 1664 | { | ||
| 1665 | translate_prev_byte = ptr[-1]; | ||
| 1666 | if (! CHAR_HEAD_P (translate_prev_byte)) | ||
| 1667 | translate_anteprev_byte = ptr[-2]; | ||
| 1668 | } | ||
| 1669 | } | ||
| 1670 | else | ||
| 1671 | { | ||
| 1672 | this_translated = 0; | ||
| 1673 | ch = *ptr; | ||
| 1674 | } | ||
| 1675 | } | 1708 | } |
| 1676 | else if (!multibyte) | ||
| 1677 | TRANSLATE (ch, trt, *ptr); | ||
| 1678 | else | ||
| 1679 | { | ||
| 1680 | ch = *ptr; | ||
| 1681 | this_translated = 0; | ||
| 1682 | } | ||
| 1683 | |||
| 1684 | if (ch > 0400) | ||
| 1685 | j = ((unsigned char) ch) | 0200; | ||
| 1686 | else | ||
| 1687 | j = (unsigned char) ch; | ||
| 1688 | 1709 | ||
| 1710 | j = *ptr; | ||
| 1689 | if (i == infinity) | 1711 | if (i == infinity) |
| 1690 | stride_for_teases = BM_tab[j]; | 1712 | stride_for_teases = BM_tab[j]; |
| 1691 | 1713 | ||
| 1692 | BM_tab[j] = dirlen - i; | 1714 | BM_tab[j] = dirlen - i; |
| 1693 | /* A translation table is accompanied by its inverse -- see */ | 1715 | /* A translation table is accompanied by its inverse -- see */ |
| 1694 | /* comment following downcase_table for details */ | 1716 | /* comment following downcase_table for details */ |
| 1695 | if (this_translated) | 1717 | if (ch >= 0) |
| 1696 | { | 1718 | { |
| 1697 | int starting_ch = ch; | 1719 | int starting_ch = ch; |
| 1698 | int starting_j = j; | 1720 | int starting_j; |
| 1721 | |||
| 1722 | if (ch > 0400) | ||
| 1723 | starting_j = ((unsigned char) ch) | 0200; | ||
| 1724 | else | ||
| 1725 | starting_j = (unsigned char) ch; | ||
| 1699 | while (1) | 1726 | while (1) |
| 1700 | { | 1727 | { |
| 1701 | TRANSLATE (ch, inverse_trt, ch); | 1728 | TRANSLATE (ch, inverse_trt, ch); |
| @@ -1821,9 +1848,13 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, | |||
| 1821 | || ((cursor == tail_end_ptr | 1848 | || ((cursor == tail_end_ptr |
| 1822 | || CHAR_HEAD_P (cursor[1])) | 1849 | || CHAR_HEAD_P (cursor[1])) |
| 1823 | && (CHAR_HEAD_P (cursor[0]) | 1850 | && (CHAR_HEAD_P (cursor[0]) |
| 1824 | || (translate_prev_byte == cursor[-1] | 1851 | /* Check if this is the last byte of |
| 1825 | && (CHAR_HEAD_P (translate_prev_byte) | 1852 | a translable character. */ |
| 1826 | || translate_anteprev_byte == cursor[-2]))))) | 1853 | || (translate_prev_byte1 == cursor[-1] |
| 1854 | && (CHAR_HEAD_P (translate_prev_byte1) | ||
| 1855 | || (translate_prev_byte2 == cursor[-2] | ||
| 1856 | && (CHAR_HEAD_P (translate_prev_byte2) | ||
| 1857 | || (translate_prev_byte3 == cursor[-3])))))))) | ||
| 1827 | ch = simple_translate[*cursor]; | 1858 | ch = simple_translate[*cursor]; |
| 1828 | else | 1859 | else |
| 1829 | ch = *cursor; | 1860 | ch = *cursor; |
| @@ -1901,9 +1932,13 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, | |||
| 1901 | || ((ptr == tail_end_ptr | 1932 | || ((ptr == tail_end_ptr |
| 1902 | || CHAR_HEAD_P (ptr[1])) | 1933 | || CHAR_HEAD_P (ptr[1])) |
| 1903 | && (CHAR_HEAD_P (ptr[0]) | 1934 | && (CHAR_HEAD_P (ptr[0]) |
| 1904 | || (translate_prev_byte == ptr[-1] | 1935 | /* Check if this is the last byte of a |
| 1905 | && (CHAR_HEAD_P (translate_prev_byte) | 1936 | translable character. */ |
| 1906 | || translate_anteprev_byte == ptr[-2]))))) | 1937 | || (translate_prev_byte1 == ptr[-1] |
| 1938 | && (CHAR_HEAD_P (translate_prev_byte1) | ||
| 1939 | || (translate_prev_byte2 == ptr[-2] | ||
| 1940 | && (CHAR_HEAD_P (translate_prev_byte2) | ||
| 1941 | || translate_prev_byte3 == ptr[-3]))))))) | ||
| 1907 | ch = simple_translate[*ptr]; | 1942 | ch = simple_translate[*ptr]; |
| 1908 | else | 1943 | else |
| 1909 | ch = *ptr; | 1944 | ch = *ptr; |
diff --git a/src/xdisp.c b/src/xdisp.c index bfb6ba5bf4c..ffbbfaaba7f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -462,7 +462,7 @@ static Lisp_Object Vwindow_size_change_functions; | |||
| 462 | 462 | ||
| 463 | Lisp_Object Qmenu_bar_update_hook, Vmenu_bar_update_hook; | 463 | Lisp_Object Qmenu_bar_update_hook, Vmenu_bar_update_hook; |
| 464 | 464 | ||
| 465 | /* Nonzero if overlay arrow has been displayed once in this window. */ | 465 | /* Nonzero if an overlay arrow has been displayed in this window. */ |
| 466 | 466 | ||
| 467 | static int overlay_arrow_seen; | 467 | static int overlay_arrow_seen; |
| 468 | 468 | ||
| @@ -15262,10 +15262,9 @@ display_line (it) | |||
| 15262 | mark this glyph row as the one containing the overlay arrow. | 15262 | mark this glyph row as the one containing the overlay arrow. |
| 15263 | This is clearly a mess with variable size fonts. It would be | 15263 | This is clearly a mess with variable size fonts. It would be |
| 15264 | better to let it be displayed like cursors under X. */ | 15264 | better to let it be displayed like cursors under X. */ |
| 15265 | if (! overlay_arrow_seen | 15265 | if ((overlay_arrow_string |
| 15266 | && (overlay_arrow_string | 15266 | = overlay_arrow_at_row (it, row, &overlay_arrow_bitmap), |
| 15267 | = overlay_arrow_at_row (it, row, &overlay_arrow_bitmap), | 15267 | !NILP (overlay_arrow_string))) |
| 15268 | !NILP (overlay_arrow_string))) | ||
| 15269 | { | 15268 | { |
| 15270 | /* Overlay arrow in window redisplay is a fringe bitmap. */ | 15269 | /* Overlay arrow in window redisplay is a fringe bitmap. */ |
| 15271 | if (STRINGP (overlay_arrow_string)) | 15270 | if (STRINGP (overlay_arrow_string)) |
diff --git a/src/xterm.c b/src/xterm.c index 0c1f7ddab74..ebd0954edb7 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -129,9 +129,7 @@ extern void _XEditResCheckMessages (); | |||
| 129 | #ifdef HAVE_XAW3D | 129 | #ifdef HAVE_XAW3D |
| 130 | #include <X11/Xaw3d/Simple.h> | 130 | #include <X11/Xaw3d/Simple.h> |
| 131 | #include <X11/Xaw3d/Scrollbar.h> | 131 | #include <X11/Xaw3d/Scrollbar.h> |
| 132 | #define ARROW_SCROLLBAR | 132 | #include <X11/Xaw3d/ThreeD.h> |
| 133 | #define XAW_ARROW_SCROLLBARS | ||
| 134 | #include <X11/Xaw3d/ScrollbarP.h> | ||
| 135 | #else /* !HAVE_XAW3D */ | 133 | #else /* !HAVE_XAW3D */ |
| 136 | #include <X11/Xaw/Simple.h> | 134 | #include <X11/Xaw/Simple.h> |
| 137 | #include <X11/Xaw/Scrollbar.h> | 135 | #include <X11/Xaw/Scrollbar.h> |
| @@ -4560,6 +4558,7 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4560 | f->output_data.x->scroll_bar_bottom_shadow_pixel = pixel; | 4558 | f->output_data.x->scroll_bar_bottom_shadow_pixel = pixel; |
| 4561 | } | 4559 | } |
| 4562 | 4560 | ||
| 4561 | #ifdef XtNbeNiceToColormap | ||
| 4563 | /* Tell the toolkit about them. */ | 4562 | /* Tell the toolkit about them. */ |
| 4564 | if (f->output_data.x->scroll_bar_top_shadow_pixel == -1 | 4563 | if (f->output_data.x->scroll_bar_top_shadow_pixel == -1 |
| 4565 | || f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) | 4564 | || f->output_data.x->scroll_bar_bottom_shadow_pixel == -1) |
| @@ -4583,16 +4582,17 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4583 | pixel = f->output_data.x->scroll_bar_top_shadow_pixel; | 4582 | pixel = f->output_data.x->scroll_bar_top_shadow_pixel; |
| 4584 | if (pixel != -1) | 4583 | if (pixel != -1) |
| 4585 | { | 4584 | { |
| 4586 | XtSetArg (av[ac], "topShadowPixel", pixel); | 4585 | XtSetArg (av[ac], XtNtopShadowPixel, pixel); |
| 4587 | ++ac; | 4586 | ++ac; |
| 4588 | } | 4587 | } |
| 4589 | pixel = f->output_data.x->scroll_bar_bottom_shadow_pixel; | 4588 | pixel = f->output_data.x->scroll_bar_bottom_shadow_pixel; |
| 4590 | if (pixel != -1) | 4589 | if (pixel != -1) |
| 4591 | { | 4590 | { |
| 4592 | XtSetArg (av[ac], "bottomShadowPixel", pixel); | 4591 | XtSetArg (av[ac], XtNbottomShadowPixel, pixel); |
| 4593 | ++ac; | 4592 | ++ac; |
| 4594 | } | 4593 | } |
| 4595 | } | 4594 | } |
| 4595 | #endif | ||
| 4596 | 4596 | ||
| 4597 | widget = XtCreateWidget (scroll_bar_name, scrollbarWidgetClass, | 4597 | widget = XtCreateWidget (scroll_bar_name, scrollbarWidgetClass, |
| 4598 | f->output_data.x->edit_widget, av, ac); | 4598 | f->output_data.x->edit_widget, av, ac); |
| @@ -4738,30 +4738,11 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | |||
| 4738 | XawScrollbarSetThumb (widget, top, shown); | 4738 | XawScrollbarSetThumb (widget, top, shown); |
| 4739 | else | 4739 | else |
| 4740 | { | 4740 | { |
| 4741 | #ifdef HAVE_XAW3D | ||
| 4742 | ScrollbarWidget sb = (ScrollbarWidget) widget; | ||
| 4743 | int scroll_mode = 0; | ||
| 4744 | |||
| 4745 | /* `scroll_mode' only exists with Xaw3d + ARROW_SCROLLBAR. */ | ||
| 4746 | if (xaw3d_arrow_scroll) | ||
| 4747 | { | ||
| 4748 | /* Xaw3d stupidly ignores resize requests while dragging | ||
| 4749 | so we have to make it believe it's not in dragging mode. */ | ||
| 4750 | scroll_mode = sb->scrollbar.scroll_mode; | ||
| 4751 | if (scroll_mode == 2) | ||
| 4752 | sb->scrollbar.scroll_mode = 0; | ||
| 4753 | } | ||
| 4754 | #endif | ||
| 4755 | /* Try to make the scrolling a tad smoother. */ | 4741 | /* Try to make the scrolling a tad smoother. */ |
| 4756 | if (!xaw3d_pick_top) | 4742 | if (!xaw3d_pick_top) |
| 4757 | shown = min (shown, old_shown); | 4743 | shown = min (shown, old_shown); |
| 4758 | 4744 | ||
| 4759 | XawScrollbarSetThumb (widget, top, shown); | 4745 | XawScrollbarSetThumb (widget, top, shown); |
| 4760 | |||
| 4761 | #ifdef HAVE_XAW3D | ||
| 4762 | if (xaw3d_arrow_scroll && scroll_mode == 2) | ||
| 4763 | sb->scrollbar.scroll_mode = scroll_mode; | ||
| 4764 | #endif | ||
| 4765 | } | 4746 | } |
| 4766 | } | 4747 | } |
| 4767 | } | 4748 | } |