From b8321d869395954ff005880866320784e24e334c Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 10 Jun 2009 00:35:08 +0000 Subject: [PATCH] (compose-gstring-for-terminal): For zero-width characters of Unicode category `Cf', simply replace it with SPC. --- lisp/ChangeLog | 5 +++++ lisp/composite.el | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b73049a110..cfab7c2065 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-06-10 Kenichi Handa + + * composite.el (compose-gstring-for-terminal): For zero-width + characters of Unicode category `Cf', simply replace it with SPC. + 2009-06-09 Agustín Martín * ispell.el: Make `ispell-dictionary' customizable (#2555) diff --git a/lisp/composite.el b/lisp/composite.el index d3c000fe83..ce34336ced 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -681,7 +681,14 @@ a prepending a space before it." (lglyph-set-from-to glyph i i) (setq i (1+ i)))) (if (= (lglyph-width glyph) 0) - (progn + (if (eq (get-char-code-property (lglyph-char glyph) + 'general-category) + 'Cf) + (progn + ;; Compose by replacing with a space. + (lglyph-set-char glyph 32) + (lglyph-set-width glyph 1) + (setq i (1+ i))) ;; Compose by prepending a space. (setq gstring (lgstring-insert-glyph gstring i (lglyph-copy glyph)) -- 2.20.1