comparison lisp/unicode.el @ 4619:75e7ab37b6c8

Fix query-coding-tests.el failures, non-mule ELCs, mule build. lisp/ChangeLog addition: 2009-02-17 Aidan Kehoe <kehoea@parhasard.net> * unicode.el (unicode-query-coding-region): Avoid eval-when-compile where that gives incorrect results when compiled on a non-Mule XEmacs but run on a Mule XEmacs. Fixes problems seen by 20a807210902131835o2f25930apaffabb6b62a95e5f@mail.gmail.com , thank you Vin! (An equivalent way to get the efficiency of the eval-when-compile would be to provide two defvars, evaluated at dump time, but this code will be in C soon enough, and we can use the relevant preprocessor constants there.)
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 17 Feb 2009 08:35:13 +0000
parents c786c3fd0740
children 257b468bf2ca
comparison
equal deleted inserted replaced
4618:69cd8e2d2a88 4619:75e7ab37b6c8
638 unicode-invalid-sequence-regexp-range 638 unicode-invalid-sequence-regexp-range
639 ""))) 639 "")))
640 (ranges (make-range-table)) 640 (ranges (make-range-table))
641 (looking-at-arg (concat "[" skip-chars-arg "]")) 641 (looking-at-arg (concat "[" skip-chars-arg "]"))
642 (case-fold-search nil) 642 (case-fold-search nil)
643 (invalid-sequence-lower-unicode-bound
644 (char-to-unicode
645 (aref (decode-coding-string "\xd8\x00\x00\x00"
646 'utf-16-be) 3)))
647 (invalid-sequence-upper-unicode-bound
648 (char-to-unicode
649 (aref (decode-coding-string "\xd8\x00\x00\xFF"
650 'utf-16-be) 3)))
643 fail-range-start fail-range-end char-after failed 651 fail-range-start fail-range-end char-after failed
644 extent char-unicode failed-reason previous-failed-reason) 652 extent char-unicode failed-reason previous-failed-reason)
645 (save-excursion 653 (save-excursion
646 (when highlightp 654 (when highlightp
647 (query-coding-clear-highlights begin end buffer)) 655 (query-coding-clear-highlights begin end buffer))
660 ;; The default case, with ignore-invalid-sequencesp 668 ;; The default case, with ignore-invalid-sequencesp
661 ;; not specified: 669 ;; not specified:
662 ;; If the character is in the Unicode range that 670 ;; If the character is in the Unicode range that
663 ;; corresponds to an invalid octet, we want to 671 ;; corresponds to an invalid octet, we want to
664 ;; treat it as unencodable. 672 ;; treat it as unencodable.
665 (<= (eval-when-compile 673 (<= invalid-sequence-lower-unicode-bound
666 (char-to-unicode
667 (aref (decode-coding-string "\xd8\x00\x00\x00"
668 'utf-16-be) 3)))
669 char-unicode) 674 char-unicode)
670 (<= char-unicode 675 (<= char-unicode
671 (eval-when-compile 676 invalid-sequence-upper-unicode-bound)
672 (char-to-unicode
673 (aref (decode-coding-string "\xd8\x00\x00\xFF"
674 'utf-16-be) 3))))
675 (setq failed-reason 'invalid-sequence))) 677 (setq failed-reason 'invalid-sequence)))
676 (or (null previous-failed-reason) 678 (or (null previous-failed-reason)
677 (eq previous-failed-reason failed-reason))) 679 (eq previous-failed-reason failed-reason)))
678 (forward-char 1 buffer) 680 (forward-char 1 buffer)
679 (setq char-after (char-after (point buffer) buffer) 681 (setq char-after (char-after (point buffer) buffer)