Adjust Courier font specifications in x-fixed-font-alist.
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sat, 25 Mar 2006 07:40:46 +0000 (07:40 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sat, 25 Mar 2006 07:40:46 +0000 (07:40 +0000)
(mac-select-convert-to-string): Use utf-16be-mac or utf-16le-mac
when directly encoding to UTF-16 in native byte order, no BOM.

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

index d268e0a..d4196ab 100644 (file)
@@ -1,3 +1,13 @@
+2006-03-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * frame.el (select-frame-by-name): Call x-focus-frame also when
+       window-system is mac.
+
+       * term/mac-win.el: Adjust Courier font specifications in
+       x-fixed-font-alist.
+       (mac-select-convert-to-string): Use utf-16be-mac or utf-16le-mac
+       when directly encoding to UTF-16 in native byte order, no BOM.
+
 2006-03-25  Kim F. Storm  <storm@cua.dk>
 
        * emulation/cua-base.el (cua-rectangle-mark-key): New defcustom.
index 4ccb017..38795d3 100644 (file)
@@ -1336,7 +1336,8 @@ in `selection-converter-alist', which see."
              (setq str (or s
                            (encode-coding-string str
                                                  (if (eq (byteorder) ?B)
-                                                     'utf-16be 'utf-16le))))))
+                                                     'utf-16be-mac
+                                                   'utf-16le-mac))))))
           ((eq type 'com.apple.traditional-mac-plain-text)
            (let ((encodables (find-coding-systems-string str))
                  (rest mac-script-code-coding-systems))
@@ -1896,6 +1897,22 @@ It returns a name of the created fontset."
     (fontset-add-mac-fonts fontset t)
     fontset))
 
+;; Adjust Courier font specifications in x-fixed-font-alist.
+(let ((courier-fonts (assoc "Courier" x-fixed-font-alist)))
+  (if courier-fonts
+      (dolist (label-fonts (cdr courier-fonts))
+       (setcdr label-fonts
+               (mapcar
+                (lambda (font)
+                  (if (string-match "\\`-adobe-courier-\\([^-]*\\)-\\(.\\)-\\(.*\\)-iso8859-1\\'" font)
+                      (replace-match
+                       (if (string= (match-string 2 font) "o")
+                           "-*-courier-\\1-i-\\3-*-*"
+                         "-*-courier-\\1-\\2-\\3-*-*")
+                       t nil font)
+                    font))
+                (cdr label-fonts))))))
+
 ;; Setup the default fontset.
 (setup-default-fontset)
 (cond ((x-list-fonts "*-iso10646-1")