From 2b25da455e14b3712f544ebf7fb1c83d17353130 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 27 May 2010 13:24:30 +0900 Subject: [PATCH] language/hebrew.el (hebrew-shape-gstring): Check if a glyph element of GSTRING is nil. --- lisp/ChangeLog | 5 +++++ lisp/language/hebrew.el | 3 +++ 2 files changed, 8 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fd5d16a710c..e72dfd2614b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-05-27 Kenichi Handa + + * language/hebrew.el (hebrew-shape-gstring): Check if a glyph + element of GSTRING is nil. + 2010-05-25 Chong Yidong * log-edit.el (log-edit-strip-single-file-name): Default to nil. diff --git a/lisp/language/hebrew.el b/lisp/language/hebrew.el index 5c39bb22416..f024251c60b 100644 --- a/lisp/language/hebrew.el +++ b/lisp/language/hebrew.el @@ -92,6 +92,9 @@ Bidirectional editing is supported."))) (nchars (lgstring-char-len gstring)) (nglyphs (lgstring-glyph-len gstring)) (base-width (lglyph-width (lgstring-glyph gstring 0)))) + (while (and (> nglyphs 1) + (not (lgstring-glyph gstring (1- nglyphs)))) + (setq nglyphs (1- nglyphs))) (while (> nglyphs 1) (setq nglyphs (1- nglyphs)) (let* ((glyph (lgstring-glyph gstring nglyphs)) -- 2.39.2