summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2005-04-04 16:43:15 +0000
committerKaroly Lorentey <lorentey@elte.hu>2005-04-04 16:43:15 +0000
commitee00ea6e18c2aeae86e262fae703f67f4705032a (patch)
tree9e7fc6bfb33de2b2f861589a2f7674ad35de85a8 /src
parent4a932511428a2b61ec51deebd6e16ec1efbda800 (diff)
parent8c6ef2ca34c444c1dea1f11b999b4b2ec16cdea3 (diff)
Merged from miles@gnu.org--gnu-2005 (patch 45-55, 214-231)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-214 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-215 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-216 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-217 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-218 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-219 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-220 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-221 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-222 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-223 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-224 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-225 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-226 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-227 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-228 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-229 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-230 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-231 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-45 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-46 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-47 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-48 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-49 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-50 Update from CVS: texi Makefile.in CVS keyw cruft * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-51 Update from CVS: ChangeLog tweaks * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-52 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-53 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-54 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-55 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-324
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog77
-rw-r--r--src/alloc.c8
-rw-r--r--src/casetab.c7
-rw-r--r--src/coding.c2
-rw-r--r--src/editfns.c9
-rw-r--r--src/eval.c7
-rw-r--r--src/fileio.c179
-rw-r--r--src/keyboard.c14
-rw-r--r--src/lisp.h3
-rw-r--r--src/ralloc.c5
-rw-r--r--src/search.c219
-rw-r--r--src/xdisp.c9
-rw-r--r--src/xterm.c29
13 files changed, 342 insertions, 226 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4ea174bdc60..34bf8b41b45 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,81 @@
+2005-04-04 Kim F. Storm <storm@cua.dk>
+
+ * alloc.c (Fgarbage_collect): Call CHECK_CONS_LIST before and after gc.
+
+ * eval.c (Ffuncall): Always call CHECK_CONS_LIST on entry.
+ Call it again after autoload.
+
+2005-04-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * alloc.c (allocate_string_data): Call BLOCK_INPUT before calling
+ mallopt.
+
+ * ralloc.c (r_alloc_init): Ditto.
+
+2005-04-01 Kenichi Handa <handa@m17n.org>
+
+ * lisp.h (Vascii_upcase_table, Vascii_canon_table,
+ Vascii_eqv_table): Extern them.
+
+ * casetab.c (set_case_table): If standard is nonzero, setup
+ Vascii_upcase_table, Vascii_canon_table, and Vascii_eqv_table.
+
+ * search.c (looking_at_1): Use current_buffer->case_canon_table,
+ not DOWNCASE_TABLE.
+ (string_match_1): Likewise.
+ (fast_c_string_match_ignore_case): Use Vascii_canon_table, not
+ Vascii_downcase_table.
+ (fast_string_match_ignore_case): Likewise.
+ (search_buffer): Fix checking of boyer-moore usability.
+ (boyer_moore): Calculate translate_prev_byte1/2/3 in advance. No
+ need of tranlating characters in PAT. Fix calculation of
+ simple_translate.
+
+2005-03-31 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xterm.c [HAVE_XAW3D]: Include ThreeD.h for XtNbeNiceToColormap.
+ (x_create_toolkit_scroll_bar): Test XtNbeNiceToColormap before using it.
+ Use XtNtopShadowPixel and XtNbottomShadowPixel.
+ (x_set_toolkit_scroll_bar_thumb): Remove ugly old hack that didn't
+ really work and that breaks with some versions of Xaw3d.
+
+2005-03-31 Kenichi Handa <handa@m17n.org>
+
+ * coding.c (syms_of_coding): Fix previous change.
+
+2005-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fileio.c (search_embedded_absfilename): Fix last change.
+
+2005-03-25 Kenichi Handa <handa@m17n.org>
+
+ * coding.c (syms_of_coding): Suggest to use set-coding-category in
+ the docstring of coding-category-list.
+
+2005-03-31 Kim F. Storm <storm@cua.dk>
+
+ * keyboard.c (Qmouse_fixup_help_message): New var.
+ (syms_of_keyboard): Intern and staticpro it.
+ (show_help_echo): Apply mouse-fixup-help-message to help string.
+
+2005-03-30 Kim F. Storm <storm@cua.dk>
+
+ * xdisp.c (display_line): Allow multiple overlay arrows in window.
+
+2005-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fileio.c (Fexpand_file_name): Use IS_DEVICE_SEP.
+ (file_name_absolute_p): New fun, extracted from Ffile_name_absolute_p.
+ (Ffile_name_absolute_p): Use it.
+ (search_embedded_absfilename): New fun, extracted from
+ Fsubstitute_in_file_name. Use file_name_absolute_p.
+ Free the pw data after use.
+ (Fsubstitute_in_file_name): Use it.
+ After cutting a prefix, re-check file-name-handler.
+
2005-03-26 Lennart Borgman <lennart.borgman.073@student.lu.se>
- * w32term.h (x_output): add focus_state.
+ * w32term.h (x_output): Add focus_state.
* w32term.c (x_focus_changed, w32_detect_focus_change): New functions.
(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)
mmap'ed data typically have an address towards the top of the
address space, which won't fit into an EMACS_INT (at least on
32-bit systems with the current tagging scheme). --fx */
+ BLOCK_INPUT;
mallopt (M_MMAP_MAX, 0);
+ UNBLOCK_INPUT;
#endif
b = (struct sblock *) lisp_malloc (size + GC_STRING_EXTRA, MEM_TYPE_NON_LISP);
#ifdef DOUG_LEA_MALLOC
/* Back to a reasonable maximum of mmap'ed areas. */
+ BLOCK_INPUT;
mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
+ UNBLOCK_INPUT;
#endif
b->next_free = &b->first_data;
@@ -4684,6 +4688,8 @@ returns nil, because real GC can't be done. */)
if (pure_bytes_used_before_overflow)
return Qnil;
+ CHECK_CONS_LIST ();
+
/* Don't keep undo information around forever.
Do this early on, so it is no problem if the user quits. */
{
@@ -4878,6 +4884,8 @@ returns nil, because real GC can't be done. */)
UNBLOCK_INPUT;
+ CHECK_CONS_LIST ();
+
/* clear_marks (); */
gc_in_progress = 0;
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)
XCHAR_TABLE (canon)->extras[2] = eqv;
if (standard)
- Vascii_downcase_table = table;
+ {
+ Vascii_downcase_table = table;
+ Vascii_upcase_table = up;
+ Vascii_canon_table = canon;
+ Vascii_eqv_table = eqv;
+ }
else
{
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
one algorithm agrees with a byte sequence of source text, the coding
system bound to the corresponding coding-category is selected.
-Don't modify this variable directly, but use `set-coding-category'. */);
+Don't modify this variable directly, but use `set-coding-priority'. */);
{
int i;
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 @@
/* Lisp functions pertaining to editing.
- Copyright (C) 1985,86,87,89,93,94,95,96,97,98,1999,2000,01,02,03,2004
- Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1987, 1989, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -265,10 +265,7 @@ clip_to_bounds (lower, num, upper)
DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ",
doc: /* Set point to POSITION, a number or marker.
-Beginning of buffer is position (point-min), end is (point-max).
-If the position is in the middle of a multibyte form,
-the actual point is set at the head of the multibyte form
-except in the case that `enable-multibyte-characters' is nil. */)
+Beginning of buffer is position (point-min), end is (point-max). */)
(position)
register Lisp_Object position;
{
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) */)
if (debug_on_next_call)
do_debug_on_call (Qlambda);
+ CHECK_CONS_LIST ();
+
retry:
fun = args[0];
@@ -2750,9 +2752,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
if (SUBRP (fun))
{
- CHECK_CONS_LIST ();
-
- if (numargs < XSUBR (fun)->min_args
+ if (numargs < XSUBR (fun)->min_args
|| (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < numargs))
{
XSETFASTINT (lisp_numargs, numargs);
@@ -2844,6 +2844,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
else if (EQ (funcar, Qautoload))
{
do_autoload (fun, args[0]);
+ CHECK_CONS_LIST ();
goto retry;
}
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:
DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0,
doc: /* Convert filename NAME to absolute, and canonicalize it.
Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative
- (does not start with slash); if DEFAULT-DIRECTORY is nil or missing,
+\(does not start with slash); if DEFAULT-DIRECTORY is nil or missing,
the current buffer's value of default-directory is used.
File name components that are `.' are removed, and
so are file name components followed by `..', along with the `..' itself;
@@ -1466,7 +1466,7 @@ See also the function `substitute-in-file-name'. */)
indirectly by prepending newdir to nm if necessary, and using
cwd (or the wd of newdir's drive) as the new newdir. */
- if (IS_DRIVE (newdir[0]) && newdir[1] == ':')
+ if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1]))
{
drive = newdir[0];
newdir += 2;
@@ -1489,7 +1489,7 @@ See also the function `substitute-in-file-name'. */)
}
/* Strip off drive name from prefix, if present. */
- if (IS_DRIVE (newdir[0]) && newdir[1] == ':')
+ if (IS_DRIVE (newdir[0]) && IS_DEVICE_SEP (newdir[1]))
{
drive = newdir[0];
newdir += 2;
@@ -1723,7 +1723,7 @@ See also the function `substitute-in-file-name'. */)
DEAFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0,
"Convert FILENAME to absolute, and canonicalize it.\n\
Second arg DEFAULT is directory to start with if FILENAME is relative\n\
- (does not start with slash); if DEFAULT is nil or missing,\n\
+\(does not start with slash); if DEFAULT is nil or missing,\n\
the current buffer's value of default-directory is used.\n\
Filenames containing `.' or `..' as components are simplified;\n\
initial `~/' expands to your home directory.\n\
@@ -2042,6 +2042,75 @@ See also the function `substitute-in-file-name'.")
}
#endif
+/* If /~ or // appears, discard everything through first slash. */
+static int
+file_name_absolute_p (filename)
+ const unsigned char *filename;
+{
+ return
+ (IS_DIRECTORY_SEP (*filename) || *filename == '~'
+#ifdef VMS
+ /* ??? This criterion is probably wrong for '<'. */
+ || index (filename, ':') || index (filename, '<')
+ || (*filename == '[' && (filename[1] != '-'
+ || (filename[2] != '.' && filename[2] != ']'))
+ && filename[1] != '.')
+#endif /* VMS */
+#ifdef DOS_NT
+ || (IS_DRIVE (*filename) && IS_DEVICE_SEP (filename[1])
+ && IS_DIRECTORY_SEP (filename[2]))
+#endif
+ );
+}
+
+static unsigned char *
+search_embedded_absfilename (nm, endp)
+ unsigned char *nm, *endp;
+{
+ unsigned char *p, *s;
+
+ for (p = nm + 1; p < endp; p++)
+ {
+ if ((0
+#ifdef VMS
+ || p[-1] == ':' || p[-1] == ']' || p[-1] == '>'
+#endif /* VMS */
+ || IS_DIRECTORY_SEP (p[-1]))
+ && file_name_absolute_p (p)
+#if defined (APOLLO) || defined (WINDOWSNT) || defined(CYGWIN)
+ /* // at start of file name is meaningful in Apollo,
+ WindowsNT and Cygwin systems. */
+ && !(IS_DIRECTORY_SEP (p[0]) && p - 1 == nm)
+#endif /* not (APOLLO || WINDOWSNT || CYGWIN) */
+ )
+ {
+ for (s = p; *s && (!IS_DIRECTORY_SEP (*s)
+#ifdef VMS
+ && *s != ':'
+#endif /* VMS */
+ ); s++);
+ if (p[0] == '~' && s > p + 1) /* we've got "/~something/" */
+ {
+ unsigned char *o = alloca (s - p + 1);
+ struct passwd *pw;
+ bcopy (p, o, s - p);
+ o [s - p] = 0;
+
+ /* If we have ~user and `user' exists, discard
+ everything up to ~. But if `user' does not exist, leave
+ ~user alone, it might be a literal file name. */
+ if ((pw = getpwnam (o + 1)))
+ return p;
+ else
+ xfree (pw);
+ }
+ else
+ return p;
+ }
+ }
+ return NULL;
+}
+
DEFUN ("substitute-in-file-name", Fsubstitute_in_file_name,
Ssubstitute_in_file_name, 1, 1, 0,
doc: /* Substitute environment variables referred to in FILENAME.
@@ -2063,7 +2132,6 @@ duplicates what `expand-file-name' does. */)
int total = 0;
int substituted = 0;
unsigned char *xnm;
- struct passwd *pw;
Lisp_Object handler;
CHECK_STRING (filename);
@@ -2083,61 +2151,17 @@ duplicates what `expand-file-name' does. */)
endp = nm + SBYTES (filename);
/* If /~ or // appears, discard everything through first slash. */
-
- for (p = nm; p != endp; p++)
- {
- if ((p[0] == '~'
-#if defined (APOLLO) || defined (WINDOWSNT) || defined(CYGWIN)
- /* // at start of file name is meaningful in Apollo,
- WindowsNT and Cygwin systems. */
- || (IS_DIRECTORY_SEP (p[0]) && p - 1 != nm)
-#else /* not (APOLLO || WINDOWSNT || CYGWIN) */
- || IS_DIRECTORY_SEP (p[0])
-#endif /* not (APOLLO || WINDOWSNT || CYGWIN) */
- )
- && p != nm
- && (0
-#ifdef VMS
- || p[-1] == ':' || p[-1] == ']' || p[-1] == '>'
-#endif /* VMS */
- || IS_DIRECTORY_SEP (p[-1])))
- {
- for (s = p; *s && (!IS_DIRECTORY_SEP (*s)
-#ifdef VMS
- && *s != ':'
-#endif /* VMS */
- ); s++);
- if (p[0] == '~' && s > p + 1) /* we've got "/~something/" */
- {
- o = (unsigned char *) alloca (s - p + 1);
- bcopy ((char *) p, o, s - p);
- o [s - p] = 0;
-
- pw = (struct passwd *) getpwnam (o + 1);
- }
- /* If we have ~/ or ~user and `user' exists, discard
- everything up to ~. But if `user' does not exist, leave
- ~user alone, it might be a literal file name. */
- if (IS_DIRECTORY_SEP (p[0]) || s == p + 1 || pw)
- {
- nm = p;
- substituted = 1;
- }
- }
-#ifdef DOS_NT
- /* see comment in expand-file-name about drive specifiers */
- else if (IS_DRIVE (p[0]) && p[1] == ':'
- && p > nm && IS_DIRECTORY_SEP (p[-1]))
- {
- nm = p;
- substituted = 1;
- }
-#endif /* DOS_NT */
- }
+ p = search_embedded_absfilename (nm, endp);
+ if (p)
+ /* Start over with the new string, so we check the file-name-handler
+ again. Important with filenames like "/home/foo//:/hello///there"
+ which whould substitute to "/:/hello///there" rather than "/there". */
+ return Fsubstitute_in_file_name
+ (make_specified_string (p, -1, endp - p,
+ STRING_MULTIBYTE (filename)));
#ifdef VMS
- return make_specified_string (nm, -1, strlen (nm),
- STRING_MULTIBYTE (filename));
+ return filename;
#else
/* See if any variables are substituted into the string
@@ -2263,22 +2287,11 @@ duplicates what `expand-file-name' does. */)
*x = 0;
/* If /~ or // appears, discard everything through first slash. */
-
- for (p = xnm; p != x; p++)
- if ((p[0] == '~'
-#if defined (APOLLO) || defined (WINDOWSNT) || defined(CYGWIN)
- || (IS_DIRECTORY_SEP (p[0]) && p - 1 != xnm)
-#else /* not (APOLLO || WINDOWSNT || CYGWIN) */
- || IS_DIRECTORY_SEP (p[0])
-#endif /* not (APOLLO || WINDOWSNT || CYGWIN) */
- )
- && p != xnm && IS_DIRECTORY_SEP (p[-1]))
- xnm = p;
-#ifdef DOS_NT
- else if (IS_DRIVE (p[0]) && p[1] == ':'
- && p > xnm && IS_DIRECTORY_SEP (p[-1]))
- xnm = p;
-#endif
+ while ((p = search_embedded_absfilename (xnm, x)))
+ /* This time we do not start over because we've already expanded envvars
+ and replaced $$ with $. Maybe we should start over as well, but we'd
+ need to quote some $ to $$ first. */
+ xnm = p;
return make_specified_string (xnm, -1, x - xnm, STRING_MULTIBYTE (filename));
@@ -2961,24 +2974,8 @@ On Unix, this is a name starting with a `/' or a `~'. */)
(filename)
Lisp_Object filename;
{
- const unsigned char *ptr;
-
CHECK_STRING (filename);
- ptr = SDATA (filename);
- if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~'
-#ifdef VMS
-/* ??? This criterion is probably wrong for '<'. */
- || index (ptr, ':') || index (ptr, '<')
- || (*ptr == '[' && (ptr[1] != '-' || (ptr[2] != '.' && ptr[2] != ']'))
- && ptr[1] != '.')
-#endif /* VMS */
-#ifdef DOS_NT
- || (IS_DRIVE (*ptr) && ptr[1] == ':' && IS_DIRECTORY_SEP (ptr[2]))
-#endif
- )
- return Qt;
- else
- return Qnil;
+ return file_name_absolute_p (SDATA (filename)) ? Qt : Qnil;
}
/* 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;
Lisp_Object Qselect_window;
Lisp_Object Qhelp_echo;
+#ifdef HAVE_MOUSE
+Lisp_Object Qmouse_fixup_help_message;
+#endif
+
/* Symbols to denote kinds of events. */
Lisp_Object Qfunction_key;
Lisp_Object Qmouse_click;
@@ -2298,6 +2302,11 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo)
return;
}
+#ifdef HAVE_MOUSE
+ if (!noninteractive && STRINGP (help))
+ help = call1 (Qmouse_fixup_help_message, help);
+#endif
+
if (STRINGP (help) || NILP (help))
{
if (!NILP (Vshow_help_function))
@@ -11010,6 +11019,11 @@ syms_of_keyboard ()
Qmenu_bar = intern ("menu-bar");
staticpro (&Qmenu_bar);
+#ifdef HAVE_MOUSE
+ Qmouse_fixup_help_message = intern ("mouse-fixup-help-message");
+ staticpro (&Qmouse_fixup_help_message);
+#endif
+
Qabove_handle = intern ("above-handle");
staticpro (&Qabove_handle);
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;
NATNUMP (case_temp2)) \
? XFASTINT (case_temp2) : case_temp1)
-extern Lisp_Object Vascii_downcase_table;
+extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
+extern Lisp_Object Vascii_canon_table, Vascii_eqv_table;
/* Number of bytes of structure consed since last GC. */
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. */
#include <config.h>
#include "lisp.h" /* Needed for VALBITS. */
+#include "blockinput.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -1255,7 +1256,9 @@ r_alloc_init ()
#endif
#ifdef DOUG_LEA_MALLOC
- mallopt (M_TOP_PAD, 64 * 4096);
+ BLOCK_INPUT;
+ mallopt (M_TOP_PAD, 64 * 4096);
+ UNBLOCK_INPUT;
#else
#ifndef SYSTEM_MALLOC
/* 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)
CHECK_STRING (string);
bufp = compile_pattern (string, &search_regs,
(!NILP (current_buffer->case_fold_search)
- ? DOWNCASE_TABLE : Qnil),
+ ? current_buffer->case_canon_table : Qnil),
posix,
!NILP (current_buffer->enable_multibyte_characters));
@@ -399,7 +399,7 @@ string_match_1 (regexp, string, start, posix)
bufp = compile_pattern (regexp, &search_regs,
(!NILP (current_buffer->case_fold_search)
- ? DOWNCASE_TABLE : Qnil),
+ ? current_buffer->case_canon_table : Qnil),
posix,
STRING_MULTIBYTE (string));
immediate_quit = 1;
@@ -499,7 +499,7 @@ fast_c_string_match_ignore_case (regexp, string)
regexp = string_make_unibyte (regexp);
re_match_object = Qt;
bufp = compile_pattern (regexp, 0,
- Vascii_downcase_table, 0,
+ Vascii_canon_table, 0,
0);
immediate_quit = 1;
val = re_search (bufp, string, len, 0, len, 0);
@@ -516,7 +516,7 @@ fast_string_match_ignore_case (regexp, string)
int val;
struct re_pattern_buffer *bufp;
- bufp = compile_pattern (regexp, 0, Vascii_downcase_table,
+ bufp = compile_pattern (regexp, 0, Vascii_canon_table,
0, STRING_MULTIBYTE (string));
immediate_quit = 1;
re_match_object = string;
@@ -1175,7 +1175,9 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
unsigned char *patbuf;
int multibyte = !NILP (current_buffer->enable_multibyte_characters);
unsigned char *base_pat = SDATA (string);
- int charset_base = -1;
+ /* Set to nozero if we find a non-ASCII char that need
+ translation. */
+ int charset_base = 0;
int boyer_moore_ok = 1;
/* MULTIBYTE says whether the text to be searched is multibyte.
@@ -1221,9 +1223,17 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
base_pat = raw_pattern;
if (multibyte)
{
+ /* Fill patbuf by translated characters in STRING while
+ checking if we can use boyer-moore search. If TRT is
+ non-nil, we can use boyer-moore search only if TRT can be
+ represented by the byte array of 256 elements. For that,
+ all non-ASCII case-equivalents of all case-senstive
+ characters in STRING must belong to the same charset and
+ row. */
+
while (--len >= 0)
{
- unsigned char str[MAX_MULTIBYTE_LENGTH];
+ unsigned char str_base[MAX_MULTIBYTE_LENGTH], *str;
int c, translated, inverse;
int in_charlen, charlen;
@@ -1233,50 +1243,62 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
if (RE && *base_pat == '\\')
{
len--;
+ raw_pattern_size--;
len_byte--;
base_pat++;
}
c = STRING_CHAR_AND_LENGTH (base_pat, len_byte, in_charlen);
- /* Translate the character, if requested. */
- TRANSLATE (translated, trt, c);
- /* If translation changed the byte-length, go back
- to the original character. */
- charlen = CHAR_STRING (translated, str);
- if (in_charlen != charlen)
+ if (NILP (trt))
{
- translated = c;
- charlen = CHAR_STRING (c, str);
+ str = base_pat;
+ charlen = in_charlen;
}
-
- /* If we are searching for something strange,
- an invalid multibyte code, don't use boyer-moore. */
- if (! ASCII_BYTE_P (translated)
- && (charlen == 1 /* 8bit code */
- || charlen != in_charlen /* invalid multibyte code */
- ))
- boyer_moore_ok = 0;
-
- TRANSLATE (inverse, inverse_trt, c);
-
- /* Did this char actually get translated?
- Would any other char get translated into it? */
- if (translated != c || inverse != c)
+ else
{
- /* Keep track of which character set row
- contains the characters that need translation. */
- int charset_base_code = c & ~CHAR_FIELD3_MASK;
- int inverse_charset_base = inverse & ~CHAR_FIELD3_MASK;
+ /* Translate the character. */
+ TRANSLATE (translated, trt, c);
+ charlen = CHAR_STRING (translated, str_base);
+ str = str_base;
- if (charset_base_code != inverse_charset_base)
- boyer_moore_ok = 0;
- else if (charset_base == -1)
- charset_base = charset_base_code;
- else if (charset_base != charset_base_code)
- /* If two different rows appear, needing translation,
- then we cannot use boyer_moore search. */
- boyer_moore_ok = 0;
+ /* Check if C has any other case-equivalents. */
+ TRANSLATE (inverse, inverse_trt, c);
+ /* If so, check if we can use boyer-moore. */
+ if (c != inverse && boyer_moore_ok)
+ {
+ /* Check if all equivalents belong to the same
+ charset & row. Note that the check of C
+ itself is done by the last iteration. Note
+ also that we don't have to check ASCII
+ characters because boyer-moore search can
+ always handle their translation. */
+ while (1)
+ {
+ if (! ASCII_BYTE_P (inverse))
+ {
+ if (SINGLE_BYTE_CHAR_P (inverse))
+ {
+ /* Boyer-moore search can't handle a
+ translation of an eight-bit
+ character. */
+ boyer_moore_ok = 0;
+ break;
+ }
+ else if (charset_base == 0)
+ charset_base = inverse & ~CHAR_FIELD3_MASK;
+ else if ((inverse & ~CHAR_FIELD3_MASK)
+ != charset_base)
+ {
+ boyer_moore_ok = 0;
+ break;
+ }
+ }
+ if (c == inverse)
+ break;
+ TRANSLATE (inverse, inverse_trt, inverse);
+ }
+ }
}
/* Store this character into the translated pattern. */
@@ -1300,6 +1322,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
if (RE && *base_pat == '\\')
{
len--;
+ raw_pattern_size--;
base_pat++;
}
c = *base_pat++;
@@ -1533,16 +1556,18 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
return n;
}
-/* Do Boyer-Moore search N times for the string PAT,
+/* Do Boyer-Moore search N times for the string BASE_PAT,
whose length is LEN/LEN_BYTE,
from buffer position POS/POS_BYTE until LIM/LIM_BYTE.
DIRECTION says which direction we search in.
TRT and INVERSE_TRT are translation tables.
+ Characters in PAT are already translated by TRT.
- This kind of search works if all the characters in PAT that have
- nontrivial translation are the same aside from the last byte. This
- makes it possible to translate just the last byte of a character,
- and do so after just a simple test of the context.
+ This kind of search works if all the characters in BASE_PAT that
+ have nontrivial translation are the same aside from the last byte.
+ This makes it possible to translate just the last byte of a
+ character, and do so after just a simple test of the context.
+ CHARSET_BASE is nonzero iff there is such a non-ASCII character.
If that criterion is not satisfied, do not call this function. */
@@ -1569,8 +1594,13 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
int multibyte = ! NILP (current_buffer->enable_multibyte_characters);
unsigned char simple_translate[0400];
- int translate_prev_byte = 0;
- int translate_anteprev_byte = 0;
+ /* These are set to the preceding bytes of a byte to be translated
+ if charset_base is nonzero. As the maximum byte length of a
+ multibyte character is 4, we have to check at most three previous
+ bytes. */
+ int translate_prev_byte1 = 0;
+ int translate_prev_byte2 = 0;
+ int translate_prev_byte3 = 0;
#ifdef C_ALLOCA
int BM_tab_space[0400];
@@ -1636,6 +1666,23 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
for (i = 0; i < 0400; i++)
simple_translate[i] = i;
+ if (charset_base)
+ {
+ /* Setup translate_prev_byte1/2/3 from CHARSET_BASE. Only a
+ byte following them are the target of translation. */
+ int sample_char = charset_base | 0x20;
+ unsigned char str[MAX_MULTIBYTE_LENGTH];
+ int len = CHAR_STRING (sample_char, str);
+
+ translate_prev_byte1 = str[len - 2];
+ if (len > 2)
+ {
+ translate_prev_byte2 = str[len - 3];
+ if (len > 3)
+ translate_prev_byte3 = str[len - 4];
+ }
+ }
+
i = 0;
while (i != infinity)
{
@@ -1645,57 +1692,37 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
i = infinity;
if (! NILP (trt))
{
- int ch;
- int untranslated;
- int this_translated = 1;
+ /* If the byte currently looking at is a head of a character
+ to check case-equivalents, set CH to that character. An
+ ASCII character and a non-ASCII character matching with
+ CHARSET_BASE are to be checked. */
+ int ch = -1;
- if (multibyte
- /* Is *PTR the last byte of a character? */
- && (pat_end - ptr == 1 || CHAR_HEAD_P (ptr[1])))
+ if (ASCII_BYTE_P (*ptr) || ! multibyte)
+ ch = *ptr;
+ else if (charset_base && CHAR_HEAD_P (*ptr))
{
- unsigned char *charstart = ptr;
- while (! CHAR_HEAD_P (*charstart))
- charstart--;
- untranslated = STRING_CHAR (charstart, ptr - charstart + 1);
- if (charset_base == (untranslated & ~CHAR_FIELD3_MASK))
- {
- TRANSLATE (ch, trt, untranslated);
- if (! CHAR_HEAD_P (*ptr))
- {
- translate_prev_byte = ptr[-1];
- if (! CHAR_HEAD_P (translate_prev_byte))
- translate_anteprev_byte = ptr[-2];
- }
- }
- else
- {
- this_translated = 0;
- ch = *ptr;
- }
+ ch = STRING_CHAR (ptr, pat_end - ptr);
+ if (charset_base != (ch & ~CHAR_FIELD3_MASK))
+ ch = -1;
}
- else if (!multibyte)
- TRANSLATE (ch, trt, *ptr);
- else
- {
- ch = *ptr;
- this_translated = 0;
- }
-
- if (ch > 0400)
- j = ((unsigned char) ch) | 0200;
- else
- j = (unsigned char) ch;
+ j = *ptr;
if (i == infinity)
stride_for_teases = BM_tab[j];
BM_tab[j] = dirlen - i;
/* A translation table is accompanied by its inverse -- see */
/* comment following downcase_table for details */
- if (this_translated)
+ if (ch >= 0)
{
int starting_ch = ch;
- int starting_j = j;
+ int starting_j;
+
+ if (ch > 0400)
+ starting_j = ((unsigned char) ch) | 0200;
+ else
+ starting_j = (unsigned char) ch;
while (1)
{
TRANSLATE (ch, inverse_trt, ch);
@@ -1821,9 +1848,13 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
|| ((cursor == tail_end_ptr
|| CHAR_HEAD_P (cursor[1]))
&& (CHAR_HEAD_P (cursor[0])
- || (translate_prev_byte == cursor[-1]
- && (CHAR_HEAD_P (translate_prev_byte)
- || translate_anteprev_byte == cursor[-2])))))
+ /* Check if this is the last byte of
+ a translable character. */
+ || (translate_prev_byte1 == cursor[-1]
+ && (CHAR_HEAD_P (translate_prev_byte1)
+ || (translate_prev_byte2 == cursor[-2]
+ && (CHAR_HEAD_P (translate_prev_byte2)
+ || (translate_prev_byte3 == cursor[-3]))))))))
ch = simple_translate[*cursor];
else
ch = *cursor;
@@ -1901,9 +1932,13 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
|| ((ptr == tail_end_ptr
|| CHAR_HEAD_P (ptr[1]))
&& (CHAR_HEAD_P (ptr[0])
- || (translate_prev_byte == ptr[-1]
- && (CHAR_HEAD_P (translate_prev_byte)
- || translate_anteprev_byte == ptr[-2])))))
+ /* Check if this is the last byte of a
+ translable character. */
+ || (translate_prev_byte1 == ptr[-1]
+ && (CHAR_HEAD_P (translate_prev_byte1)
+ || (translate_prev_byte2 == ptr[-2]
+ && (CHAR_HEAD_P (translate_prev_byte2)
+ || translate_prev_byte3 == ptr[-3])))))))
ch = simple_translate[*ptr];
else
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;
Lisp_Object Qmenu_bar_update_hook, Vmenu_bar_update_hook;
-/* Nonzero if overlay arrow has been displayed once in this window. */
+/* Nonzero if an overlay arrow has been displayed in this window. */
static int overlay_arrow_seen;
@@ -15262,10 +15262,9 @@ display_line (it)
mark this glyph row as the one containing the overlay arrow.
This is clearly a mess with variable size fonts. It would be
better to let it be displayed like cursors under X. */
- if (! overlay_arrow_seen
- && (overlay_arrow_string
- = overlay_arrow_at_row (it, row, &overlay_arrow_bitmap),
- !NILP (overlay_arrow_string)))
+ if ((overlay_arrow_string
+ = overlay_arrow_at_row (it, row, &overlay_arrow_bitmap),
+ !NILP (overlay_arrow_string)))
{
/* Overlay arrow in window redisplay is a fringe bitmap. */
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 ();
#ifdef HAVE_XAW3D
#include <X11/Xaw3d/Simple.h>
#include <X11/Xaw3d/Scrollbar.h>
-#define ARROW_SCROLLBAR
-#define XAW_ARROW_SCROLLBARS
-#include <X11/Xaw3d/ScrollbarP.h>
+#include <X11/Xaw3d/ThreeD.h>
#else /* !HAVE_XAW3D */
#include <X11/Xaw/Simple.h>
#include <X11/Xaw/Scrollbar.h>
@@ -4560,6 +4558,7 @@ x_create_toolkit_scroll_bar (f, bar)
f->output_data.x->scroll_bar_bottom_shadow_pixel = pixel;
}
+#ifdef XtNbeNiceToColormap
/* Tell the toolkit about them. */
if (f->output_data.x->scroll_bar_top_shadow_pixel == -1
|| f->output_data.x->scroll_bar_bottom_shadow_pixel == -1)
@@ -4583,16 +4582,17 @@ x_create_toolkit_scroll_bar (f, bar)
pixel = f->output_data.x->scroll_bar_top_shadow_pixel;
if (pixel != -1)
{
- XtSetArg (av[ac], "topShadowPixel", pixel);
+ XtSetArg (av[ac], XtNtopShadowPixel, pixel);
++ac;
}
pixel = f->output_data.x->scroll_bar_bottom_shadow_pixel;
if (pixel != -1)
{
- XtSetArg (av[ac], "bottomShadowPixel", pixel);
+ XtSetArg (av[ac], XtNbottomShadowPixel, pixel);
++ac;
}
}
+#endif
widget = XtCreateWidget (scroll_bar_name, scrollbarWidgetClass,
f->output_data.x->edit_widget, av, ac);
@@ -4738,30 +4738,11 @@ x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
XawScrollbarSetThumb (widget, top, shown);
else
{
-#ifdef HAVE_XAW3D
- ScrollbarWidget sb = (ScrollbarWidget) widget;
- int scroll_mode = 0;
-
- /* `scroll_mode' only exists with Xaw3d + ARROW_SCROLLBAR. */
- if (xaw3d_arrow_scroll)
- {
- /* Xaw3d stupidly ignores resize requests while dragging
- so we have to make it believe it's not in dragging mode. */
- scroll_mode = sb->scrollbar.scroll_mode;
- if (scroll_mode == 2)
- sb->scrollbar.scroll_mode = 0;
- }
-#endif
/* Try to make the scrolling a tad smoother. */
if (!xaw3d_pick_top)
shown = min (shown, old_shown);
XawScrollbarSetThumb (widget, top, shown);
-
-#ifdef HAVE_XAW3D
- if (xaw3d_arrow_scroll && scroll_mode == 2)
- sb->scrollbar.scroll_mode = scroll_mode;
-#endif
}
}
}