Commit 05d3aeb0 authored by YAMAMOTO Mitsuharu's avatar YAMAMOTO Mitsuharu
Browse files

(mac-text-encoding-ascii): New constant.

(mac-utxt-to-string): Use it.
(mac-ts-update-active-input-area): Use mac-ae-number.
parent 2d4a5c50
......@@ -1249,6 +1249,9 @@ correspoinding TextEncodingBase value."
;;;; Conversion between common flavors and Lisp string.
(defconst mac-text-encoding-ascii #x600
"ASCII text encoding.")
(defconst mac-text-encoding-mac-japanese-basic-variant #x20001
"MacJapanese text encoding without Apple double-byte extensions.")
......@@ -1269,7 +1272,7 @@ correspoinding TextEncodingBase value."
(if (string-match "[\xa0\xfd-\xff]" str)
(setq str nil)
;; ASCII-only?
(unless (string-match "\\`[[:ascii:]]*\\'" str)
(unless (mac-code-convert-string data nil mac-text-encoding-ascii)
(subst-char-in-string ?\x5c ?\(J\(B str t)
(subst-char-in-string ?\x80 ?\\ str t)))))
(or str
......@@ -1965,8 +1968,7 @@ either in the current buffer or in the echo area."
(coding (or (cdr (assq (car script-language)
(fix-len (mac-bytes-to-integer
(cdr (mac-ae-parameter ae "tsfx" "long"))))
(fix-len (mac-ae-number ae "tsfx"))
;; Optional parameters
(hilite-rng (mac-ae-text-range-array ae "tshi"))
(update-rng (mac-ae-text-range-array ae "tsup"))
......@@ -2008,15 +2010,15 @@ either in the current buffer or in the echo area."
(put-text-property 0 (length active-input-string)
'mac-ts-active-input-string t active-input-string)
(if use-echo-area
(let (msg message-log-max)
(if (and (current-message)
(let ((msg (current-message))
(if (and msg
;; Don't get confused by previously displayed
;; `active-input-string'.
(null (get-text-property 0 'mac-ts-active-input-string
(setq msg (propertize (current-message) 'display
(concat (current-message)
(setq msg (propertize msg 'display
(concat msg active-input-string)))
(setq msg active-input-string))
(message "%s" msg)
(overlay-put mac-ts-active-input-overlay 'before-string nil))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment