changeset 91152:6a5d0cc191af

(auto-compose-chars): Argument font-object changed to window.
author Kenichi Handa <handa@m17n.org>
date Sat, 01 Dec 2007 04:19:31 +0000
parents 6120724e072b
children e89e6dacdffa
files lisp/composite.el
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/composite.el	Sat Dec 01 04:18:25 2007 +0000
+++ b/lisp/composite.el	Sat Dec 01 04:19:31 2007 +0000
@@ -470,11 +470,11 @@
 (defvar auto-compose-current-font nil
   "The current font-object used for characters being composed automatically.")
 
-(defun auto-compose-chars (pos string font-object)
+(defun auto-compose-chars (pos string window)
   "Compose characters after the buffer position POS.
 If STRING is non-nil, it is a string, and POS is an index into the string.
 In that case, compose characters in the string.
-FONT-OBJECT is a font selected for the character at POS.
+WINDOW is a window displaying the current buffer.
 
 This function is the default value of `auto-composition-function' (which see)."
   (save-buffer-state nil
@@ -483,10 +483,10 @@
 	(condition-case nil
 	    (let ((start pos)
 		  (limit (if string (length string) (point-max)))
-		  (auto-compose-current-font font-object)
 		  (table (if (display-graphic-p)
 			     composition-function-table
 			   terminal-composition-function-table))
+		  auto-compose-current-font
 		  ch func newpos)
 	      (setq limit
 		    (or (text-property-any pos limit 'auto-composed t string)
@@ -500,6 +500,9 @@
 				(throw 'tag (1+ pos)))
 			    (setq func (aref table ch))
 			    (if (and (functionp func)
+				     (setq auto-compose-current-font
+					   (and window
+						(font-at pos window string)))
 				     (setq newpos (funcall func pos string))
 				     (> newpos pos))
 				(setq pos newpos)
@@ -510,6 +513,8 @@
 			      (throw 'tag (1+ pos)))
 			  (setq func (aref table ch))
 			  (if (and (functionp func)
+				   (setq auto-compose-current-font
+					 (and window (font-at pos window)))
 				   (setq newpos (funcall func pos string))
 				   (> newpos pos))
 			      (setq pos newpos)