aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-06-14 20:00:54 +0000
committerKaroly Lorentey2004-06-14 20:00:54 +0000
commit987a34896f0f07c76a87314ee444467903632aeb (patch)
tree5e982f524d8a38b1156fd5c7c93517170a4e6764 /src
parent71a96040ef5a4a8a308a109c45bbabb20769beac (diff)
parent4060d762b6bd7a2e7e6d0c57154beac00496c9d6 (diff)
downloademacs-987a34896f0f07c76a87314ee444467903632aeb.tar.gz
emacs-987a34896f0f07c76a87314ee444467903632aeb.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-398 Tweak permissions * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-399 Tweak directory permissions * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-400 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-401 More build-in-place tweaking of arch tagging * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-402 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-403 Yet more build-in-place tweaking of arch tagging * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-404 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-405 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-406 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-407 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-199
Diffstat (limited to 'src')
-rw-r--r--src/.arch-inventory2
-rw-r--r--src/ChangeLog79
-rw-r--r--src/ccl.c42
-rw-r--r--src/coding.c1
-rw-r--r--src/emacs.c5
-rw-r--r--src/eval.c1
-rw-r--r--src/image.c1
-rw-r--r--src/keyboard.c29
-rw-r--r--src/minibuf.c85
-rw-r--r--src/print.c10
-rw-r--r--src/process.c2
-rw-r--r--src/regex.c37
-rw-r--r--src/regex.h43
-rw-r--r--src/syntax.c155
-rw-r--r--src/syntax.h38
-rw-r--r--src/window.c4
-rw-r--r--src/xfaces.c1
17 files changed, 390 insertions, 145 deletions
diff --git a/src/.arch-inventory b/src/.arch-inventory
index 99b0d6cc539..a98d4c9932f 100644
--- a/src/.arch-inventory
+++ b/src/.arch-inventory
@@ -4,4 +4,6 @@ source ^\.(gdbinit|dbxinit)$
4# Auto-generated files, which ignore 4# Auto-generated files, which ignore
5precious ^(config\.stamp|config\.h|epaths\.h)$ 5precious ^(config\.stamp|config\.h|epaths\.h)$
6 6
7backup ^(stamp-oldxmenu|prefix-args|temacs|emacs|emacs-[0-9.]*)$
8
7# arch-tag: 277cc7ae-b3f5-44af-abf1-84c073164543 9# arch-tag: 277cc7ae-b3f5-44af-abf1-84c073164543
diff --git a/src/ChangeLog b/src/ChangeLog
index 04133ca728c..5104ca9545c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,82 @@
12004-06-13 Richard M. Stallman <rms@gnu.org>
2
3 * regex.h (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t)
4 (re_wctype, re_iswctype, re_wctype_to_bit):
5 Non-function definitions moved here from regex.c.
6
7 * regex.c (re_wctype, re_iswctype): Function defs longer static.
8 (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t)
9 (re_wctype, re_iswctype, re_wctype_to_bit):
10 Non-function definitions moved to regex.h.
11
12 * window.c (Fselect_window): Doc fix.
13
14 * syntax.c: Include regex.h.
15 (skip_chars): New arg HANDLE_ISO_CLASSES. Callers changed.
16 If requested, make a list of classes, then check the scanned
17 chars for membership in them.
18 (in_classes): New function.
19 Doc fix.
20
21 * keyboard.c (cmd_error): Don't call any_kboard_state
22 if inside a recursive edit level.
23
242004-06-13 Lorentey K,Aa(Broly <lorentey@elte.hu>
25
26 * keyboard.c (command_loop): Call any_kboard_state before
27 command_loop_2 when at top level.
28
292004-06-13 Andreas Schwab <schwab@suse.de>
30
31 * print.c (print_object): Always use %ld for printing EMACS_INT.
32
33 * keyboard.c (cancel_hourglass_unwind): Return a value.
34 (modify_event_symbol): Always use %ld for printing EMACS_INT.
35 (Fexecute_extended_command): Likewise.
36
37 * syntax.h (SYNTAX_ENTRY_FOLLOW_PARENT): Rename local variable to
38 avoid clashes.
39 (SYNTAX): Likewise.
40 (SYNTAX_WITH_FLAGS): Likewise.
41 (SYNTAX_MATCH): Likewise.
42
43 * syntax.c (char_quoted): Avoid warning about undefined operation.
44 (find_defun_start): Likewise.
45 (scan_lists): Likewise.
46 (INC_FROM): Likewise.
47 (scan_sexps_forward): Likewise.
48
49 * image.c: Include <ctype.h>.
50
51 * xfaces.c (face_attr_equal_p): Declare parameters.
52
532004-06-13 Kenichi Handa <handa@m17n.org>
54
55 * ccl.c (CCL_READ_CHAR): If hit EOF, set REG to -1.
56
572004-06-12 Matthew Mundell <matt@mundell.ukfsn.org>
58
59 * eval.c (Fdefun): Signal an error if NAME is not a symbol.
60
612004-06-12 Kenichi Handa <handa@m17n.org>
62
63 * ccl.c (CCL_CALL_FOR_MAP_INSTRUCTION): Save eof_ic in
64 ccl_prog_stack_struct and update it.
65 (CCL_INVALID_CMD): If CCL_DEBUG is defined, call ccl_debug_hook.
66 (CCL_READ_CHAR): Get instruction counter from eof_ic, not from
67 ccl->eof_ic on EOF.
68 (ccl_debug_hook): New function.
69 (struct ccl_prog_stack): New member eof_ic.
70 (ccl_driver): Handle EOF in subrountine call correctly.
71
722004-06-11 Kenichi Handa <handa@m17n.org>
73
74 * coding.c (decode_coding_string): Check CODING_FINISH_INTERRUPT.
75
762004-06-11 Kim F. Storm <storm@cua.dk>
77
78 * emacs.c (shut_down_emacs): Inhibit redisplay during shutdown.
79
12004-06-11 Juanma Barranquero <lektu@terra.es> 802004-06-11 Juanma Barranquero <lektu@terra.es>
2 81
3 * keyboard.c (Fposn_at_point): Doc fix. 82 * keyboard.c (Fposn_at_point): Doc fix.
diff --git a/src/ccl.c b/src/ccl.c
index 4c3528075b4..5bff1f3a0ad 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -626,14 +626,17 @@ do \
626 { \ 626 { \
627 ccl_prog = ccl_prog_stack_struct[0].ccl_prog; \ 627 ccl_prog = ccl_prog_stack_struct[0].ccl_prog; \
628 ic = ccl_prog_stack_struct[0].ic; \ 628 ic = ccl_prog_stack_struct[0].ic; \
629 eof_ic = ccl_prog_stack_struct[0].eof_ic; \
629 } \ 630 } \
630 CCL_INVALID_CMD; \ 631 CCL_INVALID_CMD; \
631 } \ 632 } \
632 ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; \ 633 ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; \
633 ccl_prog_stack_struct[stack_idx].ic = (ret_ic); \ 634 ccl_prog_stack_struct[stack_idx].ic = (ret_ic); \
635 ccl_prog_stack_struct[stack_idx].eof_ic = eof_ic; \
634 stack_idx++; \ 636 stack_idx++; \
635 ccl_prog = called_ccl.prog; \ 637 ccl_prog = called_ccl.prog; \
636 ic = CCL_HEADER_MAIN; \ 638 ic = CCL_HEADER_MAIN; \
639 eof_ic = XFASTINT (ccl_prog[CCL_HEADER_EOF]); \
637 goto ccl_repeat; \ 640 goto ccl_repeat; \
638 } \ 641 } \
639while (0) 642while (0)
@@ -710,14 +713,29 @@ while (0)
710 713
711/* Terminate CCL program because of invalid command. Should not occur 714/* Terminate CCL program because of invalid command. Should not occur
712 in the normal case. */ 715 in the normal case. */
716#ifndef CCL_DEBUG
717
718#define CCL_INVALID_CMD \
719do \
720 { \
721 ccl->status = CCL_STAT_INVALID_CMD; \
722 goto ccl_error_handler; \
723 } \
724while(0)
725
726#else
727
713#define CCL_INVALID_CMD \ 728#define CCL_INVALID_CMD \
714do \ 729do \
715 { \ 730 { \
731 ccl_debug_hook (this_ic); \
716 ccl->status = CCL_STAT_INVALID_CMD; \ 732 ccl->status = CCL_STAT_INVALID_CMD; \
717 goto ccl_error_handler; \ 733 goto ccl_error_handler; \
718 } \ 734 } \
719while(0) 735while(0)
720 736
737#endif
738
721/* Encode one character CH to multibyte form and write to the current 739/* Encode one character CH to multibyte form and write to the current
722 output buffer. If CH is less than 256, CH is written as is. */ 740 output buffer. If CH is less than 256, CH is written as is. */
723#define CCL_WRITE_CHAR(ch) \ 741#define CCL_WRITE_CHAR(ch) \
@@ -809,7 +827,8 @@ while(0)
809 } \ 827 } \
810 else if (ccl->last_block) \ 828 else if (ccl->last_block) \
811 { \ 829 { \
812 ic = ccl->eof_ic; \ 830 REG = -1; \
831 ic = eof_ic; \
813 goto ccl_repeat; \ 832 goto ccl_repeat; \
814 } \ 833 } \
815 else \ 834 else \
@@ -854,12 +873,20 @@ while(0)
854#define CCL_DEBUG_BACKTRACE_LEN 256 873#define CCL_DEBUG_BACKTRACE_LEN 256
855int ccl_backtrace_table[CCL_DEBUG_BACKTRACE_LEN]; 874int ccl_backtrace_table[CCL_DEBUG_BACKTRACE_LEN];
856int ccl_backtrace_idx; 875int ccl_backtrace_idx;
876
877int
878ccl_debug_hook (int ic)
879{
880 return ic;
881}
882
857#endif 883#endif
858 884
859struct ccl_prog_stack 885struct ccl_prog_stack
860 { 886 {
861 Lisp_Object *ccl_prog; /* Pointer to an array of CCL code. */ 887 Lisp_Object *ccl_prog; /* Pointer to an array of CCL code. */
862 int ic; /* Instruction Counter. */ 888 int ic; /* Instruction Counter. */
889 int eof_ic; /* Instruction Counter to jump on EOF. */
863 }; 890 };
864 891
865/* For the moment, we only support depth 256 of stack. */ 892/* For the moment, we only support depth 256 of stack. */
@@ -888,8 +915,10 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
888 sequence. For that conversion, we remember how many more bytes 915 sequence. For that conversion, we remember how many more bytes
889 we must keep in DESTINATION in this variable. */ 916 we must keep in DESTINATION in this variable. */
890 int extra_bytes = ccl->eight_bit_control; 917 int extra_bytes = ccl->eight_bit_control;
918 int eof_ic = ccl->eof_ic;
919 int eof_hit = 0;
891 920
892 if (ic >= ccl->eof_ic) 921 if (ic >= eof_ic)
893 ic = CCL_HEADER_MAIN; 922 ic = CCL_HEADER_MAIN;
894 923
895 if (ccl->buf_magnification == 0) /* We can't produce any bytes. */ 924 if (ccl->buf_magnification == 0) /* We can't produce any bytes. */
@@ -1093,15 +1122,18 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
1093 { 1122 {
1094 ccl_prog = ccl_prog_stack_struct[0].ccl_prog; 1123 ccl_prog = ccl_prog_stack_struct[0].ccl_prog;
1095 ic = ccl_prog_stack_struct[0].ic; 1124 ic = ccl_prog_stack_struct[0].ic;
1125 eof_ic = ccl_prog_stack_struct[0].eof_ic;
1096 } 1126 }
1097 CCL_INVALID_CMD; 1127 CCL_INVALID_CMD;
1098 } 1128 }
1099 1129
1100 ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; 1130 ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog;
1101 ccl_prog_stack_struct[stack_idx].ic = ic; 1131 ccl_prog_stack_struct[stack_idx].ic = ic;
1132 ccl_prog_stack_struct[stack_idx].eof_ic = eof_ic;
1102 stack_idx++; 1133 stack_idx++;
1103 ccl_prog = XVECTOR (AREF (slot, 1))->contents; 1134 ccl_prog = XVECTOR (AREF (slot, 1))->contents;
1104 ic = CCL_HEADER_MAIN; 1135 ic = CCL_HEADER_MAIN;
1136 eof_ic = XFASTINT (ccl_prog[CCL_HEADER_EOF]);
1105 } 1137 }
1106 break; 1138 break;
1107 1139
@@ -1131,6 +1163,9 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
1131 stack_idx--; 1163 stack_idx--;
1132 ccl_prog = ccl_prog_stack_struct[stack_idx].ccl_prog; 1164 ccl_prog = ccl_prog_stack_struct[stack_idx].ccl_prog;
1133 ic = ccl_prog_stack_struct[stack_idx].ic; 1165 ic = ccl_prog_stack_struct[stack_idx].ic;
1166 eof_ic = ccl_prog_stack_struct[stack_idx].eof_ic;
1167 if (eof_hit)
1168 ic = eof_ic;
1134 break; 1169 break;
1135 } 1170 }
1136 if (src) 1171 if (src)
@@ -1367,7 +1402,8 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
1367 src--; 1402 src--;
1368 if (ccl->last_block) 1403 if (ccl->last_block)
1369 { 1404 {
1370 ic = ccl->eof_ic; 1405 ic = eof_ic;
1406 eof_hit = 1;
1371 goto ccl_repeat; 1407 goto ccl_repeat;
1372 } 1408 }
1373 else 1409 else
diff --git a/src/coding.c b/src/coding.c
index 328507de499..ed4b131b3a9 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6316,6 +6316,7 @@ encode_coding_string (str, coding, nocopy)
6316 produced += coding->produced; 6316 produced += coding->produced;
6317 produced_char += coding->produced_char; 6317 produced_char += coding->produced_char;
6318 if (result == CODING_FINISH_NORMAL 6318 if (result == CODING_FINISH_NORMAL
6319 || result == CODING_FINISH_INTERRUPT
6319 || (result == CODING_FINISH_INSUFFICIENT_SRC 6320 || (result == CODING_FINISH_INSUFFICIENT_SRC
6320 && coding->consumed == 0)) 6321 && coding->consumed == 0))
6321 break; 6322 break;
diff --git a/src/emacs.c b/src/emacs.c
index 0fbc6f86b5f..5425d5d64a2 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -207,6 +207,8 @@ extern Lisp_Object Vinitial_window_system;
207 207
208extern Lisp_Object Vauto_save_list_file_name; 208extern Lisp_Object Vauto_save_list_file_name;
209 209
210extern Lisp_Object Vinhibit_redisplay;
211
210#ifdef USG_SHARED_LIBRARIES 212#ifdef USG_SHARED_LIBRARIES
211/* If nonzero, this is the place to put the end of the writable segment 213/* If nonzero, this is the place to put the end of the writable segment
212 at startup. */ 214 at startup. */
@@ -2009,6 +2011,9 @@ shut_down_emacs (sig, no_x, stuff)
2009 /* Prevent running of hooks from now on. */ 2011 /* Prevent running of hooks from now on. */
2010 Vrun_hooks = Qnil; 2012 Vrun_hooks = Qnil;
2011 2013
2014 /* Don't update display from now on. */
2015 Vinhibit_redisplay = Qt;
2016
2012 /* If we are controlling the terminal, reset terminal modes. */ 2017 /* If we are controlling the terminal, reset terminal modes. */
2013#ifdef EMACS_HAVE_TTY_PGRP 2018#ifdef EMACS_HAVE_TTY_PGRP
2014 { 2019 {
diff --git a/src/eval.c b/src/eval.c
index e1da1def446..096755f9c77 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -617,6 +617,7 @@ usage: (defun NAME ARGLIST [DOCSTRING] BODY...) */)
617 register Lisp_Object defn; 617 register Lisp_Object defn;
618 618
619 fn_name = Fcar (args); 619 fn_name = Fcar (args);
620 CHECK_SYMBOL (fn_name);
620 defn = Fcons (Qlambda, Fcdr (args)); 621 defn = Fcons (Qlambda, Fcdr (args));
621 if (!NILP (Vpurify_flag)) 622 if (!NILP (Vpurify_flag))
622 defn = Fpurecopy (defn); 623 defn = Fpurecopy (defn);
diff --git a/src/image.c b/src/image.c
index 3c53903b4b4..41762030b9e 100644
--- a/src/image.c
+++ b/src/image.c
@@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */
23#include <signal.h> 23#include <signal.h>
24#include <stdio.h> 24#include <stdio.h>
25#include <math.h> 25#include <math.h>
26#include <ctype.h>
26 27
27#ifdef HAVE_UNISTD_H 28#ifdef HAVE_UNISTD_H
28#include <unistd.h> 29#include <unistd.h>
diff --git a/src/keyboard.c b/src/keyboard.c
index 1c4e9fe0c4a..de2bcf825a0 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1147,7 +1147,8 @@ cmd_error (data)
1147 1147
1148 Vinhibit_quit = Qnil; 1148 Vinhibit_quit = Qnil;
1149#ifdef MULTI_KBOARD 1149#ifdef MULTI_KBOARD
1150 any_kboard_state (); 1150 if (command_loop_level == 0 && minibuf_level == 0)
1151 any_kboard_state ();
1151#endif 1152#endif
1152 1153
1153 return make_number (0); 1154 return make_number (0);
@@ -6261,12 +6262,8 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist_or_stem,
6261 { 6262 {
6262 int len = SBYTES (name_alist_or_stem); 6263 int len = SBYTES (name_alist_or_stem);
6263 char *buf = (char *) alloca (len + 50); 6264 char *buf = (char *) alloca (len + 50);
6264 if (sizeof (int) == sizeof (EMACS_INT)) 6265 sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
6265 sprintf (buf, "%s-%d", SDATA (name_alist_or_stem), 6266 (long) XINT (symbol_int) + 1);
6266 (int)XINT (symbol_int) + 1);
6267 else if (sizeof (long) == sizeof (EMACS_INT))
6268 sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
6269 (long)XINT (symbol_int) + 1);
6270 value = intern (buf); 6267 value = intern (buf);
6271 } 6268 }
6272 else if (name_table != 0 && name_table[symbol_num]) 6269 else if (name_table != 0 && name_table[symbol_num])
@@ -9790,23 +9787,9 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
9790 else if (CONSP (prefixarg) && XINT (XCAR (prefixarg)) == 4) 9787 else if (CONSP (prefixarg) && XINT (XCAR (prefixarg)) == 4)
9791 strcpy (buf, "C-u "); 9788 strcpy (buf, "C-u ");
9792 else if (CONSP (prefixarg) && INTEGERP (XCAR (prefixarg))) 9789 else if (CONSP (prefixarg) && INTEGERP (XCAR (prefixarg)))
9793 { 9790 sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg)));
9794 if (sizeof (int) == sizeof (EMACS_INT))
9795 sprintf (buf, "%d ", XINT (XCAR (prefixarg)));
9796 else if (sizeof (long) == sizeof (EMACS_INT))
9797 sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg)));
9798 else
9799 abort ();
9800 }
9801 else if (INTEGERP (prefixarg)) 9791 else if (INTEGERP (prefixarg))
9802 { 9792 sprintf (buf, "%ld ", (long) XINT (prefixarg));
9803 if (sizeof (int) == sizeof (EMACS_INT))
9804 sprintf (buf, "%d ", XINT (prefixarg));
9805 else if (sizeof (long) == sizeof (EMACS_INT))
9806 sprintf (buf, "%ld ", (long) XINT (prefixarg));
9807 else
9808 abort ();
9809 }
9810 9793
9811 /* This isn't strictly correct if execute-extended-command 9794 /* This isn't strictly correct if execute-extended-command
9812 is bound to anything else. Perhaps it should use 9795 is bound to anything else. Perhaps it should use
diff --git a/src/minibuf.c b/src/minibuf.c
index 6dd55c5ea76..2f05a56d7dd 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1290,20 +1290,21 @@ is used to further constrain the set of candidates. */)
1290 XSETFASTINT (zero, 0); 1290 XSETFASTINT (zero, 0);
1291 1291
1292 /* Ignore this element if it fails to match all the regexps. */ 1292 /* Ignore this element if it fails to match all the regexps. */
1293 { 1293 if (CONSP (Vcompletion_regexp_list))
1294 int count = SPECPDL_INDEX (); 1294 {
1295 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); 1295 int count = SPECPDL_INDEX ();
1296 for (regexps = Vcompletion_regexp_list; CONSP (regexps); 1296 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil);
1297 regexps = XCDR (regexps)) 1297 for (regexps = Vcompletion_regexp_list; CONSP (regexps);
1298 { 1298 regexps = XCDR (regexps))
1299 tem = Fstring_match (XCAR (regexps), eltstring, zero); 1299 {
1300 if (NILP (tem)) 1300 tem = Fstring_match (XCAR (regexps), eltstring, zero);
1301 break; 1301 if (NILP (tem))
1302 } 1302 break;
1303 unbind_to (count, Qnil); 1303 }
1304 if (CONSP (regexps)) 1304 unbind_to (count, Qnil);
1305 continue; 1305 if (CONSP (regexps))
1306 } 1306 continue;
1307 }
1307 1308
1308 /* Ignore this element if there is a predicate 1309 /* Ignore this element if there is a predicate
1309 and the predicate doesn't like it. */ 1310 and the predicate doesn't like it. */
@@ -1541,20 +1542,21 @@ are ignored unless STRING itself starts with a space. */)
1541 XSETFASTINT (zero, 0); 1542 XSETFASTINT (zero, 0);
1542 1543
1543 /* Ignore this element if it fails to match all the regexps. */ 1544 /* Ignore this element if it fails to match all the regexps. */
1544 { 1545 if (CONSP (Vcompletion_regexp_list))
1545 int count = SPECPDL_INDEX (); 1546 {
1546 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); 1547 int count = SPECPDL_INDEX ();
1547 for (regexps = Vcompletion_regexp_list; CONSP (regexps); 1548 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil);
1548 regexps = XCDR (regexps)) 1549 for (regexps = Vcompletion_regexp_list; CONSP (regexps);
1549 { 1550 regexps = XCDR (regexps))
1550 tem = Fstring_match (XCAR (regexps), eltstring, zero); 1551 {
1551 if (NILP (tem)) 1552 tem = Fstring_match (XCAR (regexps), eltstring, zero);
1552 break; 1553 if (NILP (tem))
1553 } 1554 break;
1554 unbind_to (count, Qnil); 1555 }
1555 if (CONSP (regexps)) 1556 unbind_to (count, Qnil);
1556 continue; 1557 if (CONSP (regexps))
1557 } 1558 continue;
1559 }
1558 1560
1559 /* Ignore this element if there is a predicate 1561 /* Ignore this element if there is a predicate
1560 and the predicate doesn't like it. */ 1562 and the predicate doesn't like it. */
@@ -1789,19 +1791,20 @@ the values STRING, PREDICATE and `lambda'. */)
1789 return call3 (alist, string, predicate, Qlambda); 1791 return call3 (alist, string, predicate, Qlambda);
1790 1792
1791 /* Reject this element if it fails to match all the regexps. */ 1793 /* Reject this element if it fails to match all the regexps. */
1792 { 1794 if (CONSP (Vcompletion_regexp_list))
1793 int count = SPECPDL_INDEX (); 1795 {
1794 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); 1796 int count = SPECPDL_INDEX ();
1795 for (regexps = Vcompletion_regexp_list; CONSP (regexps); 1797 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil);
1796 regexps = XCDR (regexps)) 1798 for (regexps = Vcompletion_regexp_list; CONSP (regexps);
1797 { 1799 regexps = XCDR (regexps))
1798 if (NILP (Fstring_match (XCAR (regexps), 1800 {
1799 SYMBOLP (tem) ? string : tem, 1801 if (NILP (Fstring_match (XCAR (regexps),
1800 Qnil))) 1802 SYMBOLP (tem) ? string : tem,
1801 return unbind_to (count, Qnil); 1803 Qnil)))
1802 } 1804 return unbind_to (count, Qnil);
1803 unbind_to (count, Qnil); 1805 }
1804 } 1806 unbind_to (count, Qnil);
1807 }
1805 1808
1806 /* Finally, check the predicate. */ 1809 /* Finally, check the predicate. */
1807 if (!NILP (predicate)) 1810 if (!NILP (predicate))
diff --git a/src/print.c b/src/print.c
index 0e07cd6fdd3..a91276d409a 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1822,7 +1822,7 @@ print_object (obj, printcharfun, escapeflag)
1822 1822
1823 PRINTCHAR ('#'); 1823 PRINTCHAR ('#');
1824 PRINTCHAR ('&'); 1824 PRINTCHAR ('&');
1825 sprintf (buf, "%d", XBOOL_VECTOR (obj)->size); 1825 sprintf (buf, "%ld", (long) XBOOL_VECTOR (obj)->size);
1826 strout (buf, -1, -1, printcharfun, 0); 1826 strout (buf, -1, -1, printcharfun, 0);
1827 PRINTCHAR ('\"'); 1827 PRINTCHAR ('\"');
1828 1828
@@ -1875,7 +1875,7 @@ print_object (obj, printcharfun, escapeflag)
1875 else if (WINDOWP (obj)) 1875 else if (WINDOWP (obj))
1876 { 1876 {
1877 strout ("#<window ", -1, -1, printcharfun, 0); 1877 strout ("#<window ", -1, -1, printcharfun, 0);
1878 sprintf (buf, "%d", XFASTINT (XWINDOW (obj)->sequence_number)); 1878 sprintf (buf, "%ld", (long) XFASTINT (XWINDOW (obj)->sequence_number));
1879 strout (buf, -1, -1, printcharfun, 0); 1879 strout (buf, -1, -1, printcharfun, 0);
1880 if (!NILP (XWINDOW (obj)->buffer)) 1880 if (!NILP (XWINDOW (obj)->buffer))
1881 { 1881 {
@@ -1896,8 +1896,8 @@ print_object (obj, printcharfun, escapeflag)
1896 PRINTCHAR (' '); 1896 PRINTCHAR (' ');
1897 strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun, 0); 1897 strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun, 0);
1898 PRINTCHAR (' '); 1898 PRINTCHAR (' ');
1899 sprintf (buf, "%d/%d", XFASTINT (h->count), 1899 sprintf (buf, "%ld/%ld", (long) XFASTINT (h->count),
1900 XVECTOR (h->next)->size); 1900 (long) XVECTOR (h->next)->size);
1901 strout (buf, -1, -1, printcharfun, 0); 1901 strout (buf, -1, -1, printcharfun, 0);
1902 } 1902 }
1903 sprintf (buf, " 0x%lx", (unsigned long) h); 1903 sprintf (buf, " 0x%lx", (unsigned long) h);
@@ -2020,7 +2020,7 @@ print_object (obj, printcharfun, escapeflag)
2020 break; 2020 break;
2021 2021
2022 case Lisp_Misc_Intfwd: 2022 case Lisp_Misc_Intfwd:
2023 sprintf (buf, "#<intfwd to %d>", *XINTFWD (obj)->intvar); 2023 sprintf (buf, "#<intfwd to %ld>", (long) *XINTFWD (obj)->intvar);
2024 strout (buf, -1, -1, printcharfun, 0); 2024 strout (buf, -1, -1, printcharfun, 0);
2025 break; 2025 break;
2026 2026
diff --git a/src/process.c b/src/process.c
index d2789e0e42e..71f38afc776 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3619,6 +3619,8 @@ FLAGS is the current flags of the interface. */)
3619#endif 3619#endif
3620#endif /* HAVE_SOCKETS */ 3620#endif /* HAVE_SOCKETS */
3621 3621
3622/* Turn off input and output for process PROC. */
3623
3622void 3624void
3623deactivate_process (proc) 3625deactivate_process (proc)
3624 Lisp_Object proc; 3626 Lisp_Object proc;
diff --git a/src/regex.c b/src/regex.c
index db69275c312..31a10ee92e0 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -1961,41 +1961,10 @@ struct range_table_work_area
1961 } \ 1961 } \
1962 } while (0) 1962 } while (0)
1963 1963
1964#if WIDE_CHAR_SUPPORT 1964#if ! WIDE_CHAR_SUPPORT
1965/* The GNU C library provides support for user-defined character classes
1966 and the functions from ISO C amendement 1. */
1967# ifdef CHARCLASS_NAME_MAX
1968# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
1969# else
1970/* This shouldn't happen but some implementation might still have this
1971 problem. Use a reasonable default value. */
1972# define CHAR_CLASS_MAX_LENGTH 256
1973# endif
1974typedef wctype_t re_wctype_t;
1975typedef wchar_t re_wchar_t;
1976# define re_wctype wctype
1977# define re_iswctype iswctype
1978# define re_wctype_to_bit(cc) 0
1979#else
1980# define CHAR_CLASS_MAX_LENGTH 9 /* Namely, `multibyte'. */
1981# define btowc(c) c
1982
1983/* Character classes. */
1984typedef enum { RECC_ERROR = 0,
1985 RECC_ALNUM, RECC_ALPHA, RECC_WORD,
1986 RECC_GRAPH, RECC_PRINT,
1987 RECC_LOWER, RECC_UPPER,
1988 RECC_PUNCT, RECC_CNTRL,
1989 RECC_DIGIT, RECC_XDIGIT,
1990 RECC_BLANK, RECC_SPACE,
1991 RECC_MULTIBYTE, RECC_NONASCII,
1992 RECC_ASCII, RECC_UNIBYTE
1993} re_wctype_t;
1994
1995typedef int re_wchar_t;
1996 1965
1997/* Map a string to the char class it names (if any). */ 1966/* Map a string to the char class it names (if any). */
1998static re_wctype_t 1967re_wctype_t
1999re_wctype (str) 1968re_wctype (str)
2000 re_char *str; 1969 re_char *str;
2001{ 1970{
@@ -2021,7 +1990,7 @@ re_wctype (str)
2021} 1990}
2022 1991
2023/* True iff CH is in the char class CC. */ 1992/* True iff CH is in the char class CC. */
2024static boolean 1993boolean
2025re_iswctype (ch, cc) 1994re_iswctype (ch, cc)
2026 int ch; 1995 int ch;
2027 re_wctype_t cc; 1996 re_wctype_t cc;
diff --git a/src/regex.h b/src/regex.h
index 1818d5f9681..f969c9c5e74 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -562,6 +562,49 @@ extern void regfree _RE_ARGS ((regex_t *__preg));
562} 562}
563#endif /* C++ */ 563#endif /* C++ */
564 564
565/* For platform which support the ISO C amendement 1 functionality we
566 support user defined character classes. */
567#if WIDE_CHAR_SUPPORT
568/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
569# include <wchar.h>
570# include <wctype.h>
571#endif
572
573#if WIDE_CHAR_SUPPORT
574/* The GNU C library provides support for user-defined character classes
575 and the functions from ISO C amendement 1. */
576# ifdef CHARCLASS_NAME_MAX
577# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
578# else
579/* This shouldn't happen but some implementation might still have this
580 problem. Use a reasonable default value. */
581# define CHAR_CLASS_MAX_LENGTH 256
582# endif
583typedef wctype_t re_wctype_t;
584typedef wchar_t re_wchar_t;
585# define re_wctype wctype
586# define re_iswctype iswctype
587# define re_wctype_to_bit(cc) 0
588#else
589# define CHAR_CLASS_MAX_LENGTH 9 /* Namely, `multibyte'. */
590# define btowc(c) c
591
592/* Character classes. */
593typedef enum { RECC_ERROR = 0,
594 RECC_ALNUM, RECC_ALPHA, RECC_WORD,
595 RECC_GRAPH, RECC_PRINT,
596 RECC_LOWER, RECC_UPPER,
597 RECC_PUNCT, RECC_CNTRL,
598 RECC_DIGIT, RECC_XDIGIT,
599 RECC_BLANK, RECC_SPACE,
600 RECC_MULTIBYTE, RECC_NONASCII,
601 RECC_ASCII, RECC_UNIBYTE
602} re_wctype_t;
603
604typedef int re_wchar_t;
605
606#endif /* not WIDE_CHAR_SUPPORT */
607
565#endif /* regex.h */ 608#endif /* regex.h */
566 609
567/* 610/*
diff --git a/src/syntax.c b/src/syntax.c
index 4b26d04cd30..62612620f03 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA. */
26#include "buffer.h" 26#include "buffer.h"
27#include "charset.h" 27#include "charset.h"
28#include "keymap.h" 28#include "keymap.h"
29#include "regex.h"
29 30
30/* Make syntax table lookup grant data in gl_state. */ 31/* Make syntax table lookup grant data in gl_state. */
31#define SYNTAX_ENTRY_VIA_PROPERTY 32#define SYNTAX_ENTRY_VIA_PROPERTY
@@ -97,11 +98,12 @@ static int find_start_modiff;
97static int find_defun_start P_ ((int, int)); 98static int find_defun_start P_ ((int, int));
98static int back_comment P_ ((int, int, int, int, int, int *, int *)); 99static int back_comment P_ ((int, int, int, int, int, int *, int *));
99static int char_quoted P_ ((int, int)); 100static int char_quoted P_ ((int, int));
100static Lisp_Object skip_chars P_ ((int, int, Lisp_Object, Lisp_Object)); 101static Lisp_Object skip_chars P_ ((int, int, Lisp_Object, Lisp_Object, int));
101static Lisp_Object scan_lists P_ ((int, int, int, int)); 102static Lisp_Object scan_lists P_ ((int, int, int, int));
102static void scan_sexps_forward P_ ((struct lisp_parse_state *, 103static void scan_sexps_forward P_ ((struct lisp_parse_state *,
103 int, int, int, int, 104 int, int, int, int,
104 int, Lisp_Object, int)); 105 int, Lisp_Object, int));
106static int in_classes P_ ((int, Lisp_Object));
105 107
106 108
107struct gl_state_s gl_state; /* Global state of syntax parser. */ 109struct gl_state_s gl_state; /* Global state of syntax parser. */
@@ -292,8 +294,11 @@ char_quoted (charpos, bytepos)
292 294
293 while (bytepos >= beg) 295 while (bytepos >= beg)
294 { 296 {
297 int c;
298
295 UPDATE_SYNTAX_TABLE_BACKWARD (charpos); 299 UPDATE_SYNTAX_TABLE_BACKWARD (charpos);
296 code = SYNTAX (FETCH_CHAR (bytepos)); 300 c = FETCH_CHAR (bytepos);
301 code = SYNTAX (c);
297 if (! (code == Scharquote || code == Sescape)) 302 if (! (code == Scharquote || code == Sescape))
298 break; 303 break;
299 304
@@ -380,12 +385,16 @@ find_defun_start (pos, pos_byte)
380 gl_state.use_global = 0; 385 gl_state.use_global = 0;
381 while (PT > BEGV) 386 while (PT > BEGV)
382 { 387 {
388 int c;
389
383 /* Open-paren at start of line means we may have found our 390 /* Open-paren at start of line means we may have found our
384 defun-start. */ 391 defun-start. */
385 if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen) 392 c = FETCH_CHAR (PT_BYTE);
393 if (SYNTAX (c) == Sopen)
386 { 394 {
387 SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */ 395 SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */
388 if (SYNTAX (FETCH_CHAR (PT_BYTE)) == Sopen) 396 c = FETCH_CHAR (PT_BYTE);
397 if (SYNTAX (c) == Sopen)
389 break; 398 break;
390 /* Now fallback to the default value. */ 399 /* Now fallback to the default value. */
391 gl_state.current_syntax_table = current_buffer->syntax_table; 400 gl_state.current_syntax_table = current_buffer->syntax_table;
@@ -1314,13 +1323,13 @@ except that `]' is never special and `\\' quotes `^', `-' or `\\'
1314 (but not as the end of a range; quoting is never needed there). 1323 (but not as the end of a range; quoting is never needed there).
1315Thus, with arg "a-zA-Z", this skips letters stopping before first nonletter. 1324Thus, with arg "a-zA-Z", this skips letters stopping before first nonletter.
1316With arg "^a-zA-Z", skips nonletters stopping before first letter. 1325With arg "^a-zA-Z", skips nonletters stopping before first letter.
1317Returns the distance traveled, either zero or positive. 1326Char classes, e.g. `[:alpha:]', are supported.
1318Note that char classes, e.g. `[:alpha:]', are not currently supported; 1327
1319they will be treated as literals. */) 1328Returns the distance traveled, either zero or positive. */)
1320 (string, lim) 1329 (string, lim)
1321 Lisp_Object string, lim; 1330 Lisp_Object string, lim;
1322{ 1331{
1323 return skip_chars (1, 0, string, lim); 1332 return skip_chars (1, 0, string, lim, 1);
1324} 1333}
1325 1334
1326DEFUN ("skip-chars-backward", Fskip_chars_backward, Sskip_chars_backward, 1, 2, 0, 1335DEFUN ("skip-chars-backward", Fskip_chars_backward, Sskip_chars_backward, 1, 2, 0,
@@ -1330,7 +1339,7 @@ Returns the distance traveled, either zero or negative. */)
1330 (string, lim) 1339 (string, lim)
1331 Lisp_Object string, lim; 1340 Lisp_Object string, lim;
1332{ 1341{
1333 return skip_chars (0, 0, string, lim); 1342 return skip_chars (0, 0, string, lim, 1);
1334} 1343}
1335 1344
1336DEFUN ("skip-syntax-forward", Fskip_syntax_forward, Sskip_syntax_forward, 1, 2, 0, 1345DEFUN ("skip-syntax-forward", Fskip_syntax_forward, Sskip_syntax_forward, 1, 2, 0,
@@ -1342,7 +1351,7 @@ This function returns the distance traveled, either zero or positive. */)
1342 (syntax, lim) 1351 (syntax, lim)
1343 Lisp_Object syntax, lim; 1352 Lisp_Object syntax, lim;
1344{ 1353{
1345 return skip_chars (1, 1, syntax, lim); 1354 return skip_chars (1, 1, syntax, lim, 0);
1346} 1355}
1347 1356
1348DEFUN ("skip-syntax-backward", Fskip_syntax_backward, Sskip_syntax_backward, 1, 2, 0, 1357DEFUN ("skip-syntax-backward", Fskip_syntax_backward, Sskip_syntax_backward, 1, 2, 0,
@@ -1354,13 +1363,14 @@ This function returns the distance traveled, either zero or negative. */)
1354 (syntax, lim) 1363 (syntax, lim)
1355 Lisp_Object syntax, lim; 1364 Lisp_Object syntax, lim;
1356{ 1365{
1357 return skip_chars (0, 1, syntax, lim); 1366 return skip_chars (0, 1, syntax, lim, 0);
1358} 1367}
1359 1368
1360static Lisp_Object 1369static Lisp_Object
1361skip_chars (forwardp, syntaxp, string, lim) 1370skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
1362 int forwardp, syntaxp; 1371 int forwardp, syntaxp;
1363 Lisp_Object string, lim; 1372 Lisp_Object string, lim;
1373 int handle_iso_classes;
1364{ 1374{
1365 register unsigned int c; 1375 register unsigned int c;
1366 unsigned char fastmap[0400]; 1376 unsigned char fastmap[0400];
@@ -1376,12 +1386,14 @@ skip_chars (forwardp, syntaxp, string, lim)
1376 int size_byte; 1386 int size_byte;
1377 const unsigned char *str; 1387 const unsigned char *str;
1378 int len; 1388 int len;
1389 Lisp_Object iso_classes;
1379 1390
1380 CHECK_STRING (string); 1391 CHECK_STRING (string);
1381 char_ranges = (int *) alloca (SCHARS (string) * (sizeof (int)) * 2); 1392 char_ranges = (int *) alloca (SCHARS (string) * (sizeof (int)) * 2);
1382 string_multibyte = STRING_MULTIBYTE (string); 1393 string_multibyte = STRING_MULTIBYTE (string);
1383 str = SDATA (string); 1394 str = SDATA (string);
1384 size_byte = SBYTES (string); 1395 size_byte = SBYTES (string);
1396 iso_classes = Qnil;
1385 1397
1386 /* Adjust the multibyteness of the string to that of the buffer. */ 1398 /* Adjust the multibyteness of the string to that of the buffer. */
1387 if (multibyte != string_multibyte) 1399 if (multibyte != string_multibyte)
@@ -1437,6 +1449,45 @@ skip_chars (forwardp, syntaxp, string, lim)
1437 fastmap[syntax_spec_code[c & 0377]] = 1; 1449 fastmap[syntax_spec_code[c & 0377]] = 1;
1438 else 1450 else
1439 { 1451 {
1452 if (handle_iso_classes && c == '['
1453 && i_byte < size_byte
1454 && STRING_CHAR (str + i_byte, size_byte - i_byte) == ':')
1455 {
1456 const unsigned char *class_beg = str + i_byte + 1;
1457 const unsigned char *class_end = class_beg;
1458 const unsigned char *class_limit = str + size_byte;
1459 /* Leave room for the null. */
1460 unsigned char class_name[CHAR_CLASS_MAX_LENGTH + 1];
1461 re_wctype_t cc;
1462
1463 if (class_limit - class_beg > CHAR_CLASS_MAX_LENGTH)
1464 class_limit = class_beg + CHAR_CLASS_MAX_LENGTH;
1465
1466 while (class_end != class_limit
1467 && ! (*class_end >= 0200
1468 || *class_end <= 040
1469 || (*class_end == ':'
1470 && class_end[1] == ']')))
1471 class_end++;
1472
1473 if (class_end == class_limit
1474 || *class_end >= 0200
1475 || *class_end <= 040)
1476 error ("Invalid ISO C character class");
1477
1478 bcopy (class_beg, class_name, class_end - class_beg);
1479 class_name[class_end - class_beg] = 0;
1480
1481 cc = re_wctype (class_name);
1482 if (cc == 0)
1483 error ("Invalid ISO C character class");
1484
1485 iso_classes = Fcons (make_number (cc), iso_classes);
1486
1487 i_byte = class_end + 2 - str;
1488 continue;
1489 }
1490
1440 if (c == '\\') 1491 if (c == '\\')
1441 { 1492 {
1442 if (i_byte == size_byte) 1493 if (i_byte == size_byte)
@@ -1630,6 +1681,15 @@ skip_chars (forwardp, syntaxp, string, lim)
1630 stop = endp; 1681 stop = endp;
1631 } 1682 }
1632 c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes); 1683 c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes);
1684
1685 if (! NILP (iso_classes) && in_classes (c, iso_classes))
1686 {
1687 if (negate)
1688 break;
1689 else
1690 goto fwd_ok;
1691 }
1692
1633 if (SINGLE_BYTE_CHAR_P (c)) 1693 if (SINGLE_BYTE_CHAR_P (c))
1634 { 1694 {
1635 if (!fastmap[c]) 1695 if (!fastmap[c])
@@ -1652,6 +1712,7 @@ skip_chars (forwardp, syntaxp, string, lim)
1652 if (!(negate ^ (i < n_char_ranges))) 1712 if (!(negate ^ (i < n_char_ranges)))
1653 break; 1713 break;
1654 } 1714 }
1715 fwd_ok:
1655 p += nbytes, pos++, pos_byte += nbytes; 1716 p += nbytes, pos++, pos_byte += nbytes;
1656 } 1717 }
1657 else 1718 else
@@ -1664,8 +1725,19 @@ skip_chars (forwardp, syntaxp, string, lim)
1664 p = GAP_END_ADDR; 1725 p = GAP_END_ADDR;
1665 stop = endp; 1726 stop = endp;
1666 } 1727 }
1728
1729 if (!NILP (iso_classes) && in_classes (*p, iso_classes))
1730 {
1731 if (negate)
1732 break;
1733 else
1734 goto fwd_ok;
1735 }
1736
1667 if (!fastmap[*p]) 1737 if (!fastmap[*p])
1668 break; 1738 break;
1739
1740 fwd_unibyte_ok:
1669 p++, pos++; 1741 p++, pos++;
1670 } 1742 }
1671 } 1743 }
@@ -1691,6 +1763,15 @@ skip_chars (forwardp, syntaxp, string, lim)
1691 p = prev_p - 1, c = *p, nbytes = 1; 1763 p = prev_p - 1, c = *p, nbytes = 1;
1692 else 1764 else
1693 c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH); 1765 c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH);
1766
1767 if (! NILP (iso_classes) && in_classes (c, iso_classes))
1768 {
1769 if (negate)
1770 break;
1771 else
1772 goto back_ok;
1773 }
1774
1694 if (SINGLE_BYTE_CHAR_P (c)) 1775 if (SINGLE_BYTE_CHAR_P (c))
1695 { 1776 {
1696 if (!fastmap[c]) 1777 if (!fastmap[c])
@@ -1705,6 +1786,7 @@ skip_chars (forwardp, syntaxp, string, lim)
1705 if (!(negate ^ (i < n_char_ranges))) 1786 if (!(negate ^ (i < n_char_ranges)))
1706 break; 1787 break;
1707 } 1788 }
1789 back_ok:
1708 pos--, pos_byte -= nbytes; 1790 pos--, pos_byte -= nbytes;
1709 } 1791 }
1710 else 1792 else
@@ -1717,8 +1799,19 @@ skip_chars (forwardp, syntaxp, string, lim)
1717 p = GPT_ADDR; 1799 p = GPT_ADDR;
1718 stop = endp; 1800 stop = endp;
1719 } 1801 }
1802
1803 if (! NILP (iso_classes) && in_classes (p[-1], iso_classes))
1804 {
1805 if (negate)
1806 break;
1807 else
1808 goto fwd_ok;
1809 }
1810
1720 if (!fastmap[p[-1]]) 1811 if (!fastmap[p[-1]])
1721 break; 1812 break;
1813
1814 back_unibyte_ok:
1722 p--, pos--; 1815 p--, pos--;
1723 } 1816 }
1724 } 1817 }
@@ -1741,6 +1834,30 @@ skip_chars (forwardp, syntaxp, string, lim)
1741 return make_number (PT - start_point); 1834 return make_number (PT - start_point);
1742 } 1835 }
1743} 1836}
1837
1838/* Return 1 if character C belongs to one of the ISO classes
1839 in the list ISO_CLASSES. Each class is represented by an
1840 integer which is its type according to re_wctype. */
1841
1842static int
1843in_classes (c, iso_classes)
1844 int c;
1845 Lisp_Object iso_classes;
1846{
1847 int fits_class = 0;
1848
1849 while (! NILP (iso_classes))
1850 {
1851 Lisp_Object elt;
1852 elt = XCAR (iso_classes);
1853 iso_classes = XCDR (iso_classes);
1854
1855 if (re_iswctype (c, XFASTINT (elt)))
1856 fits_class = 1;
1857 }
1858
1859 return fits_class;
1860}
1744 1861
1745/* Jump over a comment, assuming we are at the beginning of one. 1862/* Jump over a comment, assuming we are at the beginning of one.
1746 FROM is the current position. 1863 FROM is the current position.
@@ -2124,7 +2241,7 @@ scan_lists (from, count, depth, sexpflag)
2124 INC_BOTH (from, from_byte); 2241 INC_BOTH (from, from_byte);
2125 UPDATE_SYNTAX_TABLE_FORWARD (from); 2242 UPDATE_SYNTAX_TABLE_FORWARD (from);
2126 if (from < stop && comstart_first 2243 if (from < stop && comstart_first
2127 && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from_byte)) 2244 && (c = FETCH_CHAR (from_byte), SYNTAX_COMSTART_SECOND (c))
2128 && parse_sexp_ignore_comments) 2245 && parse_sexp_ignore_comments)
2129 { 2246 {
2130 /* we have encountered a comment start sequence and we 2247 /* we have encountered a comment start sequence and we
@@ -2449,7 +2566,7 @@ scan_lists (from, count, depth, sexpflag)
2449 Fcons (build_string ("Unbalanced parentheses"), 2566 Fcons (build_string ("Unbalanced parentheses"),
2450 Fcons (make_number (last_good), 2567 Fcons (make_number (last_good),
2451 Fcons (make_number (from), Qnil)))); 2568 Fcons (make_number (from), Qnil))));
2452 2569 abort ();
2453 /* NOTREACHED */ 2570 /* NOTREACHED */
2454} 2571}
2455 2572
@@ -2588,8 +2705,8 @@ scan_sexps_forward (stateptr, from, from_byte, end, targetdepth,
2588#define INC_FROM \ 2705#define INC_FROM \
2589do { prev_from = from; \ 2706do { prev_from = from; \
2590 prev_from_byte = from_byte; \ 2707 prev_from_byte = from_byte; \
2591 prev_from_syntax \ 2708 temp = FETCH_CHAR (prev_from_byte); \
2592 = SYNTAX_WITH_FLAGS (FETCH_CHAR (prev_from_byte)); \ 2709 prev_from_syntax = SYNTAX_WITH_FLAGS (temp); \
2593 INC_BOTH (from, from_byte); \ 2710 INC_BOTH (from, from_byte); \
2594 if (from < end) \ 2711 if (from < end) \
2595 UPDATE_SYNTAX_TABLE_FORWARD (from); \ 2712 UPDATE_SYNTAX_TABLE_FORWARD (from); \
@@ -2664,7 +2781,8 @@ do { prev_from = from; \
2664 curlevel->last = -1; 2781 curlevel->last = -1;
2665 2782
2666 SETUP_SYNTAX_TABLE (prev_from, 1); 2783 SETUP_SYNTAX_TABLE (prev_from, 1);
2667 prev_from_syntax = SYNTAX_WITH_FLAGS (FETCH_CHAR (prev_from_byte)); 2784 temp = FETCH_CHAR (prev_from_byte);
2785 prev_from_syntax = SYNTAX_WITH_FLAGS (temp);
2668 UPDATE_SYNTAX_TABLE_FORWARD (from); 2786 UPDATE_SYNTAX_TABLE_FORWARD (from);
2669 2787
2670 /* Enter the loop at a place appropriate for initial state. */ 2788 /* Enter the loop at a place appropriate for initial state. */
@@ -2743,7 +2861,8 @@ do { prev_from = from; \
2743 while (from < end) 2861 while (from < end)
2744 { 2862 {
2745 /* Some compilers can't handle this inside the switch. */ 2863 /* Some compilers can't handle this inside the switch. */
2746 temp = SYNTAX (FETCH_CHAR (from_byte)); 2864 temp = FETCH_CHAR (from_byte);
2865 temp = SYNTAX (temp);
2747 switch (temp) 2866 switch (temp)
2748 { 2867 {
2749 case Scharquote: 2868 case Scharquote:
diff --git a/src/syntax.h b/src/syntax.h
index f86ab8fc265..cb1eeb62687 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -68,16 +68,16 @@ enum syntaxcode
68 68
69#ifdef __GNUC__ 69#ifdef __GNUC__
70#define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \ 70#define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \
71 ({ Lisp_Object tbl = table; \ 71 ({ Lisp_Object _syntax_tbl = (table); \
72 Lisp_Object temp = XCHAR_TABLE (tbl)->contents[(c)]; \ 72 Lisp_Object _syntax_temp = XCHAR_TABLE (_syntax_tbl)->contents[(c)]; \
73 while (NILP (temp)) \ 73 while (NILP (_syntax_temp)) \
74 { \ 74 { \
75 tbl = XCHAR_TABLE (tbl)->parent; \ 75 _syntax_tbl = XCHAR_TABLE (_syntax_tbl)->parent; \
76 if (NILP (tbl)) \ 76 if (NILP (_syntax_tbl)) \
77 break; \ 77 break; \
78 temp = XCHAR_TABLE (tbl)->contents[(c)]; \ 78 _syntax_temp = XCHAR_TABLE (_syntax_tbl)->contents[(c)]; \
79 } \ 79 } \
80 temp; }) 80 _syntax_temp; })
81#else 81#else
82extern Lisp_Object syntax_temp; 82extern Lisp_Object syntax_temp;
83extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int)); 83extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
@@ -117,24 +117,24 @@ extern Lisp_Object syntax_parent_lookup P_ ((Lisp_Object, int));
117 117
118#ifdef __GNUC__ 118#ifdef __GNUC__
119#define SYNTAX(c) \ 119#define SYNTAX(c) \
120 ({ Lisp_Object temp; \ 120 ({ Lisp_Object _syntax_temp; \
121 temp = SYNTAX_ENTRY (c); \ 121 _syntax_temp = SYNTAX_ENTRY (c); \
122 (CONSP (temp) \ 122 (CONSP (_syntax_temp) \
123 ? (enum syntaxcode) (XINT (XCAR (temp)) & 0xff) \ 123 ? (enum syntaxcode) (XINT (XCAR (_syntax_temp)) & 0xff) \
124 : Swhitespace); }) 124 : Swhitespace); })
125 125
126#define SYNTAX_WITH_FLAGS(c) \ 126#define SYNTAX_WITH_FLAGS(c) \
127 ({ Lisp_Object temp; \ 127 ({ Lisp_Object _syntax_temp; \
128 temp = SYNTAX_ENTRY (c); \ 128 _syntax_temp = SYNTAX_ENTRY (c); \
129 (CONSP (temp) \ 129 (CONSP (_syntax_temp) \
130 ? XINT (XCAR (temp)) \ 130 ? XINT (XCAR (_syntax_temp)) \
131 : (int) Swhitespace); }) 131 : (int) Swhitespace); })
132 132
133#define SYNTAX_MATCH(c) \ 133#define SYNTAX_MATCH(c) \
134 ({ Lisp_Object temp; \ 134 ({ Lisp_Object _syntax_temp; \
135 temp = SYNTAX_ENTRY (c); \ 135 _syntax_temp = SYNTAX_ENTRY (c); \
136 (CONSP (temp) \ 136 (CONSP (_syntax_temp) \
137 ? XCDR (temp) \ 137 ? XCDR (_syntax_temp) \
138 : Qnil); }) 138 : Qnil); })
139#else 139#else
140#define SYNTAX(c) \ 140#define SYNTAX(c) \
diff --git a/src/window.c b/src/window.c
index 03ca22dd525..ff0d810a9c8 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3064,8 +3064,8 @@ defaults. */)
3064 3064
3065DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, 3065DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
3066 doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. 3066 doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer.
3067If WINDOW is not already selected, also make WINDOW's buffer current. 3067If WINDOW is not already selected, make WINDOW's buffer current
3068Also make WINDOW the frame's selected window. 3068and make WINDOW the frame's selected window.
3069Optional second arg NORECORD non-nil means 3069Optional second arg NORECORD non-nil means
3070do not put this buffer at the front of the list of recently selected ones. 3070do not put this buffer at the front of the list of recently selected ones.
3071 3071
diff --git a/src/xfaces.c b/src/xfaces.c
index 505e601c57d..171472dbb31 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -4915,6 +4915,7 @@ If FRAME is omitted or nil, use the selected frame. */)
4915 4915
4916static INLINE int 4916static INLINE int
4917face_attr_equal_p (v1, v2) 4917face_attr_equal_p (v1, v2)
4918 Lisp_Object v1, v2;
4918{ 4919{
4919 /* Type can differ, e.g. when one attribute is unspecified, i.e. nil, 4920 /* Type can differ, e.g. when one attribute is unspecified, i.e. nil,
4920 and the other is specified. */ 4921 and the other is specified. */