changeset 71500:fd5f866a10be

(mac-handle-font-selection): Change keys of mac-atsu-font-table from strings to numbers. (mac-ts-caret-position): Use also when cursor-type is nil. (mac-ts-update-active-input-area): Add Mac OS Classic support. Relax condition for using overlay strings. Use mac-ts-caret-position face when cursor-type is nil.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Wed, 28 Jun 2006 08:28:38 +0000
parents 51f7fe4f6552
children 021c1400e746
files lisp/term/mac-win.el
diffstat 1 files changed, 17 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/mac-win.el	Wed Jun 28 00:02:57 2006 +0000
+++ b/lisp/term/mac-win.el	Wed Jun 28 08:28:38 2006 +0000
@@ -1784,7 +1784,7 @@
   (interactive "e")
   (let* ((ae (mac-event-ae event))
 	 (fm-font-size (mac-ae-number ae "fmsz"))
-	 (atsu-font-id (cdr (mac-ae-parameter ae "auid")))
+	 (atsu-font-id (mac-ae-number ae "auid"))
 	 (attribute-values (gethash atsu-font-id mac-atsu-font-table)))
     (if fm-font-size
 	(setq attribute-values
@@ -1815,8 +1815,8 @@
 (defface mac-ts-caret-position
   '((t :inverse-video t))
   "Face for caret position in Mac TSM active input area.
-This is used only when the active input area is displayed in the
-echo area."
+This is used when the active input area is displayed either in
+the echo area or in a buffer where the cursor is not displayed."
   :group 'mac)
 
 (defface mac-ts-raw-text
@@ -1963,7 +1963,10 @@
 either in the current buffer or in the echo area."
   (interactive "e")
   (let* ((ae (mac-event-ae event))
-	 (text (or (cdr (mac-ae-parameter ae "tstx" "utxt")) ""))
+	 (type-text (mac-ae-parameter ae "tstx"))
+	 (text (or (cdr type-text) ""))
+	 (decode-fun (if (equal (car type-text) "TEXT")
+			 'mac-TEXT-to-string 'mac-utxt-to-string))
 	 (script-language (mac-ae-script-language ae "tssl"))
 	 (coding (or (cdr (assq (car script-language)
 				mac-script-code-coding-systems))
@@ -1985,22 +1988,27 @@
 	   (or isearch-mode
 	       (and cursor-in-echo-area (current-message))
 	       ;; Overlay strings are not shown in some cases.
-	       (get-char-property (point) 'display)
 	       (get-char-property (point) 'invisible)
-	       (get-char-property (point) 'composition)))
+	       (and (not (bobp))
+		    (or (and (get-char-property (point) 'display)
+			     (eq (get-char-property (1- (point)) 'display)
+				 (get-char-property (point) 'display)))
+			(and (get-char-property (point) 'composition)
+			     (eq (get-char-property (1- (point)) 'composition)
+				 (get-char-property (point) 'composition)))))))
 	  active-input-string caret-seen)
       ;; Decode the active input area text with inheriting faces and
       ;; the caret position.
       (setq active-input-string
 	    (mapconcat
 	     (lambda (str)
-	       (let ((decoded (mac-utxt-to-string str coding)))
+	       (let ((decoded (funcall decode-fun str coding)))
 		 (put-text-property 0 (length decoded) 'face
 				    (get-text-property 0 'face str) decoded)
 		 (when (and (not caret-seen)
 			    (get-text-property 0 'cursor str))
 		   (setq caret-seen t)
-		   (if use-echo-area
+		   (if (or use-echo-area (null cursor-type))
 		       (put-text-property 0 1 'face 'mac-ts-caret-position
 					  decoded)
 		     (put-text-property 0 1 'cursor t decoded)))
@@ -2030,7 +2038,7 @@
       ;; macro being defined.
       (apply 'isearch-unread
 	     (append (mac-replace-untranslated-utf-8-chars
-		      (mac-utxt-to-string confirmed coding)) '())))
+		      (funcall decode-fun confirmed coding)) '())))
     ;; The event is successfully processed.  Sync the sequence number.
     (setq mac-ts-update-active-input-area-seqno (1+ seqno))))