diff options
| author | Eli Zaretskii | 2010-03-06 05:16:27 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2010-03-06 05:16:27 -0500 |
| commit | 9dbadf5f1a700c5790837738410c06b481cd2222 (patch) | |
| tree | e1458f8f2aef541b98c7df4ea2d780c5011d9fe9 /src | |
| parent | d23cd5eeb2993e55943d250ea8c2015da5b06a24 (diff) | |
| parent | 4c83ed3d48c69e12c91a2ada2d00f4f74be2a42d (diff) | |
| download | emacs-9dbadf5f1a700c5790837738410c06b481cd2222.tar.gz emacs-9dbadf5f1a700c5790837738410c06b481cd2222.zip | |
Merge from mainline.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 44 | ||||
| -rw-r--r-- | src/buffer.c | 4 | ||||
| -rw-r--r-- | src/bytecode.c | 1 | ||||
| -rw-r--r-- | src/character.c | 17 | ||||
| -rw-r--r-- | src/charset.c | 4 | ||||
| -rw-r--r-- | src/coding.c | 22 | ||||
| -rw-r--r-- | src/keymap.c | 36 | ||||
| -rw-r--r-- | src/lisp.h | 23 | ||||
| -rw-r--r-- | src/regex.c | 7 | ||||
| -rw-r--r-- | src/syntax.c | 8 | ||||
| -rw-r--r-- | src/w32uniscribe.c | 2 |
11 files changed, 123 insertions, 45 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ac909cc7885..ce4fe1cd7b4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,47 @@ | |||
| 1 | 2010-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 | |||
| 13 | 2010-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 | |||
| 19 | 2010-03-02 Eli Zaretskii <eliz@gnu.org> | ||
| 20 | |||
| 21 | * coding.c (decode_coding_emacs_mule): Fixup pointers to buffer | ||
| 22 | text that could be relocated inside the call to emacs_mule_char. | ||
| 23 | (emacs_mule_char): Use CODING_DECODE_CHAR instead of DECODE_CHAR. | ||
| 24 | (CODING_DECODE_CHAR): Add a comment describing its purpose. | ||
| 25 | |||
| 26 | 2010-03-02 Kenichi Handa <handa@m17n.org> | ||
| 27 | |||
| 28 | * character.c (parse_str_as_multibyte): Fix handling of the | ||
| 29 | multibyte form of raw-bytes. | ||
| 30 | (str_as_multibyte): Likewise. | ||
| 31 | |||
| 32 | * buffer.c (Fset_buffer_multibyte): Fix handling of the multibyte | ||
| 33 | form of raw-bytes. | ||
| 34 | |||
| 35 | 2010-02-28 Chong Yidong <cyd@stupidchicken.com> | ||
| 36 | |||
| 37 | * charset.c (load_charset_map_from_file) | ||
| 38 | (load_charset_map_from_vector): Zero out allocated | ||
| 39 | charset_map_entries before using them. | ||
| 40 | |||
| 41 | 2010-02-27 Andreas Schwab <schwab@linux-m68k.org> | ||
| 42 | |||
| 43 | * w32uniscribe.c (uniscribe_check_otf): Fix length check. | ||
| 44 | |||
| 1 | 2010-02-27 Chong Yidong <cyd@stupidchicken.com> | 45 | 2010-02-27 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 46 | ||
| 3 | * font.c (font_parse_fcname): Recognize "Book", "Condensed", | 47 | * font.c (font_parse_fcname): Recognize "Book", "Condensed", |
diff --git a/src/buffer.c b/src/buffer.c index 4d590248e24..0c6e57d45be 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2499,7 +2499,9 @@ current buffer is cleared. */) | |||
| 2499 | 2499 | ||
| 2500 | if (ASCII_BYTE_P (*p)) | 2500 | if (ASCII_BYTE_P (*p)) |
| 2501 | p++, pos++; | 2501 | p++, pos++; |
| 2502 | else if (EQ (flag, Qt) && (bytes = MULTIBYTE_LENGTH (p, pend)) > 0) | 2502 | else if (EQ (flag, Qt) |
| 2503 | && ! CHAR_BYTE8_HEAD_P (*p) | ||
| 2504 | && (bytes = MULTIBYTE_LENGTH (p, pend)) > 0) | ||
| 2503 | p += bytes, pos += bytes; | 2505 | p += bytes, pos += bytes; |
| 2504 | else | 2506 | else |
| 2505 | { | 2507 | { |
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/character.c b/src/character.c index 583602fccb7..5912a70d0ce 100644 --- a/src/character.c +++ b/src/character.c | |||
| @@ -630,7 +630,8 @@ parse_str_as_multibyte (str, len, nchars, nbytes) | |||
| 630 | const unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH; | 630 | const unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH; |
| 631 | while (str < adjusted_endp) | 631 | while (str < adjusted_endp) |
| 632 | { | 632 | { |
| 633 | if ((n = MULTIBYTE_LENGTH_NO_CHECK (str)) > 0) | 633 | if (! CHAR_BYTE8_HEAD_P (*str) |
| 634 | && (n = MULTIBYTE_LENGTH_NO_CHECK (str)) > 0) | ||
| 634 | str += n, bytes += n; | 635 | str += n, bytes += n; |
| 635 | else | 636 | else |
| 636 | str++, bytes += 2; | 637 | str++, bytes += 2; |
| @@ -639,7 +640,8 @@ parse_str_as_multibyte (str, len, nchars, nbytes) | |||
| 639 | } | 640 | } |
| 640 | while (str < endp) | 641 | while (str < endp) |
| 641 | { | 642 | { |
| 642 | if ((n = MULTIBYTE_LENGTH (str, endp)) > 0) | 643 | if (! CHAR_BYTE8_HEAD_P (*str) |
| 644 | && (n = MULTIBYTE_LENGTH (str, endp)) > 0) | ||
| 643 | str += n, bytes += n; | 645 | str += n, bytes += n; |
| 644 | else | 646 | else |
| 645 | str++, bytes += 2; | 647 | str++, bytes += 2; |
| @@ -673,10 +675,13 @@ str_as_multibyte (str, len, nbytes, nchars) | |||
| 673 | { | 675 | { |
| 674 | unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH; | 676 | unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH; |
| 675 | while (p < adjusted_endp | 677 | while (p < adjusted_endp |
| 678 | && ! CHAR_BYTE8_HEAD_P (*p) | ||
| 676 | && (n = MULTIBYTE_LENGTH_NO_CHECK (p)) > 0) | 679 | && (n = MULTIBYTE_LENGTH_NO_CHECK (p)) > 0) |
| 677 | p += n, chars++; | 680 | p += n, chars++; |
| 678 | } | 681 | } |
| 679 | while ((n = MULTIBYTE_LENGTH (p, endp)) > 0) | 682 | while (p < endp |
| 683 | && ! CHAR_BYTE8_HEAD_P (*p) | ||
| 684 | && (n = MULTIBYTE_LENGTH (p, endp)) > 0) | ||
| 680 | p += n, chars++; | 685 | p += n, chars++; |
| 681 | if (nchars) | 686 | if (nchars) |
| 682 | *nchars = chars; | 687 | *nchars = chars; |
| @@ -694,7 +699,8 @@ str_as_multibyte (str, len, nbytes, nchars) | |||
| 694 | unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH; | 699 | unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH; |
| 695 | while (p < adjusted_endp) | 700 | while (p < adjusted_endp) |
| 696 | { | 701 | { |
| 697 | if ((n = MULTIBYTE_LENGTH_NO_CHECK (p)) > 0) | 702 | if (! CHAR_BYTE8_HEAD_P (*p) |
| 703 | && (n = MULTIBYTE_LENGTH_NO_CHECK (p)) > 0) | ||
| 698 | { | 704 | { |
| 699 | while (n--) | 705 | while (n--) |
| 700 | *to++ = *p++; | 706 | *to++ = *p++; |
| @@ -710,7 +716,8 @@ str_as_multibyte (str, len, nbytes, nchars) | |||
| 710 | } | 716 | } |
| 711 | while (p < endp) | 717 | while (p < endp) |
| 712 | { | 718 | { |
| 713 | if ((n = MULTIBYTE_LENGTH (p, endp)) > 0) | 719 | if (! CHAR_BYTE8_HEAD_P (*p) |
| 720 | && (n = MULTIBYTE_LENGTH (p, endp)) > 0) | ||
| 714 | { | 721 | { |
| 715 | while (n--) | 722 | while (n--) |
| 716 | *to++ = *p++; | 723 | *to++ = *p++; |
diff --git a/src/charset.c b/src/charset.c index 1db9ec17ae7..125c9131687 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -531,6 +531,7 @@ load_charset_map_from_file (charset, mapfile, control_flag) | |||
| 531 | SAFE_ALLOCA (head, struct charset_map_entries *, | 531 | SAFE_ALLOCA (head, struct charset_map_entries *, |
| 532 | sizeof (struct charset_map_entries)); | 532 | sizeof (struct charset_map_entries)); |
| 533 | entries = head; | 533 | entries = head; |
| 534 | bzero (entries, sizeof (struct charset_map_entries)); | ||
| 534 | 535 | ||
| 535 | n_entries = 0; | 536 | n_entries = 0; |
| 536 | eof = 0; | 537 | eof = 0; |
| @@ -557,6 +558,7 @@ load_charset_map_from_file (charset, mapfile, control_flag) | |||
| 557 | SAFE_ALLOCA (entries->next, struct charset_map_entries *, | 558 | SAFE_ALLOCA (entries->next, struct charset_map_entries *, |
| 558 | sizeof (struct charset_map_entries)); | 559 | sizeof (struct charset_map_entries)); |
| 559 | entries = entries->next; | 560 | entries = entries->next; |
| 561 | bzero (entries, sizeof (struct charset_map_entries)); | ||
| 560 | } | 562 | } |
| 561 | idx = n_entries % 0x10000; | 563 | idx = n_entries % 0x10000; |
| 562 | entries->entry[idx].from = from; | 564 | entries->entry[idx].from = from; |
| @@ -596,6 +598,7 @@ load_charset_map_from_vector (charset, vec, control_flag) | |||
| 596 | SAFE_ALLOCA (head, struct charset_map_entries *, | 598 | SAFE_ALLOCA (head, struct charset_map_entries *, |
| 597 | sizeof (struct charset_map_entries)); | 599 | sizeof (struct charset_map_entries)); |
| 598 | entries = head; | 600 | entries = head; |
| 601 | bzero (entries, sizeof (struct charset_map_entries)); | ||
| 599 | 602 | ||
| 600 | n_entries = 0; | 603 | n_entries = 0; |
| 601 | for (i = 0; i < len; i += 2) | 604 | for (i = 0; i < len; i += 2) |
| @@ -632,6 +635,7 @@ load_charset_map_from_vector (charset, vec, control_flag) | |||
| 632 | SAFE_ALLOCA (entries->next, struct charset_map_entries *, | 635 | SAFE_ALLOCA (entries->next, struct charset_map_entries *, |
| 633 | sizeof (struct charset_map_entries)); | 636 | sizeof (struct charset_map_entries)); |
| 634 | entries = entries->next; | 637 | entries = entries->next; |
| 638 | bzero (entries, sizeof (struct charset_map_entries)); | ||
| 635 | } | 639 | } |
| 636 | idx = n_entries % 0x10000; | 640 | idx = n_entries % 0x10000; |
| 637 | entries->entry[idx].from = from; | 641 | entries->entry[idx].from = from; |
diff --git a/src/coding.c b/src/coding.c index 2144fe5fcd4..df81eaba16e 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -1005,6 +1005,10 @@ record_conversion_result (struct coding_system *coding, | |||
| 1005 | } | 1005 | } |
| 1006 | } | 1006 | } |
| 1007 | 1007 | ||
| 1008 | /* This wrapper macro is used to preserve validity of pointers into | ||
| 1009 | buffer text across calls to decode_char, which could cause | ||
| 1010 | relocation of buffers if it loads a charset map, because loading a | ||
| 1011 | charset map allocates large structures. */ | ||
| 1008 | #define CODING_DECODE_CHAR(coding, src, src_base, src_end, charset, code, c) \ | 1012 | #define CODING_DECODE_CHAR(coding, src, src_base, src_end, charset, code, c) \ |
| 1009 | do { \ | 1013 | do { \ |
| 1010 | charset_map_loaded = 0; \ | 1014 | charset_map_loaded = 0; \ |
| @@ -2061,7 +2065,7 @@ detect_coding_emacs_mule (coding, detect_info) | |||
| 2061 | /* Parse emacs-mule multibyte sequence at SRC and return the decoded | 2065 | /* Parse emacs-mule multibyte sequence at SRC and return the decoded |
| 2062 | character. If CMP_STATUS indicates that we must expect MSEQ or | 2066 | character. If CMP_STATUS indicates that we must expect MSEQ or |
| 2063 | RULE described above, decode it and return the negative value of | 2067 | RULE described above, decode it and return the negative value of |
| 2064 | the deocded character or rule. If an invalid byte is found, return | 2068 | the decoded character or rule. If an invalid byte is found, return |
| 2065 | -1. If SRC is too short, return -2. */ | 2069 | -1. If SRC is too short, return -2. */ |
| 2066 | 2070 | ||
| 2067 | int | 2071 | int |
| @@ -2178,7 +2182,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) | |||
| 2178 | default: | 2182 | default: |
| 2179 | abort (); | 2183 | abort (); |
| 2180 | } | 2184 | } |
| 2181 | c = DECODE_CHAR (charset, code); | 2185 | CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, code, c); |
| 2182 | if (c < 0) | 2186 | if (c < 0) |
| 2183 | goto invalid_code; | 2187 | goto invalid_code; |
| 2184 | } | 2188 | } |
| @@ -2525,9 +2529,23 @@ decode_coding_emacs_mule (coding) | |||
| 2525 | else | 2529 | else |
| 2526 | { | 2530 | { |
| 2527 | int nchars, nbytes; | 2531 | int nchars, nbytes; |
| 2532 | /* emacs_mule_char can load a charset map from a file, which | ||
| 2533 | allocates a large structure and might cause buffer text | ||
| 2534 | to be relocated as result. Thus, we need to remember the | ||
| 2535 | original pointer to buffer text, and fixup all related | ||
| 2536 | pointers after the call. */ | ||
| 2537 | const unsigned char *orig = coding->source; | ||
| 2538 | EMACS_INT offset; | ||
| 2528 | 2539 | ||
| 2529 | c = emacs_mule_char (coding, src_base, &nbytes, &nchars, &id, | 2540 | c = emacs_mule_char (coding, src_base, &nbytes, &nchars, &id, |
| 2530 | cmp_status); | 2541 | cmp_status); |
| 2542 | offset = coding->source - orig; | ||
| 2543 | if (offset) | ||
| 2544 | { | ||
| 2545 | src += offset; | ||
| 2546 | src_base += offset; | ||
| 2547 | src_end += offset; | ||
| 2548 | } | ||
| 2531 | if (c < 0) | 2549 | if (c < 0) |
| 2532 | { | 2550 | { |
| 2533 | if (c == -1) | 2551 | if (c == -1) |
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 |
| 1934 | extern void process_pending_signals P_ ((void)); | 1934 | extern void process_pending_signals P_ ((void)); |
| 1935 | extern int pending_signals; | 1935 | extern 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); |
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index f2bd0f44b50..cfdf629ceee 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c | |||
| @@ -666,7 +666,7 @@ int uniscribe_check_otf (font, otf_spec) | |||
| 666 | struct gcpro gcpro1; | 666 | struct gcpro gcpro1; |
| 667 | 667 | ||
| 668 | /* Check the spec is in the right format. */ | 668 | /* Check the spec is in the right format. */ |
| 669 | if (!CONSP (otf_spec) || Flength (otf_spec) < 3) | 669 | if (!CONSP (otf_spec) || XINT (Flength (otf_spec)) < 3) |
| 670 | return 0; | 670 | return 0; |
| 671 | 671 | ||
| 672 | /* Break otf_spec into its components. */ | 672 | /* Break otf_spec into its components. */ |