]> git.eshelyaron.com Git - emacs.git/commitdiff
(mac-keyboard-translate-char, mac-unread-string):
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Mon, 25 Dec 2006 08:18:29 +0000 (08:18 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Mon, 25 Dec 2006 08:18:29 +0000 (08:18 +0000)
New functions.
(mac-ts-update-active-input-area, mac-ts-unicode-for-key-event):
Use mac-unread-string.

lisp/ChangeLog
lisp/term/mac-win.el

index c53ee6c16a1e7eaa2e48552d86bb085b00173016..68112e035687e556d3e7f5844840b8c2f52a497b 100644 (file)
@@ -1,3 +1,16 @@
+2006-12-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * startup.el: (fancy-splash-last-input-event): New variable.
+       (fancy-splash-special-event-action): New function.
+       (fancy-splash-screens): Temporarily bind special events to it.
+       Execute command for saved special event before exiting from
+       recursive editing.
+
+       * term/mac-win.el: (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.
+
 2006-12-24  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
 
        * textmodes/fill.el (fill-comment-paragraph): Prevent the use of
index cba4985ccb34873257a03cf13d08562f450244d4..d9454a0499e1e444e7a78cb77c3d493f8849455b 100644 (file)
@@ -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]