aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2010-03-08 10:53:37 +0900
committerKenichi Handa2010-03-08 10:53:37 +0900
commit59513a2f81060efb01a8a6d684901718c3b4d236 (patch)
tree5433967c8574959bf737f94ea33ed5edf5c8a177 /src
parentb799f2211562060966feabf1975a11b3985264a9 (diff)
parentb327c9751037d3d8abc7485c6a78ec96f4da1c1e (diff)
downloademacs-59513a2f81060efb01a8a6d684901718c3b4d236.tar.gz
emacs-59513a2f81060efb01a8a6d684901718c3b4d236.zip
from trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog18
-rw-r--r--src/bytecode.c1
-rw-r--r--src/keymap.c36
-rw-r--r--src/lisp.h23
-rw-r--r--src/regex.c7
-rw-r--r--src/syntax.c8
6 files changed, 57 insertions, 36 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 761beb2be54..ce4fe1cd7b4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
12010-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 Make it possible to C-g in a tight bytecode loop again (bug#5680).
4 * lisp.h (ELSE_PENDING_SIGNALS): New macro.
5 (QUIT): Use it to consolidate code and remove redundancy.
6 * bytecode.c (BYTE_CODE_QUIT): Use it as well.
7
8 * regex.c (regex_compile): Setup gl_state as well.
9
10 * syntax.c (skip_chars): Setup gl_state (bug#3823).
11 (in_classes): Use CONSP before XCAR/XCDR.
12
132010-03-03 Chong Yidong <cyd@stupidchicken.com>
14
15 * keymap.c (Fwhere_is_internal): Use Fequal to compare
16 definitions, so that keyboard macros are correctly handled
17 (Bug#5481).
18
12010-03-02 Eli Zaretskii <eliz@gnu.org> 192010-03-02 Eli Zaretskii <eliz@gnu.org>
2 20
3 * coding.c (decode_coding_emacs_mule): Fixup pointers to buffer 21 * coding.c (decode_coding_emacs_mule): Fixup pointers to buffer
diff --git a/src/bytecode.c b/src/bytecode.c
index 31df65fd303..e95614c72a9 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -393,6 +393,7 @@ unmark_byte_stack ()
393 Fsignal (Qquit, Qnil); \ 393 Fsignal (Qquit, Qnil); \
394 AFTER_POTENTIAL_GC (); \ 394 AFTER_POTENTIAL_GC (); \
395 } \ 395 } \
396 ELSE_PENDING_SIGNALS \
396 } while (0) 397 } while (0)
397 398
398 399
diff --git a/src/keymap.c b/src/keymap.c
index 98774d5d685..88e0687272f 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1633,13 +1633,13 @@ like in the respective argument of `key-binding'. */)
1633 /* If a mouse click position is given, our variables are based on 1633 /* If a mouse click position is given, our variables are based on
1634 the buffer clicked on, not the current buffer. So we may have to 1634 the buffer clicked on, not the current buffer. So we may have to
1635 switch the buffer here. */ 1635 switch the buffer here. */
1636 1636
1637 if (CONSP (position)) 1637 if (CONSP (position))
1638 { 1638 {
1639 Lisp_Object window; 1639 Lisp_Object window;
1640 1640
1641 window = POSN_WINDOW (position); 1641 window = POSN_WINDOW (position);
1642 1642
1643 if (WINDOWP (window) 1643 if (WINDOWP (window)
1644 && BUFFERP (XWINDOW (window)->buffer) 1644 && BUFFERP (XWINDOW (window)->buffer)
1645 && XBUFFER (XWINDOW (window)->buffer) != current_buffer) 1645 && XBUFFER (XWINDOW (window)->buffer) != current_buffer)
@@ -1651,14 +1651,14 @@ like in the respective argument of `key-binding'. */)
1651 would not be a problem here, but it is easier to keep 1651 would not be a problem here, but it is easier to keep
1652 things the same. 1652 things the same.
1653 */ 1653 */
1654 1654
1655 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); 1655 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
1656 1656
1657 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); 1657 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
1658 } 1658 }
1659 } 1659 }
1660 1660
1661 keymaps = Fcons (current_global_map, Qnil); 1661 keymaps = Fcons (current_global_map, Qnil);
1662 1662
1663 if (!NILP (olp)) 1663 if (!NILP (olp))
1664 { 1664 {
@@ -1685,8 +1685,8 @@ like in the respective argument of `key-binding'. */)
1685 /* Get the buffer local maps, possibly overriden by text or 1685 /* Get the buffer local maps, possibly overriden by text or
1686 overlay properties */ 1686 overlay properties */
1687 1687
1688 local_map = get_local_map (pt, current_buffer, Qlocal_map); 1688 local_map = get_local_map (pt, current_buffer, Qlocal_map);
1689 keymap = get_local_map (pt, current_buffer, Qkeymap); 1689 keymap = get_local_map (pt, current_buffer, Qkeymap);
1690 1690
1691 if (CONSP (position)) 1691 if (CONSP (position))
1692 { 1692 {
@@ -1694,7 +1694,7 @@ like in the respective argument of `key-binding'. */)
1694 1694
1695 /* For a mouse click, get the local text-property keymap 1695 /* For a mouse click, get the local text-property keymap
1696 of the place clicked on, rather than point. */ 1696 of the place clicked on, rather than point. */
1697 1697
1698 if (POSN_INBUFFER_P (position)) 1698 if (POSN_INBUFFER_P (position))
1699 { 1699 {
1700 Lisp_Object pos; 1700 Lisp_Object pos;
@@ -1705,7 +1705,7 @@ like in the respective argument of `key-binding'. */)
1705 { 1705 {
1706 local_map = get_local_map (XINT (pos), 1706 local_map = get_local_map (XINT (pos),
1707 current_buffer, Qlocal_map); 1707 current_buffer, Qlocal_map);
1708 1708
1709 keymap = get_local_map (XINT (pos), 1709 keymap = get_local_map (XINT (pos),
1710 current_buffer, Qkeymap); 1710 current_buffer, Qkeymap);
1711 } 1711 }
@@ -1716,12 +1716,12 @@ like in the respective argument of `key-binding'. */)
1716 string displayed via the `display' property, 1716 string displayed via the `display' property,
1717 consider `local-map' and `keymap' properties of 1717 consider `local-map' and `keymap' properties of
1718 that string. */ 1718 that string. */
1719 1719
1720 if (string = POSN_STRING (position), 1720 if (string = POSN_STRING (position),
1721 (CONSP (string) && STRINGP (XCAR (string)))) 1721 (CONSP (string) && STRINGP (XCAR (string))))
1722 { 1722 {
1723 Lisp_Object pos, map; 1723 Lisp_Object pos, map;
1724 1724
1725 pos = XCDR (string); 1725 pos = XCDR (string);
1726 string = XCAR (string); 1726 string = XCAR (string);
1727 if (INTEGERP (pos) 1727 if (INTEGERP (pos)
@@ -1737,7 +1737,7 @@ like in the respective argument of `key-binding'. */)
1737 keymap = map; 1737 keymap = map;
1738 } 1738 }
1739 } 1739 }
1740 1740
1741 } 1741 }
1742 1742
1743 if (!NILP (local_map)) 1743 if (!NILP (local_map))
@@ -2890,7 +2890,7 @@ remapped command in the returned list. */)
2890 CONSP (sequences))) 2890 CONSP (sequences)))
2891 { 2891 {
2892 Lisp_Object sequence, function; 2892 Lisp_Object sequence, function;
2893 2893
2894 sequence = XCAR (sequences); 2894 sequence = XCAR (sequences);
2895 sequences = XCDR (sequences); 2895 sequences = XCDR (sequences);
2896 2896
@@ -2903,8 +2903,8 @@ remapped command in the returned list. */)
2903 2903
2904 Either nil or number as value from Flookup_key 2904 Either nil or number as value from Flookup_key
2905 means undefined. */ 2905 means undefined. */
2906 if (!EQ (shadow_lookup (keymaps, sequence, Qnil, remapped), 2906 if (NILP (Fequal (shadow_lookup (keymaps, sequence, Qnil, remapped),
2907 definition)) 2907 definition)))
2908 continue; 2908 continue;
2909 2909
2910 /* If the current sequence is a command remapping with 2910 /* If the current sequence is a command remapping with
@@ -2933,12 +2933,12 @@ remapped command in the returned list. */)
2933 Faset (sequence, make_number (ASIZE (sequence) - 1), 2933 Faset (sequence, make_number (ASIZE (sequence) - 1),
2934 build_string ("(any string)")); 2934 build_string ("(any string)"));
2935 } 2935 }
2936 2936
2937 /* It is a true unshadowed match. Record it, unless it's already 2937 /* It is a true unshadowed match. Record it, unless it's already
2938 been seen (as could happen when inheriting keymaps). */ 2938 been seen (as could happen when inheriting keymaps). */
2939 if (NILP (Fmember (sequence, found))) 2939 if (NILP (Fmember (sequence, found)))
2940 found = Fcons (sequence, found); 2940 found = Fcons (sequence, found);
2941 2941
2942 /* If firstonly is Qnon_ascii, then we can return the first 2942 /* If firstonly is Qnon_ascii, then we can return the first
2943 binding we find. If firstonly is not Qnon_ascii but not 2943 binding we find. If firstonly is not Qnon_ascii but not
2944 nil, then we should return the first ascii-only binding 2944 nil, then we should return the first ascii-only binding
diff --git a/src/lisp.h b/src/lisp.h
index 7032a3f48f4..7f5d5df66c6 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1933,22 +1933,12 @@ extern char *stack_bottom;
1933#ifdef SYNC_INPUT 1933#ifdef SYNC_INPUT
1934extern void process_pending_signals P_ ((void)); 1934extern void process_pending_signals P_ ((void));
1935extern int pending_signals; 1935extern int pending_signals;
1936 1936#define ELSE_PENDING_SIGNALS \
1937#define QUIT \ 1937 else if (pending_signals) \
1938 do { \ 1938 process_pending_signals ();
1939 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
1940 { \
1941 Lisp_Object flag = Vquit_flag; \
1942 Vquit_flag = Qnil; \
1943 if (EQ (Vthrow_on_input, flag)) \
1944 Fthrow (Vthrow_on_input, Qt); \
1945 Fsignal (Qquit, Qnil); \
1946 } \
1947 else if (pending_signals) \
1948 process_pending_signals (); \
1949 } while (0)
1950
1951#else /* not SYNC_INPUT */ 1939#else /* not SYNC_INPUT */
1940#define ELSE_PENDING_SIGNALS
1941#endif /* not SYNC_INPUT */
1952 1942
1953#define QUIT \ 1943#define QUIT \
1954 do { \ 1944 do { \
@@ -1960,10 +1950,9 @@ extern int pending_signals;
1960 Fthrow (Vthrow_on_input, Qt); \ 1950 Fthrow (Vthrow_on_input, Qt); \
1961 Fsignal (Qquit, Qnil); \ 1951 Fsignal (Qquit, Qnil); \
1962 } \ 1952 } \
1953 ELSE_PENDING_SIGNALS \
1963 } while (0) 1954 } while (0)
1964 1955
1965#endif /* not SYNC_INPUT */
1966
1967 1956
1968/* Nonzero if ought to quit now. */ 1957/* Nonzero if ought to quit now. */
1969 1958
diff --git a/src/regex.c b/src/regex.c
index bb921a5b519..f242446796d 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -3065,6 +3065,13 @@ regex_compile (pattern, size, syntax, bufp)
3065 don't need to handle them for multibyte. 3065 don't need to handle them for multibyte.
3066 They are distinguished by a negative wctype. */ 3066 They are distinguished by a negative wctype. */
3067 3067
3068 /* Setup the gl_state object to its buffer-defined
3069 value. This hardcodes the buffer-global
3070 syntax-table for ASCII chars, while the other chars
3071 will obey syntax-table properties. It's not ideal,
3072 but it's the way it's been done until now. */
3073 SETUP_SYNTAX_TABLE (BEGV, 0);
3074
3068 for (ch = 0; ch < 256; ++ch) 3075 for (ch = 0; ch < 256; ++ch)
3069 { 3076 {
3070 c = RE_CHAR_TO_MULTIBYTE (ch); 3077 c = RE_CHAR_TO_MULTIBYTE (ch);
diff --git a/src/syntax.c b/src/syntax.c
index 01b4cfb8892..47b4caf5ade 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1747,6 +1747,12 @@ skip_chars (forwardp, string, lim, handle_iso_classes)
1747 } 1747 }
1748 1748
1749 immediate_quit = 1; 1749 immediate_quit = 1;
1750 /* This code may look up syntax tables using macros that rely on the
1751 gl_state object. To make sure this object is not out of date,
1752 let's initialize it manually.
1753 We ignore syntax-table text-properties for now, since that's
1754 what we've done in the past. */
1755 SETUP_SYNTAX_TABLE (BEGV, 0);
1750 if (forwardp) 1756 if (forwardp)
1751 { 1757 {
1752 if (multibyte) 1758 if (multibyte)
@@ -2072,7 +2078,7 @@ in_classes (c, iso_classes)
2072{ 2078{
2073 int fits_class = 0; 2079 int fits_class = 0;
2074 2080
2075 while (! NILP (iso_classes)) 2081 while (CONSP (iso_classes))
2076 { 2082 {
2077 Lisp_Object elt; 2083 Lisp_Object elt;
2078 elt = XCAR (iso_classes); 2084 elt = XCAR (iso_classes);