aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-12-25 08:18:29 +0000
committerYAMAMOTO Mitsuharu2006-12-25 08:18:29 +0000
commit40cacec2b3ecbc6142b4f24b0870683a161a6cd2 (patch)
tree5ca14e78f611d4d450a2a0128be201959ec0b50f
parentd3f4ab736a79aa886c6f744fcbe79b04edbec01f (diff)
downloademacs-40cacec2b3ecbc6142b4f24b0870683a161a6cd2.tar.gz
emacs-40cacec2b3ecbc6142b4f24b0870683a161a6cd2.zip
(mac-keyboard-translate-char, mac-unread-string):
New functions. (mac-ts-update-active-input-area, mac-ts-unicode-for-key-event): Use mac-unread-string.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/term/mac-win.el28
2 files changed, 31 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c53ee6c16a1..68112e03568 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12006-12-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * startup.el: (fancy-splash-last-input-event): New variable.
4 (fancy-splash-special-event-action): New function.
5 (fancy-splash-screens): Temporarily bind special events to it.
6 Execute command for saved special event before exiting from
7 recursive editing.
8
9 * term/mac-win.el: (mac-keyboard-translate-char, mac-unread-string):
10 New functions.
11 (mac-ts-update-active-input-area, mac-ts-unicode-for-key-event):
12 Use mac-unread-string.
13
12006-12-24 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> 142006-12-24 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org>
2 15
3 * textmodes/fill.el (fill-comment-paragraph): Prevent the use of 16 * textmodes/fill.el (fill-comment-paragraph): Prevent the use of
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index cba4985ccb3..d9454a0499e 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1964,6 +1964,22 @@ the echo area or in a buffer where the cursor is not displayed."
1964 (mac-split-string-by-property-change string) 1964 (mac-split-string-by-property-change string)
1965 "")) 1965 ""))
1966 1966
1967(defun mac-keyboard-translate-char (ch)
1968 (if (and (char-valid-p ch)
1969 (or (char-table-p keyboard-translate-table)
1970 (and (or (stringp keyboard-translate-table)
1971 (vectorp keyboard-translate-table))
1972 (> (length keyboard-translate-table) ch))))
1973 (or (aref keyboard-translate-table ch) ch)
1974 ch))
1975
1976(defun mac-unread-string (string)
1977 ;; Unread characters and insert them in a keyboard macro being
1978 ;; defined.
1979 (apply 'isearch-unread
1980 (mapcar 'mac-keyboard-translate-char
1981 (mac-replace-untranslated-utf-8-chars string))))
1982
1967(defun mac-ts-update-active-input-area (event) 1983(defun mac-ts-update-active-input-area (event)
1968 "Update Mac TSM active input area according to EVENT. 1984 "Update Mac TSM active input area according to EVENT.
1969The confirmed text is converted to Emacs input events and pushed 1985The confirmed text is converted to Emacs input events and pushed
@@ -2042,11 +2058,7 @@ either in the current buffer or in the echo area."
2042 (point) (point) (current-buffer)) 2058 (point) (point) (current-buffer))
2043 (overlay-put mac-ts-active-input-overlay 'before-string 2059 (overlay-put mac-ts-active-input-overlay 'before-string
2044 active-input-string)) 2060 active-input-string))
2045 ;; Unread confirmed characters and insert them in a keyboard 2061 (mac-unread-string (funcall decode-fun confirmed coding)))
2046 ;; macro being defined.
2047 (apply 'isearch-unread
2048 (append (mac-replace-untranslated-utf-8-chars
2049 (funcall decode-fun confirmed coding)) '())))
2050 ;; The event is successfully processed. Sync the sequence number. 2062 ;; The event is successfully processed. Sync the sequence number.
2051 (setq mac-ts-update-active-input-area-seqno (1+ seqno)))) 2063 (setq mac-ts-update-active-input-area-seqno (1+ seqno))))
2052 2064
@@ -2059,11 +2071,7 @@ either in the current buffer or in the echo area."
2059 (coding (or (cdr (assq (car script-language) 2071 (coding (or (cdr (assq (car script-language)
2060 mac-script-code-coding-systems)) 2072 mac-script-code-coding-systems))
2061 'mac-roman))) 2073 'mac-roman)))
2062 ;; Unread characters and insert them in a keyboard macro being 2074 (mac-unread-string (mac-utxt-to-string text coding))))
2063 ;; defined.
2064 (apply 'isearch-unread
2065 (append (mac-replace-untranslated-utf-8-chars
2066 (mac-utxt-to-string text coding)) '()))))
2067 2075
2068;; kEventClassTextInput/kEventTextInputUpdateActiveInputArea 2076;; kEventClassTextInput/kEventTextInputUpdateActiveInputArea
2069(define-key mac-apple-event-map [text-input update-active-input-area] 2077(define-key mac-apple-event-map [text-input update-active-input-area]