aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-06-28 08:28:38 +0000
committerYAMAMOTO Mitsuharu2006-06-28 08:28:38 +0000
commitf9b6d85f7668fc3ead1fb05cccb5cee30c922d5a (patch)
tree4976b4f362ef9525459c42c7be5768ca55c98482
parent506d2f9a542b2dcdc4dc918abd0524f29e22a2a6 (diff)
downloademacs-f9b6d85f7668fc3ead1fb05cccb5cee30c922d5a.tar.gz
emacs-f9b6d85f7668fc3ead1fb05cccb5cee30c922d5a.zip
(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.
-rw-r--r--lisp/term/mac-win.el26
1 files changed, 17 insertions, 9 deletions
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 7ab9ac9481f..f1f66b1d4df 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1784,7 +1784,7 @@ With numeric ARG, display the font panel if and only if ARG is positive."
1784 (interactive "e") 1784 (interactive "e")
1785 (let* ((ae (mac-event-ae event)) 1785 (let* ((ae (mac-event-ae event))
1786 (fm-font-size (mac-ae-number ae "fmsz")) 1786 (fm-font-size (mac-ae-number ae "fmsz"))
1787 (atsu-font-id (cdr (mac-ae-parameter ae "auid"))) 1787 (atsu-font-id (mac-ae-number ae "auid"))
1788 (attribute-values (gethash atsu-font-id mac-atsu-font-table))) 1788 (attribute-values (gethash atsu-font-id mac-atsu-font-table)))
1789 (if fm-font-size 1789 (if fm-font-size
1790 (setq attribute-values 1790 (setq attribute-values
@@ -1815,8 +1815,8 @@ With numeric ARG, display the font panel if and only if ARG is positive."
1815(defface mac-ts-caret-position 1815(defface mac-ts-caret-position
1816 '((t :inverse-video t)) 1816 '((t :inverse-video t))
1817 "Face for caret position in Mac TSM active input area. 1817 "Face for caret position in Mac TSM active input area.
1818This is used only when the active input area is displayed in the 1818This is used when the active input area is displayed either in
1819echo area." 1819the echo area or in a buffer where the cursor is not displayed."
1820 :group 'mac) 1820 :group 'mac)
1821 1821
1822(defface mac-ts-raw-text 1822(defface mac-ts-raw-text
@@ -1963,7 +1963,10 @@ into `unread-command-events'. The unconfirmed text is displayed
1963either in the current buffer or in the echo area." 1963either in the current buffer or in the echo area."
1964 (interactive "e") 1964 (interactive "e")
1965 (let* ((ae (mac-event-ae event)) 1965 (let* ((ae (mac-event-ae event))
1966 (text (or (cdr (mac-ae-parameter ae "tstx" "utxt")) "")) 1966 (type-text (mac-ae-parameter ae "tstx"))
1967 (text (or (cdr type-text) ""))
1968 (decode-fun (if (equal (car type-text) "TEXT")
1969 'mac-TEXT-to-string 'mac-utxt-to-string))
1967 (script-language (mac-ae-script-language ae "tssl")) 1970 (script-language (mac-ae-script-language ae "tssl"))
1968 (coding (or (cdr (assq (car script-language) 1971 (coding (or (cdr (assq (car script-language)
1969 mac-script-code-coding-systems)) 1972 mac-script-code-coding-systems))
@@ -1985,22 +1988,27 @@ either in the current buffer or in the echo area."
1985 (or isearch-mode 1988 (or isearch-mode
1986 (and cursor-in-echo-area (current-message)) 1989 (and cursor-in-echo-area (current-message))
1987 ;; Overlay strings are not shown in some cases. 1990 ;; Overlay strings are not shown in some cases.
1988 (get-char-property (point) 'display)
1989 (get-char-property (point) 'invisible) 1991 (get-char-property (point) 'invisible)
1990 (get-char-property (point) 'composition))) 1992 (and (not (bobp))
1993 (or (and (get-char-property (point) 'display)
1994 (eq (get-char-property (1- (point)) 'display)
1995 (get-char-property (point) 'display)))
1996 (and (get-char-property (point) 'composition)
1997 (eq (get-char-property (1- (point)) 'composition)
1998 (get-char-property (point) 'composition)))))))
1991 active-input-string caret-seen) 1999 active-input-string caret-seen)
1992 ;; Decode the active input area text with inheriting faces and 2000 ;; Decode the active input area text with inheriting faces and
1993 ;; the caret position. 2001 ;; the caret position.
1994 (setq active-input-string 2002 (setq active-input-string
1995 (mapconcat 2003 (mapconcat
1996 (lambda (str) 2004 (lambda (str)
1997 (let ((decoded (mac-utxt-to-string str coding))) 2005 (let ((decoded (funcall decode-fun str coding)))
1998 (put-text-property 0 (length decoded) 'face 2006 (put-text-property 0 (length decoded) 'face
1999 (get-text-property 0 'face str) decoded) 2007 (get-text-property 0 'face str) decoded)
2000 (when (and (not caret-seen) 2008 (when (and (not caret-seen)
2001 (get-text-property 0 'cursor str)) 2009 (get-text-property 0 'cursor str))
2002 (setq caret-seen t) 2010 (setq caret-seen t)
2003 (if use-echo-area 2011 (if (or use-echo-area (null cursor-type))
2004 (put-text-property 0 1 'face 'mac-ts-caret-position 2012 (put-text-property 0 1 'face 'mac-ts-caret-position
2005 decoded) 2013 decoded)
2006 (put-text-property 0 1 'cursor t decoded))) 2014 (put-text-property 0 1 'cursor t decoded)))
@@ -2030,7 +2038,7 @@ either in the current buffer or in the echo area."
2030 ;; macro being defined. 2038 ;; macro being defined.
2031 (apply 'isearch-unread 2039 (apply 'isearch-unread
2032 (append (mac-replace-untranslated-utf-8-chars 2040 (append (mac-replace-untranslated-utf-8-chars
2033 (mac-utxt-to-string confirmed coding)) '()))) 2041 (funcall decode-fun confirmed coding)) '())))
2034 ;; The event is successfully processed. Sync the sequence number. 2042 ;; The event is successfully processed. Sync the sequence number.
2035 (setq mac-ts-update-active-input-area-seqno (1+ seqno)))) 2043 (setq mac-ts-update-active-input-area-seqno (1+ seqno))))
2036 2044