diff options
Diffstat (limited to 'lisp/term/mac-win.el')
-rw-r--r-- | lisp/term/mac-win.el | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 43454a5ca77..f35bf080bbb 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -1,6 +1,6 @@ ;;; mac-win.el --- parse switches controlling interface with Mac window system -*-coding: iso-2022-7bit;-*- -;; Copyright (C) 1999, 2000, 2002, 2003, 2004, +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006 Free Software Foundation, Inc. ;; Author: Andrew Choi <akochoi@mac.com> @@ -82,7 +82,6 @@ (defvar mac-service-selection) (defvar mac-system-script-code) (defvar mac-apple-event-map) -(defvar mac-atsu-font-table) (defvar mac-font-panel-mode) (defvar mac-ts-active-input-overlay) (defvar x-invocation-args) @@ -1791,7 +1790,8 @@ With numeric ARG, display the font panel if and only if ARG is positive." (let* ((ae (mac-event-ae event)) (fm-font-size (mac-ae-number ae "fmsz")) (atsu-font-id (mac-ae-number ae "auid")) - (attribute-values (gethash atsu-font-id mac-atsu-font-table))) + (attribute-values (and atsu-font-id + (mac-atsu-font-face-attributes atsu-font-id)))) (if fm-font-size (setq attribute-values `(:height ,(* 10 fm-font-size) ,@attribute-values))) @@ -1964,6 +1964,22 @@ the echo area or in a buffer where the cursor is not displayed." (mac-split-string-by-property-change string) "")) +(defun mac-keyboard-translate-char (ch) + (if (and (char-valid-p ch) + (or (char-table-p keyboard-translate-table) + (and (or (stringp keyboard-translate-table) + (vectorp keyboard-translate-table)) + (> (length keyboard-translate-table) ch)))) + (or (aref keyboard-translate-table ch) ch) + ch)) + +(defun mac-unread-string (string) + ;; Unread characters and insert them in a keyboard macro being + ;; defined. + (apply 'isearch-unread + (mapcar 'mac-keyboard-translate-char + (mac-replace-untranslated-utf-8-chars string)))) + (defun mac-ts-update-active-input-area (event) "Update Mac TSM active input area according to EVENT. The confirmed text is converted to Emacs input events and pushed @@ -2042,11 +2058,7 @@ either in the current buffer or in the echo area." (point) (point) (current-buffer)) (overlay-put mac-ts-active-input-overlay 'before-string active-input-string)) - ;; Unread confirmed characters and insert them in a keyboard - ;; macro being defined. - (apply 'isearch-unread - (append (mac-replace-untranslated-utf-8-chars - (funcall decode-fun confirmed coding)) '()))) + (mac-unread-string (funcall decode-fun confirmed coding))) ;; The event is successfully processed. Sync the sequence number. (setq mac-ts-update-active-input-area-seqno (1+ seqno)))) @@ -2059,11 +2071,7 @@ either in the current buffer or in the echo area." (coding (or (cdr (assq (car script-language) mac-script-code-coding-systems)) 'mac-roman))) - ;; Unread characters and insert them in a keyboard macro being - ;; defined. - (apply 'isearch-unread - (append (mac-replace-untranslated-utf-8-chars - (mac-utxt-to-string text coding)) '())))) + (mac-unread-string (mac-utxt-to-string text coding)))) ;; kEventClassTextInput/kEventTextInputUpdateActiveInputArea (define-key mac-apple-event-map [text-input update-active-input-area] @@ -2459,7 +2467,7 @@ It returns a name of the created fontset." ;; Setup the default fontset. (setup-default-fontset) -(cond ((x-list-fonts "*-iso10646-1") +(cond ((x-list-fonts "*-iso10646-1" nil nil 1) ;; Use ATSUI (if available) for the following charsets. (dolist (charset '(latin-iso8859-1 @@ -2471,7 +2479,7 @@ It returns a name of the created fontset." vietnamese-viscii-lower vietnamese-viscii-upper lao ethiopic tibetan)) (set-fontset-font nil charset '(nil . "iso10646-1")))) - ((null (x-list-fonts "*-iso8859-1")) + ((null (x-list-fonts "*-iso8859-1" nil nil 1)) ;; Add Mac-encoding fonts unless ETL fonts are installed. (fontset-add-mac-fonts "fontset-default"))) |