commit: Display control characters using carets, invalid-sequence-coding-system
15 years, 8 months
Aidan Kehoe
changeset: 4590:c83cab5a4f04d9f2c7f94946c6fbbaa9749961f6
parent: 4582:00ed9903a988de9a983c074bf0abdc667639eeaf
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Jan 31 17:38:07 2009 +0000
files: lisp/ChangeLog lisp/mule/mule-cmds.el
description:
Display control characters using carets, invalid-sequence-coding-system
2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/mule-cmds.el (finish-set-language-environment):
Treat control characters specially in the
invalid-sequence-coding-system handling, display them using the
caret notation.
diff -r 00ed9903a988de9a983c074bf0abdc667639eeaf -r c83cab5a4f04d9f2c7f94946c6fbbaa9749961f6 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Jan 18 12:56:51 2009 +0000
+++ b/lisp/ChangeLog Sat Jan 31 17:38:07 2009 +0000
@@ -1,3 +1,10 @@ 2009-01-18 Ville Skyttä <scop(a)xemacs.o
+2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * mule/mule-cmds.el (finish-set-language-environment):
+ Treat control characters specially in the
+ invalid-sequence-coding-system handling, display them using the
+ caret notation.
+
2009-01-18 Ville Skyttä <scop(a)xemacs.org>
* font.el (font-*-p): Docstring spelling fix.
diff -r 00ed9903a988de9a983c074bf0abdc667639eeaf -r c83cab5a4f04d9f2c7f94946c6fbbaa9749961f6 lisp/mule/mule-cmds.el
--- a/lisp/mule/mule-cmds.el Sun Jan 18 12:56:51 2009 +0000
+++ b/lisp/mule/mule-cmds.el Sat Jan 31 17:38:07 2009 +0000
@@ -771,17 +771,18 @@ the language environment for the major l
(let ((invalid-sequence-coding-system
(get-language-info language-name 'invalid-sequence-coding-system))
(disp-table (specifier-instance current-display-table))
- glyph)
+ glyph string)
(when (consp invalid-sequence-coding-system)
(setq invalid-sequence-coding-system
(car invalid-sequence-coding-system)))
(map-char-table
#'(lambda (key entry)
- (setq glyph (make-glyph
- (vector
- 'string :data
- (decode-coding-string (string entry)
- invalid-sequence-coding-system))))
+ (setq string (decode-coding-string (string entry)
+ invalid-sequence-coding-system))
+ ;; Treat control characters specially:
+ (when (string-match "^[\x00-\x1f\x80-\x9f]$" string)
+ (setq string (format "^%c" (+ ?@ (aref string 0)))))
+ (setq glyph (make-glyph (vector 'string :data string)))
(set-glyph-face glyph 'unicode-invalid-sequence-warning-face)
(put-char-table key glyph disp-table)
nil)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: YAFMT
15 years, 8 months
Stephen Turnbull
changeset: 4589:03ec57ae1d1e2a18aa57a0feceff2caa64dbe636
tag: tip
parent: 4588:6a6689b96f00c887a1ede549a873f6f6f334b29b
parent: 4585:b25f081370e0ea07648c447823f1b97e3d45b33b
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Sat Jan 31 22:47:43 2009 +0900
files:
description:
YAFMT
diff -r 6a6689b96f00c887a1ede549a873f6f6f334b29b -r 03ec57ae1d1e2a18aa57a0feceff2caa64dbe636 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Jan 31 22:25:16 2009 +0900
+++ b/lisp/ChangeLog Sat Jan 31 22:47:43 2009 +0900
@@ -1,3 +1,9 @@ 2009-01-18 Ville Skyttä <scop(a)xemacs.o
+2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * frame.el (display-graphic-p):
+ Call #'display-device on the DISPLAY argument, ensuring that the
+ argument to #'device-on-window-system-p is correct.
+
2009-01-18 Ville Skyttä <scop(a)xemacs.org>
* font.el (font-*-p): Docstring spelling fix.
diff -r 6a6689b96f00c887a1ede549a873f6f6f334b29b -r 03ec57ae1d1e2a18aa57a0feceff2caa64dbe636 lisp/frame.el
--- a/lisp/frame.el Sat Jan 31 22:25:16 2009 +0900
+++ b/lisp/frame.el Sat Jan 31 22:47:43 2009 +0900
@@ -1211,7 +1211,7 @@ that use a window system such as X, and
that use a window system such as X, and false for text-only terminals.
DISPLAY can be a frame, a device, a console, or nil (meaning the selected
frame)."
- (device-on-window-system-p display))
+ (device-on-window-system-p (display-device display)))
(defun display-images-p (&optional display)
"Return non-nil if DISPLAY can display images.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Document non-obvious usages.
15 years, 8 months
Stephen Turnbull
changeset: 4587:871eb054b34a021924f195dc208af255505350cd
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Tue Nov 25 10:44:16 2008 +0900
files: src/ChangeLog src/elhash.c
description:
Document non-obvious usages.
diff -r 56e67d42eb04dc62fd3c8d5950209f941e0f21ee -r 871eb054b34a021924f195dc208af255505350cd src/ChangeLog
--- a/src/ChangeLog Thu Nov 20 23:59:52 2008 +0900
+++ b/src/ChangeLog Tue Nov 25 10:44:16 2008 +0900
@@ -136,6 +136,13 @@ 2008-11-02 Stephen J. Turnbull <stephe
* input-method-xlib.c:
Use Xt_RESOURCE.
+
+2008-11-25 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * elhash.c (hash_table_data_validate):
+ * elhash.c (decode_hash_table_rehash_size):
+ * elhash.c (decode_hash_table_rehash_threshold):
+ Document side effects used in these functions.
2008-11-20 Stephen J. Turnbull <stephen(a)xemacs.org>
diff -r 56e67d42eb04dc62fd3c8d5950209f941e0f21ee -r 871eb054b34a021924f195dc208af255505350cd src/elhash.c
--- a/src/elhash.c Thu Nov 20 23:59:52 2008 +0900
+++ b/src/elhash.c Tue Nov 25 10:44:16 2008 +0900
@@ -755,6 +755,7 @@ static double
static double
decode_hash_table_rehash_size (Lisp_Object rehash_size)
{
+ /* -1.0 signals make_general_lisp_hash_table to use the default. */
return NILP (rehash_size) ? -1.0 : XFLOAT_DATA (rehash_size);
}
@@ -786,6 +787,7 @@ static double
static double
decode_hash_table_rehash_threshold (Lisp_Object rehash_threshold)
{
+ /* -1.0 signals make_general_lisp_hash_table to use the default. */
return NILP (rehash_threshold) ? -1.0 : XFLOAT_DATA (rehash_threshold);
}
@@ -795,6 +797,7 @@ hash_table_data_validate (Lisp_Object UN
{
int len;
+ /* Check for improper lists while getting length. */
GET_EXTERNAL_LIST_LENGTH (value, len);
if (len & 1)
@@ -804,6 +807,7 @@ hash_table_data_validate (Lisp_Object UN
value, Qhash_table, errb);
return 0;
}
+
return 1;
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Clarify comment in struct x_frame.
15 years, 8 months
Stephen Turnbull
changeset: 4586:56e67d42eb04dc62fd3c8d5950209f941e0f21ee
parent: 4583:2669b1b7e33b70dad0f42a94629ab3afeffa9b55
user: Stephen J. Turnbull <stephen(a)xemacs.org>
date: Thu Nov 20 23:59:52 2008 +0900
files: src/ChangeLog src/console-x-impl.h
description:
Clarify comment in struct x_frame.
diff -r 2669b1b7e33b70dad0f42a94629ab3afeffa9b55 -r 56e67d42eb04dc62fd3c8d5950209f941e0f21ee src/ChangeLog
--- a/src/ChangeLog Sat Jan 31 13:06:37 2009 +0000
+++ b/src/ChangeLog Thu Nov 20 23:59:52 2008 +0900
@@ -136,6 +136,10 @@ 2008-11-02 Stephen J. Turnbull <stephe
* input-method-xlib.c:
Use Xt_RESOURCE.
+
+2008-11-20 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * console-x-impl.h (struct x_frame): Clarify comment.
2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
diff -r 2669b1b7e33b70dad0f42a94629ab3afeffa9b55 -r 56e67d42eb04dc62fd3c8d5950209f941e0f21ee src/console-x-impl.h
--- a/src/console-x-impl.h Sat Jan 31 13:06:37 2009 +0000
+++ b/src/console-x-impl.h Thu Nov 20 23:59:52 2008 +0900
@@ -332,7 +332,7 @@ struct x_frame
or partially hidden by another X window */
unsigned int totally_visible_p :1;
- /* NB: Both of the following flags are derivable from the 'shell'
+ /* NB: Both of the following flags are derivable from the 'widget'
field above, but it's easier if we also have them separately here. */
/* Are we a top-level frame? This means that our shell is a
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC21.5] Minor doc improvements
15 years, 8 months
Stephen J. Turnbull
APPROVE COMMIT 21.5
This fixes a minor error in one comment, and adds some comments on
side effects that were very unobvious to me when I had to track them
down.
diff -r 2669b1b7e33b -r 871eb054b34a src/ChangeLog
--- a/src/ChangeLog Sat Jan 31 13:06:37 2009 +0000
+++ b/src/ChangeLog Tue Nov 25 10:44:16 2008 +0900
@@ -137,6 +137,17 @@
* input-method-xlib.c:
Use Xt_RESOURCE.
+2008-11-25 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * elhash.c (hash_table_data_validate):
+ * elhash.c (decode_hash_table_rehash_size):
+ * elhash.c (decode_hash_table_rehash_threshold):
+ Document side effects used in these functions.
+
+2008-11-20 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * console-x-impl.h (struct x_frame): Clarify comment.
+
2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
* regex.c (re_search_2): Fix at_dot by changing charpos to bytepos.
diff -r 2669b1b7e33b -r 871eb054b34a src/console-x-impl.h
--- a/src/console-x-impl.h Sat Jan 31 13:06:37 2009 +0000
+++ b/src/console-x-impl.h Tue Nov 25 10:44:16 2008 +0900
@@ -332,7 +332,7 @@
or partially hidden by another X window */
unsigned int totally_visible_p :1;
- /* NB: Both of the following flags are derivable from the 'shell'
+ /* NB: Both of the following flags are derivable from the 'widget'
field above, but it's easier if we also have them separately here. */
/* Are we a top-level frame? This means that our shell is a
diff -r 2669b1b7e33b -r 871eb054b34a src/elhash.c
--- a/src/elhash.c Sat Jan 31 13:06:37 2009 +0000
+++ b/src/elhash.c Tue Nov 25 10:44:16 2008 +0900
@@ -755,6 +755,7 @@
static double
decode_hash_table_rehash_size (Lisp_Object rehash_size)
{
+ /* -1.0 signals make_general_lisp_hash_table to use the default. */
return NILP (rehash_size) ? -1.0 : XFLOAT_DATA (rehash_size);
}
@@ -786,6 +787,7 @@
static double
decode_hash_table_rehash_threshold (Lisp_Object rehash_threshold)
{
+ /* -1.0 signals make_general_lisp_hash_table to use the default. */
return NILP (rehash_threshold) ? -1.0 : XFLOAT_DATA (rehash_threshold);
}
@@ -795,6 +797,7 @@
{
int len;
+ /* Check for improper lists while getting length. */
GET_EXTERNAL_LIST_LENGTH (value, len);
if (len & 1)
@@ -804,6 +807,7 @@
value, Qhash_table, errb);
return 0;
}
+
return 1;
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Correct a bug in #'display-graphic-p.
15 years, 8 months
Aidan Kehoe
APPROVE COMMIT
NOTE; this patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1233408092 0
# Node ID 732e3243f2e4f8be3758ef0820b6a415dfbd1966
# Parent 00ed9903a988de9a983c074bf0abdc667639eeaf
Correct a bug in #'display-graphic-p.
2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
* frame.el (display-graphic-p):
Call #'display-device on the DISPLAY argument, ensuring that the
argument to #'device-on-window-system-p is correct.
diff -r 00ed9903a988 -r 732e3243f2e4 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Jan 18 12:56:51 2009 +0000
+++ b/lisp/ChangeLog Sat Jan 31 13:21:32 2009 +0000
@@ -1,3 +1,9 @@
+2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * frame.el (display-graphic-p):
+ Call #'display-device on the DISPLAY argument, ensuring that the
+ argument to #'device-on-window-system-p is correct.
+
2009-01-18 Ville Skyttä <scop(a)xemacs.org>
* font.el (font-*-p): Docstring spelling fix.
diff -r 00ed9903a988 -r 732e3243f2e4 lisp/frame.el
--- a/lisp/frame.el Sun Jan 18 12:56:51 2009 +0000
+++ b/lisp/frame.el Sat Jan 31 13:21:32 2009 +0000
@@ -1211,7 +1211,7 @@
that use a window system such as X, and false for text-only terminals.
DISPLAY can be a frame, a device, a console, or nil (meaning the selected
frame)."
- (device-on-window-system-p display))
+ (device-on-window-system-p (display-device display)))
(defun display-images-p (&optional display)
"Return non-nil if DISPLAY can display images.
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghe, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Correct a bug in #'display-graphic-p.
15 years, 8 months
Aidan Kehoe
changeset: 4584:732e3243f2e4f8be3758ef0820b6a415dfbd1966
parent: 4582:00ed9903a988de9a983c074bf0abdc667639eeaf
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Jan 31 13:21:32 2009 +0000
files: lisp/ChangeLog lisp/frame.el
description:
Correct a bug in #'display-graphic-p.
2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
* frame.el (display-graphic-p):
Call #'display-device on the DISPLAY argument, ensuring that the
argument to #'device-on-window-system-p is correct.
diff -r 00ed9903a988de9a983c074bf0abdc667639eeaf -r 732e3243f2e4f8be3758ef0820b6a415dfbd1966 lisp/ChangeLog
--- a/lisp/ChangeLog Sun Jan 18 12:56:51 2009 +0000
+++ b/lisp/ChangeLog Sat Jan 31 13:21:32 2009 +0000
@@ -1,3 +1,9 @@ 2009-01-18 Ville Skyttä <scop(a)xemacs.o
+2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * frame.el (display-graphic-p):
+ Call #'display-device on the DISPLAY argument, ensuring that the
+ argument to #'device-on-window-system-p is correct.
+
2009-01-18 Ville Skyttä <scop(a)xemacs.org>
* font.el (font-*-p): Docstring spelling fix.
diff -r 00ed9903a988de9a983c074bf0abdc667639eeaf -r 732e3243f2e4f8be3758ef0820b6a415dfbd1966 lisp/frame.el
--- a/lisp/frame.el Sun Jan 18 12:56:51 2009 +0000
+++ b/lisp/frame.el Sat Jan 31 13:21:32 2009 +0000
@@ -1211,7 +1211,7 @@ that use a window system such as X, and
that use a window system such as X, and false for text-only terminals.
DISPLAY can be a frame, a device, a console, or nil (meaning the selected
frame)."
- (device-on-window-system-p display))
+ (device-on-window-system-p (display-device display)))
(defun display-images-p (&optional display)
"Return non-nil if DISPLAY can display images.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Correct little-endian UTF-16 surrogate handling.
15 years, 8 months
Aidan Kehoe
APPROVE COMMIT
NOTE; this patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1233407197 0
# Node ID 2669b1b7e33b70dad0f42a94629ab3afeffa9b55
# Parent 00ed9903a988de9a983c074bf0abdc667639eeaf
Correct little-endian UTF-16 surrogate handling.
src/ChangeLog addition:
2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
* unicode.c (unicode_convert):
Correct little-endian UTF-16 surrogate handling.
tests/ChangeLog addition:
2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/mule-tests.el:
Test little-endian Unicode surrogates too.
diff -r 00ed9903a988 -r 2669b1b7e33b src/ChangeLog
--- a/src/ChangeLog Sun Jan 18 12:56:51 2009 +0000
+++ b/src/ChangeLog Sat Jan 31 13:06:37 2009 +0000
@@ -1,3 +1,8 @@
+2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * unicode.c (unicode_convert):
+ Correct little-endian UTF-16 surrogate handling.
+
2009-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
* chartab.c (print_table_entry):
diff -r 00ed9903a988 -r 2669b1b7e33b src/unicode.c
--- a/src/unicode.c Sun Jan 18 12:56:51 2009 +0000
+++ b/src/unicode.c Sat Jan 31 13:06:37 2009 +0000
@@ -2115,23 +2115,47 @@
{
int tempch;
- if (!valid_utf_16_last_surrogate(ch & 0xFFFF))
- {
- DECODE_ERROR_OCTET ((ch >> 24) & 0xFF, dst, data,
- ignore_bom);
- DECODE_ERROR_OCTET ((ch >> 16) & 0xFF, dst, data,
- ignore_bom);
- DECODE_ERROR_OCTET ((ch >> 8) & 0xFF, dst, data,
- ignore_bom);
- DECODE_ERROR_OCTET (ch & 0xFF, dst, data,
- ignore_bom);
- }
- else
+ if (little_endian)
{
- tempch = utf_16_surrogates_to_code((ch >> 16),
- (ch & 0xffff));
- decode_unicode_char(tempch, dst, data, ignore_bom);
+ if (!valid_utf_16_last_surrogate(ch >> 16))
+ {
+ DECODE_ERROR_OCTET (ch & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 8) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 16) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 24) & 0xFF, dst, data,
+ ignore_bom);
+ }
+ else
+ {
+ tempch = utf_16_surrogates_to_code((ch & 0xffff),
+ (ch >> 16));
+ decode_unicode_char(tempch, dst, data, ignore_bom);
+ }
}
+ else
+ {
+ if (!valid_utf_16_last_surrogate(ch & 0xFFFF))
+ {
+ DECODE_ERROR_OCTET ((ch >> 24) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 16) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 8) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET (ch & 0xFF, dst, data,
+ ignore_bom);
+ }
+ else
+ {
+ tempch = utf_16_surrogates_to_code((ch >> 16),
+ (ch & 0xffff));
+ decode_unicode_char(tempch, dst, data, ignore_bom);
+ }
+ }
+
ch = 0;
counter = 0;
}
diff -r 00ed9903a988 -r 2669b1b7e33b tests/ChangeLog
--- a/tests/ChangeLog Sun Jan 18 12:56:51 2009 +0000
+++ b/tests/ChangeLog Sat Jan 31 13:06:37 2009 +0000
@@ -1,3 +1,8 @@
+2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/mule-tests.el:
+ Test little-endian Unicode surrogates too.
+
2009-01-18 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el: (char-table-with-string):
diff -r 00ed9903a988 -r 2669b1b7e33b tests/automated/mule-tests.el
--- a/tests/automated/mule-tests.el Sun Jan 18 12:56:51 2009 +0000
+++ b/tests/automated/mule-tests.el Sat Jan 31 13:06:37 2009 +0000
@@ -446,12 +446,17 @@
(encode-coding-string xemacs-character 'ctext))))))
(loop
- for (code-point encoded)
- in '((#x10000 "\xd8\x00\xdc\x00")
- (#x10FFFD "\xdb\xff\xdf\xfd"))
- do (Assert (equal (encode-coding-string
- (decode-char 'ucs code-point) 'utf-16)
- encoded)))
+ for (code-point utf-16-big-endian utf-16-little-endian)
+ in '((#x10000 "\xd8\x00\xdc\x00" "\x00\xd8\x00\xdc")
+ (#x10FFFD "\xdb\xff\xdf\xfd" "\xff\xdb\xfd\xdf"))
+ do
+ (Assert (equal (encode-coding-string
+ (decode-char 'ucs code-point) 'utf-16)
+ utf-16-big-endian))
+ (Assert (equal (encode-coding-string
+ (decode-char 'ucs code-point) 'utf-16-le)
+ utf-16-little-endian))
+
;;---------------------------------------------------------------
;; Regression test for a couple of CCL-related bugs.
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghe, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
commit: Correct little-endian UTF-16 surrogate handling.
15 years, 8 months
Aidan Kehoe
changeset: 4583:2669b1b7e33b70dad0f42a94629ab3afeffa9b55
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Jan 31 13:06:37 2009 +0000
files: src/ChangeLog src/unicode.c tests/ChangeLog tests/automated/mule-tests.el
description:
Correct little-endian UTF-16 surrogate handling.
src/ChangeLog addition:
2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
* unicode.c (unicode_convert):
Correct little-endian UTF-16 surrogate handling.
tests/ChangeLog addition:
2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/mule-tests.el:
Test little-endian Unicode surrogates too.
diff -r 00ed9903a988de9a983c074bf0abdc667639eeaf -r 2669b1b7e33b70dad0f42a94629ab3afeffa9b55 src/ChangeLog
--- a/src/ChangeLog Sun Jan 18 12:56:51 2009 +0000
+++ b/src/ChangeLog Sat Jan 31 13:06:37 2009 +0000
@@ -1,3 +1,8 @@ 2009-01-16 Aidan Kehoe <kehoea@parhasa
+2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * unicode.c (unicode_convert):
+ Correct little-endian UTF-16 surrogate handling.
+
2009-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
* chartab.c (print_table_entry):
diff -r 00ed9903a988de9a983c074bf0abdc667639eeaf -r 2669b1b7e33b70dad0f42a94629ab3afeffa9b55 src/unicode.c
--- a/src/unicode.c Sun Jan 18 12:56:51 2009 +0000
+++ b/src/unicode.c Sat Jan 31 13:06:37 2009 +0000
@@ -2115,23 +2115,47 @@ unicode_convert (struct coding_stream *s
{
int tempch;
- if (!valid_utf_16_last_surrogate(ch & 0xFFFF))
- {
- DECODE_ERROR_OCTET ((ch >> 24) & 0xFF, dst, data,
- ignore_bom);
- DECODE_ERROR_OCTET ((ch >> 16) & 0xFF, dst, data,
- ignore_bom);
- DECODE_ERROR_OCTET ((ch >> 8) & 0xFF, dst, data,
- ignore_bom);
- DECODE_ERROR_OCTET (ch & 0xFF, dst, data,
- ignore_bom);
- }
- else
+ if (little_endian)
{
- tempch = utf_16_surrogates_to_code((ch >> 16),
- (ch & 0xffff));
- decode_unicode_char(tempch, dst, data, ignore_bom);
+ if (!valid_utf_16_last_surrogate(ch >> 16))
+ {
+ DECODE_ERROR_OCTET (ch & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 8) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 16) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 24) & 0xFF, dst, data,
+ ignore_bom);
+ }
+ else
+ {
+ tempch = utf_16_surrogates_to_code((ch & 0xffff),
+ (ch >> 16));
+ decode_unicode_char(tempch, dst, data, ignore_bom);
+ }
}
+ else
+ {
+ if (!valid_utf_16_last_surrogate(ch & 0xFFFF))
+ {
+ DECODE_ERROR_OCTET ((ch >> 24) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 16) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET ((ch >> 8) & 0xFF, dst, data,
+ ignore_bom);
+ DECODE_ERROR_OCTET (ch & 0xFF, dst, data,
+ ignore_bom);
+ }
+ else
+ {
+ tempch = utf_16_surrogates_to_code((ch >> 16),
+ (ch & 0xffff));
+ decode_unicode_char(tempch, dst, data, ignore_bom);
+ }
+ }
+
ch = 0;
counter = 0;
}
diff -r 00ed9903a988de9a983c074bf0abdc667639eeaf -r 2669b1b7e33b70dad0f42a94629ab3afeffa9b55 tests/ChangeLog
--- a/tests/ChangeLog Sun Jan 18 12:56:51 2009 +0000
+++ b/tests/ChangeLog Sat Jan 31 13:06:37 2009 +0000
@@ -1,3 +1,8 @@ 2009-01-18 Aidan Kehoe <kehoea@parhasa
+2009-01-31 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/mule-tests.el:
+ Test little-endian Unicode surrogates too.
+
2009-01-18 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/lisp-tests.el: (char-table-with-string):
diff -r 00ed9903a988de9a983c074bf0abdc667639eeaf -r 2669b1b7e33b70dad0f42a94629ab3afeffa9b55 tests/automated/mule-tests.el
--- a/tests/automated/mule-tests.el Sun Jan 18 12:56:51 2009 +0000
+++ b/tests/automated/mule-tests.el Sat Jan 31 13:06:37 2009 +0000
@@ -446,12 +446,17 @@ This is a naive implementation in Lisp.
(encode-coding-string xemacs-character 'ctext))))))
(loop
- for (code-point encoded)
- in '((#x10000 "\xd8\x00\xdc\x00")
- (#x10FFFD "\xdb\xff\xdf\xfd"))
- do (Assert (equal (encode-coding-string
- (decode-char 'ucs code-point) 'utf-16)
- encoded)))
+ for (code-point utf-16-big-endian utf-16-little-endian)
+ in '((#x10000 "\xd8\x00\xdc\x00" "\x00\xd8\x00\xdc")
+ (#x10FFFD "\xdb\xff\xdf\xfd" "\xff\xdb\xfd\xdf"))
+ do
+ (Assert (equal (encode-coding-string
+ (decode-char 'ucs code-point) 'utf-16)
+ utf-16-big-endian))
+ (Assert (equal (encode-coding-string
+ (decode-char 'ucs code-point) 'utf-16-le)
+ utf-16-little-endian))
+
;;---------------------------------------------------------------
;; Regression test for a couple of CCL-related bugs.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
beginning-of-defun-function
15 years, 8 months
Andreas Röhler
Hi,
`beginning-of-defun-raw' in GNU Emacs has a nice
feature, enabling functions instead of regexps to
determine beginning and end of defun, i.e. function or form.
This is done by setting vars like
`beginning-of-defun-function'.
It might be useful for python-mode.el, AFAIK other
modes use this feature too.
Herewith a patch against latest XEmacs lisp.el.
Andreas Röhler
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches