# HG changeset patch # User Kenichi Handa # Date 1274944158 -32400 # Node ID 5a61e28431af03531b56c7465887a8e08fd6e5f7 # Parent 6979260099645f2470213d03cb3b13975afdf1a1# Parent f1cd90ef7663e60ca7c8d8365dff203bd618b126 language/hebrew.el (hebrew-shape-gstring): Check if a glyph element of GSTRING is nil. diff -r 697926009964 -r 5a61e28431af lisp/ChangeLog --- a/lisp/ChangeLog Wed May 26 23:13:23 2010 -0700 +++ b/lisp/ChangeLog Thu May 27 16:09:18 2010 +0900 @@ -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-27 Stefan Monnier * emacs-lisp/smie.el (smie-forward-token-function) diff -r 697926009964 -r 5a61e28431af lisp/language/hebrew.el --- a/lisp/language/hebrew.el Wed May 26 23:13:23 2010 -0700 +++ b/lisp/language/hebrew.el Thu May 27 16:09:18 2010 +0900 @@ -92,6 +92,9 @@ (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))