changeset 94955:e22dd2392947

(compose-chars-after): Assume that WINDOW is always non-nil.
author Kenichi Handa <handa@m17n.org>
date Wed, 14 May 2008 01:56:07 +0000
parents 81ec00f72dc6
children 442dd15b3a1d
files lisp/composite.el
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/composite.el	Wed May 14 01:55:46 2008 +0000
+++ b/lisp/composite.el	Wed May 14 01:56:07 2008 +0000
@@ -341,7 +341,7 @@
 	pattern func result)
     (or limit
 	(setq limit (if (stringp object) (length object) (point-max))))
-    (when tail
+    (when (and font-obj tail)
       (save-match-data
 	(save-excursion
 	  (while tail
@@ -495,9 +495,8 @@
 		  (let* ((ch (aref string from))
 			 (elt (aref table ch))
 			 font-obj newpos)
-		    (when elt
-		      (if window
-			  (setq font-obj (font-at from window string)))
+		    (when (and elt
+			       (setq font-obj (font-at from window string)))
 		      (if (functionp elt)
 			  (setq newpos (funcall elt from to font-obj string))
 			(while (and elt
@@ -517,9 +516,8 @@
 		  (let* ((ch (char-after from))
 			 (elt (aref table ch))
 			 func pattern font-obj newpos)
-		    (when elt
-		      (if window
-			  (setq font-obj (font-at from window)))
+		    (when (and elt
+			       (setq font-obj (font-at from window)))
 		      (if (functionp elt)
 			  (setq newpos (funcall elt from to font-obj nil))
 			(goto-char from)
@@ -659,7 +657,7 @@
 		(font-obj (and (display-multi-font-p)
 			       (font-at (point) (selected-window))))
 		(pos (point)))
-	    (if (functionp func)
+	    (if (and (functionp func) font-obj)
 		(goto-char (funcall func (point) to font-obj nil)))
 	    (if (<= (point) pos)
 		(forward-char 1)))))