[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/term/mac-win.el,v
From: |
YAMAMOTO Mitsuharu |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/term/mac-win.el,v |
Date: |
Mon, 25 Dec 2006 08:18:18 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: YAMAMOTO Mitsuharu <mituharu> 06/12/25 08:18:17
Index: mac-win.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/mac-win.el,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -b -r1.82 -r1.83
--- mac-win.el 15 Dec 2006 08:04:47 -0000 1.82
+++ mac-win.el 25 Dec 2006 08:18:17 -0000 1.83
@@ -1964,6 +1964,22 @@
(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 @@
(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 @@
(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]