changeset 83291:bbf359ec4a59

Merged from miles@gnu.org--gnu-2005 (patch 269) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-269 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-331
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 25 Apr 2005 11:47:55 +0000
parents 042f282a2ed7 (current diff) f571b77284ff (diff)
children ad07ff6e4555
files lisp/ChangeLog lisp/bindings.el lisp/simple.el lisp/subr.el lispref/ChangeLog man/ChangeLog src/lisp.h src/macterm.c src/xdisp.c src/xfaces.c
diffstat 26 files changed, 792 insertions(+), 807 deletions(-) [+]
line wrap: on
line diff
--- a/admin/ChangeLog	Tue Apr 19 13:33:31 2005 +0000
+++ b/admin/ChangeLog	Mon Apr 25 11:47:55 2005 +0000
@@ -1,3 +1,7 @@
+2005-04-19  Lute Kamstra  <lute@gnu.org>
+
+	* make-tarball.txt: Don't commit lisp/loaddefs.el.
+
 2005-04-14  Lute Kamstra  <lute@gnu.org>
 
 	* nt/makedist.bat (elfiles): Update.
--- a/admin/make-tarball.txt	Tue Apr 19 13:33:31 2005 +0000
+++ b/admin/make-tarball.txt	Mon Apr 25 11:47:55 2005 +0000
@@ -21,10 +21,11 @@
 
 5.   rm configure; make bootstrap
 
-6.  Commit configure, README, AUTHORS, lisp/loaddefs.el,
-    lisp/cus-load.el, lisp/finder-inf.el, lisp/version.el,
-    man/emacs.texi.  For a release, also commit the ChangeLog files in
-    all directories.
+6.  Commit configure, README, AUTHORS, lisp/cus-load.el,
+    lisp/finder-inf.el, lisp/version.el, man/emacs.texi.
+    Copy lisp/loaddefs.el to lisp/ldefs-boot.el and commit
+    lisp/ldefs-boot.el.  For a release, also commit the ChangeLog
+    files in all directories.
 
 7.   make-dist --snapshot.  Check the contents of the new tar with
      admin/diff-tar-files against an older tar file.  Some old pretest
@@ -34,12 +35,12 @@
 8.   xdelta delta emacs-OLD.tar.gz emacs-NEW.tar.gz emacs-OLD-NEW.xdelta
 
 9.   tar -zxf emacs-NEW.tar.gz; cd emacs-NEW
-     configure && make && make -n install
+     ./configure && make && make -n install
     Use `script' or M-x compile to save the compilation log in
     compile-NEW.log and compare it against an old one.  The easiest way
     to do that is to visit the old log in Emacs, change the version
     number of the old Emacs to __, do the same with the new log and do
-    M-x ediff. Especially check that Info files aren't built.
+    M-x ediff.  Especially check that Info files aren't built.
 
 10.  cd EMACS_ROOT_DIR; cvs tag TAG
     TAG is EMACS_PRETEST_XX_YY_ZZZ for a pretest, EMACS_XX_YY for a
--- a/etc/NEWS	Tue Apr 19 13:33:31 2005 +0000
+++ b/etc/NEWS	Mon Apr 25 11:47:55 2005 +0000
@@ -142,7 +142,11 @@
 M-o M-o requests refontification.
 
 +++
-** M-g is now a prefix key.  M-g g and M-g M-g run goto-line.
+** M-g is now a prefix key.
+
+M-g g and M-g M-g run goto-line.
+M-g n and M-g M-n run next-error (like C-x `).
+M-g p and M-g M-p run previous-error.
 
 +++
 ** font-lock-lines-before specifies a number of lines before the
@@ -309,8 +313,9 @@
 in the current input method to input a character at point.
 
 +++
-** Convenient commands to switch buffers in a cyclic order are C-x <left>
-(prev-buffer) and C-x <right> (next-buffer).
+** You can now switch buffers in a cyclic order with C-x C-left and
+(prev-buffer) and C-x C-right (next-buffer).  C-x left and C-x right
+can be used as well.
 
 ---
 ** Commands winner-redo and winner-undo, from winner.el, are now bound to
@@ -4190,9 +4195,15 @@
 specified) window as a string with or without text properties.
 
 +++
-** New function safe-plist-get.
-
-This function is like plist-get, but never signals an error for
+** New function `safe-get'.
+
+This function is like `get', but never signals an error for
+a malformed symbol property list.
+
++++
+** New function `safe-plist-get'.
+
+This function is like `plist-get', but never signals an error for
 a malformed property list.
 
 +++
--- a/lisp/ChangeLog	Tue Apr 19 13:33:31 2005 +0000
+++ b/lisp/ChangeLog	Mon Apr 25 11:47:55 2005 +0000
@@ -1,3 +1,53 @@
+2005-04-20  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el (mac-symbol-encoder): Fix mappings of left and
+	right angle brackets.
+
+2005-04-20  Nick Roberts  <nickrob@snap.net.nz>
+
+	* tooltip.el (tooltip-use-echo-area): Replace as alias and deprecate.
+
+2005-04-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/flymake.el (flymake-get-absolute-file-name-basedir):
+	Remove.  Update callers to use expand-file-name instead.
+
+	* subr.el (syntax-class): New function.
+
+	* simple.el (blink-matching-open): Use it.
+
+	* paren.el (show-paren-function): Use it to recognize parens that are
+	also used in 2-char comment markers.
+
+2005-04-19  Lute Kamstra  <lute@gnu.org>
+
+	* loadhist.el (unload-feature): Update for new format of
+	load-history.  Simplify the code.
+
+2005-04-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* term/mac-win.el: Add coding: tag and set it to iso-2022-7bit.
+	(mac-add-charset-info): New function.  Initialize variable
+	mac-charset-info-alist using it.
+	(mac-centraleurroman, mac-cyrillic): Do not use UCS in table data
+	for translation.
+	(mac-symbol-encoder, mac-dingbats-encoder): New translation table.
+	(mac-font-encoder-list): Add entries for mac-symbol and mac-dingbats.
+	(ccl-encode-mac-symbol-font, ccl-encode-mac-dingbats-font):
+	New CCL programs.
+
+2005-04-19  Kim F. Storm  <storm@cua.dk>
+
+	* simple.el (next-buffer, prev-buffer, next-error)
+	(scroll-other-window, keyboard-quit, keyboard-escape-quit)
+	(clone-indirect-buffer-other-window): Move bindings to bindings.el.
+
+	* bindings.el (next-buffer, prev-buffer, next-error)
+	(scroll-other-window, keyboard-quit, keyboard-escape-quit)
+	(clone-indirect-buffer-other-window): Move bindings from simple.el.
+	(next-buffer, prev-buffer): Add C-x C-right and C-x C-left bindings.
+	(next-error, previous-error): Add M-g M-n/n and M-g M-p/p bindings.
+
 2005-04-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* isearch.el (isearch-edit-string): Make the search-ring available for
--- a/lisp/bindings.el	Tue Apr 19 13:33:31 2005 +0000
+++ b/lisp/bindings.el	Mon Apr 25 11:47:55 2005 +0000
@@ -628,6 +628,10 @@
 ;; (define-key ctl-x-map "n" 'narrow-to-region)
 ;; (define-key ctl-x-map "w" 'widen)
 
+;; Quitting
+(define-key global-map "\e\e\e" 'keyboard-escape-quit)
+(define-key global-map "\C-g" 'keyboard-quit)
+
 (define-key global-map "\C-j" 'newline-and-indent)
 (define-key global-map "\C-m" 'newline)
 (define-key global-map "\C-o" 'open-line)
@@ -652,9 +656,18 @@
 ;; Many people are used to typing C-/ on X terminals and getting C-_.
 (define-key global-map [?\C-/] 'undo)
 (define-key global-map "\C-_" 'undo)
+;; Richard said that we should not use C-x <uppercase letter> and I have
+;; no idea whereas to bind it.  Any suggestion welcome.  -stef
+;; (define-key ctl-x-map "U" 'undo-only)
+
 (define-key esc-map "!" 'shell-command)
 (define-key esc-map "|" 'shell-command-on-region)
 
+(define-key global-map [?\C-x right] 'next-buffer)
+(define-key global-map [?\C-x C-right] 'next-buffer)
+(define-key global-map [?\C-x left] 'prev-buffer)
+(define-key global-map [?\C-x C-left] 'prev-buffer)
+
 (let ((map minibuffer-local-map))
   (define-key map "\en"   'next-history-element)
   (define-key map [next]  'next-history-element)
@@ -709,6 +722,13 @@
 (define-key esc-map "g\M-g" 'goto-line)
 (define-key esc-map "gg" 'goto-line)
 
+(define-key esc-map "gn" 'next-error)
+(define-key esc-map "g\M-n" 'next-error)
+(define-key ctl-x-map "`" 'next-error)
+
+(define-key esc-map "gp" 'previous-error)
+(define-key esc-map "g\M-p" 'previous-error)
+
 ;;(defun function-key-error ()
 ;;  (interactive)
 ;;  (error "That function key is not bound to anything"))
@@ -737,6 +757,7 @@
 (define-key global-map [C-next]		'scroll-left)
 (define-key global-map [M-next]		'scroll-other-window)
 (define-key global-map [M-prior]	'scroll-other-window-down)
+(define-key esc-map [?\C-\S-v]		'scroll-other-window-down)
 (define-key global-map [end]		'end-of-line)
 (define-key global-map [C-end]		'end-of-buffer)
 (define-key global-map [M-end]		'end-of-buffer-other-window)
@@ -1020,6 +1041,8 @@
 
 (define-key ctl-x-map "z" 'repeat)
 
+(define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window)
+
 ;; Don't look for autoload cookies in this file.
 ;; Local Variables:
 ;; no-update-autoloads: t
--- a/lisp/loadhist.el	Tue Apr 19 13:33:31 2005 +0000
+++ b/lisp/loadhist.el	Mon Apr 25 11:47:55 2005 +0000
@@ -1,6 +1,6 @@
 ;;; loadhist.el --- lisp functions for working with feature groups
 
-;; Copyright (C) 1995, 1998, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1998, 2000, 2005 Free Software Foundation, Inc.
 
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Maintainer: FSF
@@ -155,16 +155,16 @@
 in the event that the package has done something normally-ill-advised,
 such as redefining an Emacs function."
   (interactive (list (read-feature "Feature: ") current-prefix-arg))
-  (if (not (featurep feature))
-      (error "%s is not a currently loaded feature" (symbol-name feature)))
-  (if (not force)
-      (let* ((file (feature-file feature))
-	     (dependents (delete file (copy-sequence (file-dependents file)))))
-	(if dependents
-	    (error "Loaded libraries %s depend on %s"
-		   (prin1-to-string dependents) file))))
+  (unless (featurep feature)
+    (error "%s is not a currently loaded feature" (symbol-name feature)))
+  (unless force
+    (let* ((file (feature-file feature))
+	   (dependents (delete file (copy-sequence (file-dependents file)))))
+      (when dependents
+	(error "Loaded libraries %s depend on %s"
+	       (prin1-to-string dependents) file))))
   (let* ((unload-hook-features-list (feature-symbols feature))
-         (file (car unload-hook-features-list))
+         (file (pop unload-hook-features-list))
          (unload-hook (intern-soft (concat (symbol-name feature)
                                            "-unload-hook"))))
     ;; Try to avoid losing badly when hooks installed in critical
@@ -183,38 +183,39 @@
       ;; normally works.
       (mapatoms
        (lambda (x)
-         (if (or (and (boundp x)        ; Random hooks.
-                      (consp (symbol-value x))
-                      (string-match "-hooks?\\'" (symbol-name x)))
-                 (and (boundp x)       ; Known abnormal hooks etc.
-                      (memq x unload-feature-special-hooks)))
-	     (dolist (y (cdr unload-hook-features-list))
-	       (remove-hook x y))))))
-    (if (fboundp 'elp-restore-function)	; remove ELP stuff first
-	(dolist (elt (cdr unload-hook-features-list))
-	  (if (symbolp elt)
-	      (elp-restore-function elt))))
-    (dolist (x (cdr unload-hook-features-list))
-      (when (consp x)
-	;; Remove any feature names that this file provided.
-	(if (eq (car x) 'provide)
-	    (setq features (delq (cdr x) features)))
-	(when (eq (car x) 'defvar)
-	  ;; Kill local values as much as possible.
-	  (dolist (buf (buffer-list))
-	    (with-current-buffer buf
-	      (kill-local-variable (cdr x))))
-	  ;; Get rid of the default binding if we can.
-	  (unless (local-variable-if-set-p (cdr x))
-	    (makunbound (cdr x))))
-	(when (eq (car x) 'defun)
-	  (let ((fun (cdr x)))
-	    (when (fboundp fun)
-	      (if (fboundp 'ad-unadvise)
-		  (ad-unadvise fun))
-	      (fmakunbound fun)
-	      (let ((aload (get fun 'autoload)))
-		(if aload (fset fun (cons 'autoload aload)))))))))
+         (when (and (boundp x)
+		    (or (and (consp (symbol-value x)) ; Random hooks.
+			     (string-match "-hooks?\\'" (symbol-name x)))
+			(memq x unload-feature-special-hooks)))	; Known abnormal hooks etc.
+	   (dolist (y unload-hook-features-list)
+	     (when (eq (car-safe y) 'defun)
+	       (remove-hook x (cdr y))))))))
+    (when (fboundp 'elp-restore-function) ; remove ELP stuff first
+      (dolist (elt unload-hook-features-list)
+	(when (symbolp elt)
+	  (elp-restore-function elt))))
+    (dolist (x unload-hook-features-list)
+      (if (consp x)
+	  (progn
+	    ;; Remove any feature names that this file provided.
+	    (when (eq (car x) 'provide)
+	      (setq features (delq (cdr x) features)))
+	    (when (eq (car x) 'defun)
+	      (let ((fun (cdr x)))
+		(when (fboundp fun)
+		  (when (fboundp 'ad-unadvise)
+		    (ad-unadvise fun))
+		  (fmakunbound fun)
+		  (let ((aload (get fun 'autoload)))
+		    (when aload 
+		      (fset fun (cons 'autoload aload))))))))
+	;; Kill local values as much as possible.
+	(dolist (buf (buffer-list))
+	  (with-current-buffer buf
+	    (kill-local-variable x)))
+	;; Get rid of the default binding if we can.
+	(unless (local-variable-if-set-p x)
+	  (makunbound x))))
     ;; Delete the load-history element for this file.
     (let ((elt (assoc file load-history)))
       (setq load-history (delq elt load-history)))))
--- a/lisp/paren.el	Tue Apr 19 13:33:31 2005 +0000
+++ b/lisp/paren.el	Mon Apr 25 11:47:55 2005 +0000
@@ -1,6 +1,6 @@
 ;;; paren.el --- highlight matching paren
 
-;; Copyright (C) 1993, 1996, 2001, 2004  Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1996, 2001, 2004, 2005  Free Software Foundation, Inc.
 
 ;; Author: rms@gnu.org
 ;; Maintainer: FSF
@@ -139,8 +139,8 @@
 (defun show-paren-function ()
   (if show-paren-mode
       (let ((oldpos (point))
-	    (dir (cond ((eq (car (syntax-after (1- (point)))) 5) -1)
-		       ((eq (car (syntax-after (point))) 4) 1)))
+	    (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1)
+                       ((eq (syntax-class (syntax-after (point)))      4) 1)))
 	    pos mismatch face)
 	;;
 	;; Find the other end of the sexp.
@@ -169,7 +169,7 @@
 	      ;; kind of paren to match the one we started at.
 	      (when (integerp pos)
 		(let ((beg (min pos oldpos)) (end (max pos oldpos)))
-		  (unless (eq (car (syntax-after beg)) 8) ;Not syntax `$'.
+		  (unless (eq (syntax-class (syntax-after beg)) 8)
 		    (setq mismatch
 			  (not (or (eq (char-before end)
 				       ;; This can give nil.
--- a/lisp/progmodes/flymake.el	Tue Apr 19 13:33:31 2005 +0000
+++ b/lisp/progmodes/flymake.el	Mon Apr 25 11:47:55 2005 +0000
@@ -1765,7 +1765,7 @@
 	       (this-real-name  (nth 1 (nth (1- file-count) files))))
 	  ;;+(flymake-log 0 "this-dir=%s this-file=%s this-real=%s msg-file=%s" this-dir this-file this-real-name file-name-from-err-msg)
 	  (when (and this-dir this-file (flymake-same-files
-					 (flymake-get-absolute-file-name-basedir file-name-from-err-msg this-dir)
+					 (expand-file-name file-name-from-err-msg this-dir)
 					 this-file))
 	    (setq real-name this-real-name)))
 	(setq file-count (1- file-count)))
@@ -1778,18 +1778,13 @@
 	(setq real-name file-name-from-err-msg)
       (let* ((base-dirs-count  (length base-dirs)))
 	(while (and (not real-name) (> base-dirs-count 0))
-	  (let* ((full-name (flymake-get-absolute-file-name-basedir file-name-from-err-msg
-								    (nth (1- base-dirs-count) base-dirs))))
+	  (let* ((full-name (expand-file-name file-name-from-err-msg
+					      (nth (1- base-dirs-count) base-dirs))))
 	    (if (file-exists-p full-name)
 		(setq real-name full-name))
 	    (setq base-dirs-count (1- base-dirs-count))))))
     real-name))
 
-(defun flymake-get-absolute-file-name-basedir (file-name dir-name)
-  (if (file-name-absolute-p file-name)
-      file-name
-    (concat dir-name "/" file-name)))
-
 (defun flymake-init-find-buildfile-dir (buffer source-file-name buildfile-name)
   "Find buildfile, store its dir in buffer data and return its dir, if found."
   (let* ((buildfile-dir  (flymake-find-buildfile buildfile-name
--- a/lisp/simple.el	Tue Apr 19 13:33:31 2005 +0000
+++ b/lisp/simple.el	Mon Apr 25 11:47:55 2005 +0000
@@ -51,8 +51,6 @@
   "Highlight (un)matching of parens and expressions."
   :group 'matching)
 
-(define-key global-map [?\C-x right] 'next-buffer)
-(define-key global-map [?\C-x left] 'prev-buffer)
 (defun next-buffer ()
   "Switch to the next buffer in cyclic order."
   (interactive)
@@ -258,8 +256,6 @@
 (defalias 'goto-next-locus 'next-error)
 (defalias 'next-match 'next-error)
 
-(define-key ctl-x-map "`" 'next-error)
-
 (defun previous-error (&optional n)
   "Visit previous next-error message and corresponding source code.
 
@@ -1398,9 +1394,6 @@
 Contrary to `undo', this will not redo a previous undo."
   (interactive "*p")
   (let ((undo-no-redo t)) (undo arg)))
-;; Richard said that we should not use C-x <uppercase letter> and I have
-;; no idea whereas to bind it.  Any suggestion welcome.  -stef
-;; (define-key ctl-x-map "U" 'undo-only)
 
 (defvar undo-in-progress nil
   "Non-nil while performing an undo.
@@ -3635,7 +3628,6 @@
    (if (eq lines '-) nil
      (if (null lines) '-
        (- (prefix-numeric-value lines))))))
-(define-key esc-map [?\C-\S-v] 'scroll-other-window-down)
 
 (defun beginning-of-buffer-other-window (arg)
   "Move point to the beginning of the buffer in the other window.
@@ -4205,11 +4197,12 @@
 		   (setq blinkpos (scan-sexps oldpos -1)))
 	       (error nil)))
 	   (and blinkpos
-		(not (eq (car (syntax-after blinkpos)) 8)) ;Not syntax '$'.
+                ;; Not syntax '$'.
+		(not (eq (syntax-class (syntax-after blinkpos)) 8))
 		(setq matching-paren
 		      (let ((syntax (syntax-after blinkpos)))
 			(and (consp syntax)
-			     (eq (logand (car syntax) 255) 4)
+			     (eq (syntax-class syntax) 4)
 			     (cdr syntax)))
 		      mismatch
 		      (or (null matching-paren)
@@ -4279,8 +4272,6 @@
   (setq defining-kbd-macro nil)
   (signal 'quit nil))
 
-(define-key global-map "\C-g" 'keyboard-quit)
-
 (defvar buffer-quit-function nil
   "Function to call to \"quit\" the current buffer, or nil if none.
 \\[keyboard-escape-quit] calls this function when its more local actions
@@ -4323,7 +4314,6 @@
     (push 'sound sound)
     (play-sound sound)))
 
-(define-key global-map "\e\e\e" 'keyboard-escape-quit)
 
 (defcustom read-mail-command 'rmail
   "*Your preference for a mail reading package.
@@ -5116,7 +5106,6 @@
     (set-buffer buffer)
     (clone-indirect-buffer nil t norecord)))
 
-(define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window)
 
 ;;; Handling of Backspace and Delete keys.
 
--- a/lisp/subr.el	Tue Apr 19 13:33:31 2005 +0000
+++ b/lisp/subr.el	Mon Apr 25 11:47:55 2005 +0000
@@ -2298,6 +2298,10 @@
       (if (consp st) st
 	(aref (or st (syntax-table)) (char-after pos))))))
 
+(defun syntax-class (syntax)
+  "Return the syntax class part of the syntax descriptor SYNTAX."
+  (logand (car syntax) 255))
+
 (defun add-to-invisibility-spec (arg)
   "Add elements to `buffer-invisibility-spec'.
 See documentation for `buffer-invisibility-spec' for the kind of elements
--- a/lisp/term/mac-win.el	Tue Apr 19 13:33:31 2005 +0000
+++ b/lisp/term/mac-win.el	Mon Apr 25 11:47:55 2005 +0000
@@ -1,4 +1,4 @@
-;;; mac-win.el --- parse switches controlling interface with Mac window system
+;;; mac-win.el --- parse switches controlling interface with Mac window system -*-coding: iso-2022-7bit;-*-
 
 ;; Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005
 ;;   Free Software Foundation, Inc.
@@ -1105,6 +1105,31 @@
 	base
       (coding-system-change-eol-conversion base 'mac)))
   "Coding system derived from the system script code.")
+
+(defun mac-add-charset-info (xlfd-charset mac-text-encoding)
+  "Function to add character sets to display with Mac fonts.
+Creates entries in `mac-charset-info-alist'.
+XLFD-CHARSET is a string which will appear in the XLFD font name
+to identify the character set.  MAC-TEXT-ENCODING is the
+correspoinding TextEncodingBase value."
+  (add-to-list 'mac-charset-info-alist
+               (list xlfd-charset mac-text-encoding
+		     (cdr (assq mac-text-encoding
+				mac-script-code-coding-systems)))))
+
+(setq mac-charset-info-alist nil)
+(mac-add-charset-info "mac-roman" 0)
+(mac-add-charset-info "jisx0208.1983-sjis" 1)
+(mac-add-charset-info "jisx0201.1976-0" 1)
+(mac-add-charset-info "big5-0" 2)
+(mac-add-charset-info "ksc5601.1989-0" 3)
+(mac-add-charset-info "mac-cyrillic" 7)
+(mac-add-charset-info "gb2312.1980-0" 25)
+(mac-add-charset-info "mac-centraleurroman" 29)
+(mac-add-charset-info "mac-symbol" 33)
+(mac-add-charset-info "adobe-fontspecific" 33) ; for X-Symbol
+(mac-add-charset-info "mac-dingbats" 34)
+
 
 ;;;; Keyboard layout/language change events
 (defun mac-handle-language-change (event)
@@ -1166,289 +1191,105 @@
 
 (cp-make-coding-system
  mac-centraleurroman
- (apply
-  'vector
-  (mapcar
-   (lambda (c) (decode-char 'ucs c))
-   ;; mac-centraleurroman (128..255) -> UCS mapping
-   [	#x00C4	;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS
-	#x0100	;; 129:LATIN CAPITAL LETTER A WITH MACRON
-	#x0101	;; 130:LATIN SMALL LETTER A WITH MACRON
-	#x00C9	;; 131:LATIN CAPITAL LETTER E WITH ACUTE
-	#x0104	;; 132:LATIN CAPITAL LETTER A WITH OGONEK
-	#x00D6	;; 133:LATIN CAPITAL LETTER O WITH DIAERESIS
-	#x00DC	;; 134:LATIN CAPITAL LETTER U WITH DIAERESIS
-	#x00E1	;; 135:LATIN SMALL LETTER A WITH ACUTE
-	#x0105	;; 136:LATIN SMALL LETTER A WITH OGONEK
-	#x010C	;; 137:LATIN CAPITAL LETTER C WITH CARON
-	#x00E4	;; 138:LATIN SMALL LETTER A WITH DIAERESIS
-	#x010D	;; 139:LATIN SMALL LETTER C WITH CARON
-	#x0106	;; 140:LATIN CAPITAL LETTER C WITH ACUTE
-	#x0107	;; 141:LATIN SMALL LETTER C WITH ACUTE
-	#x00E9	;; 142:LATIN SMALL LETTER E WITH ACUTE
-	#x0179	;; 143:LATIN CAPITAL LETTER Z WITH ACUTE
-	#x017A	;; 144:LATIN SMALL LETTER Z WITH ACUTE
-	#x010E	;; 145:LATIN CAPITAL LETTER D WITH CARON
-	#x00ED	;; 146:LATIN SMALL LETTER I WITH ACUTE
-	#x010F	;; 147:LATIN SMALL LETTER D WITH CARON
-	#x0112	;; 148:LATIN CAPITAL LETTER E WITH MACRON
-	#x0113	;; 149:LATIN SMALL LETTER E WITH MACRON
-	#x0116	;; 150:LATIN CAPITAL LETTER E WITH DOT ABOVE
-	#x00F3	;; 151:LATIN SMALL LETTER O WITH ACUTE
-	#x0117	;; 152:LATIN SMALL LETTER E WITH DOT ABOVE
-	#x00F4	;; 153:LATIN SMALL LETTER O WITH CIRCUMFLEX
-	#x00F6	;; 154:LATIN SMALL LETTER O WITH DIAERESIS
-	#x00F5	;; 155:LATIN SMALL LETTER O WITH TILDE
-	#x00FA	;; 156:LATIN SMALL LETTER U WITH ACUTE
-	#x011A	;; 157:LATIN CAPITAL LETTER E WITH CARON
-	#x011B	;; 158:LATIN SMALL LETTER E WITH CARON
-	#x00FC	;; 159:LATIN SMALL LETTER U WITH DIAERESIS
-	#x2020	;; 160:DAGGER
-	#x00B0	;; 161:DEGREE SIGN
-	#x0118	;; 162:LATIN CAPITAL LETTER E WITH OGONEK
-	#x00A3	;; 163:POUND SIGN
-	#x00A7	;; 164:SECTION SIGN
-	#x2022	;; 165:BULLET
-	#x00B6	;; 166:PILCROW SIGN
-	#x00DF	;; 167:LATIN SMALL LETTER SHARP S
-	#x00AE	;; 168:REGISTERED SIGN
-	#x00A9	;; 169:COPYRIGHT SIGN
-	#x2122	;; 170:TRADE MARK SIGN
-	#x0119	;; 171:LATIN SMALL LETTER E WITH OGONEK
-	#x00A8	;; 172:DIAERESIS
-	#x2260	;; 173:NOT EQUAL TO
-	#x0123	;; 174:LATIN SMALL LETTER G WITH CEDILLA
-	#x012E	;; 175:LATIN CAPITAL LETTER I WITH OGONEK
-	#x012F	;; 176:LATIN SMALL LETTER I WITH OGONEK
-	#x012A	;; 177:LATIN CAPITAL LETTER I WITH MACRON
-	#x2264	;; 178:LESS-THAN OR EQUAL TO
-	#x2265	;; 179:GREATER-THAN OR EQUAL TO
-	#x012B	;; 180:LATIN SMALL LETTER I WITH MACRON
-	#x0136	;; 181:LATIN CAPITAL LETTER K WITH CEDILLA
-	#x2202	;; 182:PARTIAL DIFFERENTIAL
-	#x2211	;; 183:N-ARY SUMMATION
-	#x0142	;; 184:LATIN SMALL LETTER L WITH STROKE
-	#x013B	;; 185:LATIN CAPITAL LETTER L WITH CEDILLA
-	#x013C	;; 186:LATIN SMALL LETTER L WITH CEDILLA
-	#x013D	;; 187:LATIN CAPITAL LETTER L WITH CARON
-	#x013E	;; 188:LATIN SMALL LETTER L WITH CARON
-	#x0139	;; 189:LATIN CAPITAL LETTER L WITH ACUTE
-	#x013A	;; 190:LATIN SMALL LETTER L WITH ACUTE
-	#x0145	;; 191:LATIN CAPITAL LETTER N WITH CEDILLA
-	#x0146	;; 192:LATIN SMALL LETTER N WITH CEDILLA
-	#x0143	;; 193:LATIN CAPITAL LETTER N WITH ACUTE
-	#x00AC	;; 194:NOT SIGN
-	#x221A	;; 195:SQUARE ROOT
-	#x0144	;; 196:LATIN SMALL LETTER N WITH ACUTE
-	#x0147	;; 197:LATIN CAPITAL LETTER N WITH CARON
-	#x2206	;; 198:INCREMENT
-	#x00AB	;; 199:LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
-	#x00BB	;; 200:RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
-	#x2026	;; 201:HORIZONTAL ELLIPSIS
-	#x00A0	;; 202:NO-BREAK SPACE
-	#x0148	;; 203:LATIN SMALL LETTER N WITH CARON
-	#x0150	;; 204:LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
-	#x00D5	;; 205:LATIN CAPITAL LETTER O WITH TILDE
-	#x0151	;; 206:LATIN SMALL LETTER O WITH DOUBLE ACUTE
-	#x014C	;; 207:LATIN CAPITAL LETTER O WITH MACRON
-	#x2013	;; 208:EN DASH
-	#x2014	;; 209:EM DASH
-	#x201C	;; 210:LEFT DOUBLE QUOTATION MARK
-	#x201D	;; 211:RIGHT DOUBLE QUOTATION MARK
-	#x2018	;; 212:LEFT SINGLE QUOTATION MARK
-	#x2019	;; 213:RIGHT SINGLE QUOTATION MARK
-	#x00F7	;; 214:DIVISION SIGN
-	#x25CA	;; 215:LOZENGE
-	#x014D	;; 216:LATIN SMALL LETTER O WITH MACRON
-	#x0154	;; 217:LATIN CAPITAL LETTER R WITH ACUTE
-	#x0155	;; 218:LATIN SMALL LETTER R WITH ACUTE
-	#x0158	;; 219:LATIN CAPITAL LETTER R WITH CARON
-	#x2039	;; 220:SINGLE LEFT-POINTING ANGLE QUOTATION MARK
-	#x203A	;; 221:SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
-	#x0159	;; 222:LATIN SMALL LETTER R WITH CARON
-	#x0156	;; 223:LATIN CAPITAL LETTER R WITH CEDILLA
-	#x0157	;; 224:LATIN SMALL LETTER R WITH CEDILLA
-	#x0160	;; 225:LATIN CAPITAL LETTER S WITH CARON
-	#x201A	;; 226:SINGLE LOW-9 QUOTATION MARK
-	#x201E	;; 227:DOUBLE LOW-9 QUOTATION MARK
-	#x0161	;; 228:LATIN SMALL LETTER S WITH CARON
-	#x015A	;; 229:LATIN CAPITAL LETTER S WITH ACUTE
-	#x015B	;; 230:LATIN SMALL LETTER S WITH ACUTE
-	#x00C1	;; 231:LATIN CAPITAL LETTER A WITH ACUTE
-	#x0164	;; 232:LATIN CAPITAL LETTER T WITH CARON
-	#x0165	;; 233:LATIN SMALL LETTER T WITH CARON
-	#x00CD	;; 234:LATIN CAPITAL LETTER I WITH ACUTE
-	#x017D	;; 235:LATIN CAPITAL LETTER Z WITH CARON
-	#x017E	;; 236:LATIN SMALL LETTER Z WITH CARON
-	#x016A	;; 237:LATIN CAPITAL LETTER U WITH MACRON
-	#x00D3	;; 238:LATIN CAPITAL LETTER O WITH ACUTE
-	#x00D4	;; 239:LATIN CAPITAL LETTER O WITH CIRCUMFLEX
-	#x016B	;; 240:LATIN SMALL LETTER U WITH MACRON
-	#x016E	;; 241:LATIN CAPITAL LETTER U WITH RING ABOVE
-	#x00DA	;; 242:LATIN CAPITAL LETTER U WITH ACUTE
-	#x016F	;; 243:LATIN SMALL LETTER U WITH RING ABOVE
-	#x0170	;; 244:LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
-	#x0171	;; 245:LATIN SMALL LETTER U WITH DOUBLE ACUTE
-	#x0172	;; 246:LATIN CAPITAL LETTER U WITH OGONEK
-	#x0173	;; 247:LATIN SMALL LETTER U WITH OGONEK
-	#x00DD	;; 248:LATIN CAPITAL LETTER Y WITH ACUTE
-	#x00FD	;; 249:LATIN SMALL LETTER Y WITH ACUTE
-	#x0137	;; 250:LATIN SMALL LETTER K WITH CEDILLA
-	#x017B	;; 251:LATIN CAPITAL LETTER Z WITH DOT ABOVE
-	#x0141	;; 252:LATIN CAPITAL LETTER L WITH STROKE
-	#x017C	;; 253:LATIN SMALL LETTER Z WITH DOT ABOVE
-	#x0122	;; 254:LATIN CAPITAL LETTER G WITH CEDILLA
-	#x02C7	;; 255:CARON
-	]))
+ [?\,AD(B ?\$,1  (B ?\$,1 !(B ?\,AI(B ?\$,1 $(B ?\,AV(B ?\,A\(B ?\,Aa(B ?\$,1 %(B ?\$,1 ,(B ?\,Ad(B ?\$,1 -(B ?\$,1 &(B ?\$,1 '(B ?\,Ai(B ?\$,1!9(B
+  ?\$,1!:(B ?\$,1 .(B ?\,Am(B ?\$,1 /(B ?\$,1 2(B ?\$,1 3(B ?\$,1 6(B ?\,As(B ?\$,1 7(B ?\,At(B ?\,Av(B ?\,Au(B ?\,Az(B ?\$,1 :(B ?\$,1 ;(B ?\,A|(B
+  ?\$,1s (B ?\,A0(B ?\$,1 8(B ?\,A#(B ?\,A'(B ?\$,1s"(B ?\,A6(B ?\,A_(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1 9(B ?\,A((B ?\$,1y (B ?\$,1 C(B ?\$,1 N(B
+  ?\$,1 O(B ?\$,1 J(B ?\$,1y$(B ?\$,1y%(B ?\$,1 K(B ?\$,1 V(B ?\$,1x"(B ?\$,1x1(B ?\$,1 b(B ?\$,1 [(B ?\$,1 \(B ?\$,1 ](B ?\$,1 ^(B ?\$,1 Y(B ?\$,1 Z(B ?\$,1 e(B
+  ?\$,1 f(B ?\$,1 c(B ?\,A,(B ?\$,1x:(B ?\$,1 d(B ?\$,1 g(B ?\$,1x&(B ?\,A+(B ?\,A;(B ?\$,1s&(B ?\,A (B ?\$,1 h(B ?\$,1 p(B ?\,AU(B ?\$,1 q(B ?\$,1 l(B
+  ?\$,1rs(B ?\$,1rt(B ?\$,1r|(B ?\$,1r}(B ?\$,1rx(B ?\$,1ry(B ?\,Aw(B ?\$,2"*(B ?\$,1 m(B ?\$,1 t(B ?\$,1 u(B ?\$,1 x(B ?\$,1s9(B ?\$,1s:(B ?\$,1 y(B ?\$,1 v(B
+  ?\$,1 w(B ?\$,1! (B ?\$,1rz(B ?\$,1r~(B ?\$,1!!(B ?\$,1 z(B ?\$,1 {(B ?\,AA(B ?\$,1!$(B ?\$,1!%(B ?\,AM(B ?\$,1!=(B ?\$,1!>(B ?\$,1!*(B ?\,AS(B ?\,AT(B
+  ?\$,1!+(B ?\$,1!.(B ?\,AZ(B ?\$,1!/(B ?\$,1!0(B ?\$,1!1(B ?\$,1!2(B ?\$,1!3(B ?\,A](B ?\,A}(B ?\$,1 W(B ?\$,1!;(B ?\$,1 a(B ?\$,1!<(B ?\$,1 B(B ?\$,1$g(B]
  "Mac Central European Roman Encoding (MIME:x-mac-centraleurroman).")
 (coding-system-put 'mac-centraleurroman 'mime-charset 'x-mac-centraleurroman)
 
 (cp-make-coding-system
  mac-cyrillic
- (apply
-  'vector
-  (mapcar
-   (lambda (c) (decode-char 'ucs c))
-   ;; mac-cyrillic (128..255) -> UCS mapping
-   [	#x0410	;; 128:CYRILLIC CAPITAL LETTER A
-	#x0411	;; 129:CYRILLIC CAPITAL LETTER BE
-	#x0412	;; 130:CYRILLIC CAPITAL LETTER VE
-	#x0413	;; 131:CYRILLIC CAPITAL LETTER GHE
-	#x0414	;; 132:CYRILLIC CAPITAL LETTER DE
-	#x0415	;; 133:CYRILLIC CAPITAL LETTER IE
-	#x0416	;; 134:CYRILLIC CAPITAL LETTER ZHE
-	#x0417	;; 135:CYRILLIC CAPITAL LETTER ZE
-	#x0418	;; 136:CYRILLIC CAPITAL LETTER I
-	#x0419	;; 137:CYRILLIC CAPITAL LETTER SHORT I
-	#x041A	;; 138:CYRILLIC CAPITAL LETTER KA
-	#x041B	;; 139:CYRILLIC CAPITAL LETTER EL
-	#x041C	;; 140:CYRILLIC CAPITAL LETTER EM
-	#x041D	;; 141:CYRILLIC CAPITAL LETTER EN
-	#x041E	;; 142:CYRILLIC CAPITAL LETTER O
-	#x041F	;; 143:CYRILLIC CAPITAL LETTER PE
-	#x0420	;; 144:CYRILLIC CAPITAL LETTER ER
-	#x0421	;; 145:CYRILLIC CAPITAL LETTER ES
-	#x0422	;; 146:CYRILLIC CAPITAL LETTER TE
-	#x0423	;; 147:CYRILLIC CAPITAL LETTER U
-	#x0424	;; 148:CYRILLIC CAPITAL LETTER EF
-	#x0425	;; 149:CYRILLIC CAPITAL LETTER HA
-	#x0426	;; 150:CYRILLIC CAPITAL LETTER TSE
-	#x0427	;; 151:CYRILLIC CAPITAL LETTER CHE
-	#x0428	;; 152:CYRILLIC CAPITAL LETTER SHA
-	#x0429	;; 153:CYRILLIC CAPITAL LETTER SHCHA
-	#x042A	;; 154:CYRILLIC CAPITAL LETTER HARD SIGN
-	#x042B	;; 155:CYRILLIC CAPITAL LETTER YERU
-	#x042C	;; 156:CYRILLIC CAPITAL LETTER SOFT SIGN
-	#x042D	;; 157:CYRILLIC CAPITAL LETTER E
-	#x042E	;; 158:CYRILLIC CAPITAL LETTER YU
-	#x042F	;; 159:CYRILLIC CAPITAL LETTER YA
-	#x2020	;; 160:DAGGER
-	#x00B0	;; 161:DEGREE SIGN
-	#x0490	;; 162:CYRILLIC CAPITAL LETTER GHE WITH UPTURN
-	#x00A3	;; 163:POUND SIGN
-	#x00A7	;; 164:SECTION SIGN
-	#x2022	;; 165:BULLET
-	#x00B6	;; 166:PILCROW SIGN
-	#x0406	;; 167:CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
-	#x00AE	;; 168:REGISTERED SIGN
-	#x00A9	;; 169:COPYRIGHT SIGN
-	#x2122	;; 170:TRADE MARK SIGN
-	#x0402	;; 171:CYRILLIC CAPITAL LETTER DJE
-	#x0452	;; 172:CYRILLIC SMALL LETTER DJE
-	#x2260	;; 173:NOT EQUAL TO
-	#x0403	;; 174:CYRILLIC CAPITAL LETTER GJE
-	#x0453	;; 175:CYRILLIC SMALL LETTER GJE
-	#x221E	;; 176:INFINITY
-	#x00B1	;; 177:PLUS-MINUS SIGN
-	#x2264	;; 178:LESS-THAN OR EQUAL TO
-	#x2265	;; 179:GREATER-THAN OR EQUAL TO
-	#x0456	;; 180:CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
-	#x00B5	;; 181:MICRO SIGN
-	#x0491	;; 182:CYRILLIC SMALL LETTER GHE WITH UPTURN
-	#x0408	;; 183:CYRILLIC CAPITAL LETTER JE
-	#x0404	;; 184:CYRILLIC CAPITAL LETTER UKRAINIAN IE
-	#x0454	;; 185:CYRILLIC SMALL LETTER UKRAINIAN IE
-	#x0407	;; 186:CYRILLIC CAPITAL LETTER YI
-	#x0457	;; 187:CYRILLIC SMALL LETTER YI
-	#x0409	;; 188:CYRILLIC CAPITAL LETTER LJE
-	#x0459	;; 189:CYRILLIC SMALL LETTER LJE
-	#x040A	;; 190:CYRILLIC CAPITAL LETTER NJE
-	#x045A	;; 191:CYRILLIC SMALL LETTER NJE
-	#x0458	;; 192:CYRILLIC SMALL LETTER JE
-	#x0405	;; 193:CYRILLIC CAPITAL LETTER DZE
-	#x00AC	;; 194:NOT SIGN
-	#x221A	;; 195:SQUARE ROOT
-	#x0192	;; 196:LATIN SMALL LETTER F WITH HOOK
-	#x2248	;; 197:ALMOST EQUAL TO
-	#x2206	;; 198:INCREMENT
-	#x00AB	;; 199:LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
-	#x00BB	;; 200:RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
-	#x2026	;; 201:HORIZONTAL ELLIPSIS
-	#x00A0	;; 202:NO-BREAK SPACE
-	#x040B	;; 203:CYRILLIC CAPITAL LETTER TSHE
-	#x045B	;; 204:CYRILLIC SMALL LETTER TSHE
-	#x040C	;; 205:CYRILLIC CAPITAL LETTER KJE
-	#x045C	;; 206:CYRILLIC SMALL LETTER KJE
-	#x0455	;; 207:CYRILLIC SMALL LETTER DZE
-	#x2013	;; 208:EN DASH
-	#x2014	;; 209:EM DASH
-	#x201C	;; 210:LEFT DOUBLE QUOTATION MARK
-	#x201D	;; 211:RIGHT DOUBLE QUOTATION MARK
-	#x2018	;; 212:LEFT SINGLE QUOTATION MARK
-	#x2019	;; 213:RIGHT SINGLE QUOTATION MARK
-	#x00F7	;; 214:DIVISION SIGN
-	#x201E	;; 215:DOUBLE LOW-9 QUOTATION MARK
-	#x040E	;; 216:CYRILLIC CAPITAL LETTER SHORT U
-	#x045E	;; 217:CYRILLIC SMALL LETTER SHORT U
-	#x040F	;; 218:CYRILLIC CAPITAL LETTER DZHE
-	#x045F	;; 219:CYRILLIC SMALL LETTER DZHE
-	#x2116	;; 220:NUMERO SIGN
-	#x0401	;; 221:CYRILLIC CAPITAL LETTER IO
-	#x0451	;; 222:CYRILLIC SMALL LETTER IO
-	#x044F	;; 223:CYRILLIC SMALL LETTER YA
-	#x0430	;; 224:CYRILLIC SMALL LETTER A
-	#x0431	;; 225:CYRILLIC SMALL LETTER BE
-	#x0432	;; 226:CYRILLIC SMALL LETTER VE
-	#x0433	;; 227:CYRILLIC SMALL LETTER GHE
-	#x0434	;; 228:CYRILLIC SMALL LETTER DE
-	#x0435	;; 229:CYRILLIC SMALL LETTER IE
-	#x0436	;; 230:CYRILLIC SMALL LETTER ZHE
-	#x0437	;; 231:CYRILLIC SMALL LETTER ZE
-	#x0438	;; 232:CYRILLIC SMALL LETTER I
-	#x0439	;; 233:CYRILLIC SMALL LETTER SHORT I
-	#x043A	;; 234:CYRILLIC SMALL LETTER KA
-	#x043B	;; 235:CYRILLIC SMALL LETTER EL
-	#x043C	;; 236:CYRILLIC SMALL LETTER EM
-	#x043D	;; 237:CYRILLIC SMALL LETTER EN
-	#x043E	;; 238:CYRILLIC SMALL LETTER O
-	#x043F	;; 239:CYRILLIC SMALL LETTER PE
-	#x0440	;; 240:CYRILLIC SMALL LETTER ER
-	#x0441	;; 241:CYRILLIC SMALL LETTER ES
-	#x0442	;; 242:CYRILLIC SMALL LETTER TE
-	#x0443	;; 243:CYRILLIC SMALL LETTER U
-	#x0444	;; 244:CYRILLIC SMALL LETTER EF
-	#x0445	;; 245:CYRILLIC SMALL LETTER HA
-	#x0446	;; 246:CYRILLIC SMALL LETTER TSE
-	#x0447	;; 247:CYRILLIC SMALL LETTER CHE
-	#x0448	;; 248:CYRILLIC SMALL LETTER SHA
-	#x0449	;; 249:CYRILLIC SMALL LETTER SHCHA
-	#x044A	;; 250:CYRILLIC SMALL LETTER HARD SIGN
-	#x044B	;; 251:CYRILLIC SMALL LETTER YERU
-	#x044C	;; 252:CYRILLIC SMALL LETTER SOFT SIGN
-	#x044D	;; 253:CYRILLIC SMALL LETTER E
-	#x044E	;; 254:CYRILLIC SMALL LETTER YU
-	#x20AC	;; 255:EURO SIGN
-	]))
+ [?\$,1(0(B ?\$,1(1(B ?\$,1(2(B ?\$,1(3(B ?\$,1(4(B ?\$,1(5(B ?\$,1(6(B ?\$,1(7(B ?\$,1(8(B ?\$,1(9(B ?\$,1(:(B ?\$,1(;(B ?\$,1(<(B ?\$,1(=(B ?\$,1(>(B ?\$,1(?(B
+  ?\$,1(@(B ?\$,1(A(B ?\$,1(B(B ?\$,1(C(B ?\$,1(D(B ?\$,1(E(B ?\$,1(F(B ?\$,1(G(B ?\$,1(H(B ?\$,1(I(B ?\$,1(J(B ?\$,1(K(B ?\$,1(L(B ?\$,1(M(B ?\$,1(N(B ?\$,1(O(B
+  ?\$,1s (B ?\,A0(B ?\$,1)P(B ?\,A#(B ?\,A'(B ?\$,1s"(B ?\,A6(B ?\$,1(&(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1("(B ?\$,1(r(B ?\$,1y (B ?\$,1(#(B ?\$,1(s(B
+  ?\$,1x>(B ?\,A1(B ?\$,1y$(B ?\$,1y%(B ?\$,1(v(B ?\,A5(B ?\$,1)Q(B ?\$,1(((B ?\$,1($(B ?\$,1(t(B ?\$,1('(B ?\$,1(w(B ?\$,1()(B ?\$,1(y(B ?\$,1(*(B ?\$,1(z(B
+  ?\$,1(x(B ?\$,1(%(B ?\,A,(B ?\$,1x:(B ?\$,1!R(B ?\$,1xh(B ?\$,1x&(B ?\,A+(B ?\,A;(B ?\$,1s&(B ?\,A (B ?\$,1(+(B ?\$,1({(B ?\$,1(,(B ?\$,1(|(B ?\$,1(u(B
+  ?\$,1rs(B ?\$,1rt(B ?\$,1r|(B ?\$,1r}(B ?\$,1rx(B ?\$,1ry(B ?\,Aw(B ?\$,1r~(B ?\$,1(.(B ?\$,1(~(B ?\$,1(/(B ?\$,1((B ?\$,1uV(B ?\$,1(!(B ?\$,1(q(B ?\$,1(o(B
+  ?\$,1(P(B ?\$,1(Q(B ?\$,1(R(B ?\$,1(S(B ?\$,1(T(B ?\$,1(U(B ?\$,1(V(B ?\$,1(W(B ?\$,1(X(B ?\$,1(Y(B ?\$,1(Z(B ?\$,1([(B ?\$,1(\(B ?\$,1(](B ?\$,1(^(B ?\$,1(_(B
+  ?\$,1(`(B ?\$,1(a(B ?\$,1(b(B ?\$,1(c(B ?\$,1(d(B ?\$,1(e(B ?\$,1(f(B ?\$,1(g(B ?\$,1(h(B ?\$,1(i(B ?\$,1(j(B ?\$,1(k(B ?\$,1(l(B ?\$,1(m(B ?\$,1(n(B ?\$,1tL(B]
  "Mac Cyrillic Encoding (MIME:x-mac-cyrillic).")
 (coding-system-put 'mac-cyrillic 'mime-charset 'x-mac-cyrillic)
 
+(let
+    ((encoding-vector
+      (vconcat
+       (make-vector 32 nil)
+       ;; mac-symbol (32..126) -> emacs-mule mapping
+       [?\  ?\! ?\$,1x (B ?\# ?\$,1x#(B ?\% ?\& ?\$,1x-(B ?\( ?\) ?\$,1x7(B ?\+ ?\, ?\$,1x2(B ?\. ?\/
+	?\0 ?\1 ?\2 ?\3 ?\4 ?\5 ?\6 ?\7 ?\8 ?\9 ?\: ?\; ?\< ?\= ?\> ?\?
+	?\$,1xe(B ?\$,1&q(B ?\$,1&r(B ?\$,1''(B ?\$,1&t(B ?\$,1&u(B ?\$,1'&(B ?\$,1&s(B ?\$,1&w(B ?\$,1&y(B ?\$,1'Q(B ?\$,1&z(B ?\$,1&{(B ?\$,1&|(B ?\$,1&}(B ?\$,1&(B
+	?\$,1' (B ?\$,1&x(B ?\$,1'!(B ?\$,1'#(B ?\$,1'$(B ?\$,1'%(B ?\$,1'B(B ?\$,1')(B ?\$,1&~(B ?\$,1'((B ?\$,1&v(B ?\[ ?\$,1xT(B ?\] ?\$,1ye(B ?\_
+	?\$,3bE(B ?\$,1'1(B ?\$,1'2(B ?\$,1'G(B ?\$,1'4(B ?\$,1'5(B ?\$,1'F(B ?\$,1'3(B ?\$,1'7(B ?\$,1'9(B ?\$,1'U(B ?\$,1':(B ?\$,1';(B ?\$,1'<(B ?\$,1'=(B ?\$,1'?(B
+	?\$,1'@(B ?\$,1'8(B ?\$,1'A(B ?\$,1'C(B ?\$,1'D(B ?\$,1'E(B ?\$,1'V(B ?\$,1'I(B ?\$,1'>(B ?\$,1'H(B ?\$,1'6(B ?\{ ?\| ?\} ?\$,1x\(B]
+       (make-vector (- 160 127) nil)
+       ;; mac-symbol (160..254) -> emacs-mule mapping
+       ;; Mapping of the following characters are changed from the
+       ;; original one:
+       ;; 0xE2	0x00AE+0xF87F -> 0x00AE # REGISTERED SIGN, alternate: sans serif
+       ;; 0xE3	0x00A9+0xF87F -> 0x00A9	# COPYRIGHT SIGN, alternate: sans serif
+       ;; 0xE4	0x2122+0xF87F -> 0x2122	# TRADE MARK SIGN, alternate: sans serif
+       [?\$,1tL(B ?\$,1'R(B ?\$,1s2(B ?\$,1y$(B ?\$,1sD(B ?\$,1x>(B ?\$,1!R(B ?\$,2#c(B ?\$,2#f(B ?\$,2#e(B ?\$,2#`(B ?\$,1vt(B ?\$,1vp(B ?\$,1vq(B ?\$,1vr(B ?\$,1vs(B
+	?\,A0(B ?\,A1(B ?\$,1s3(B ?\$,1y%(B ?\,AW(B ?\$,1x=(B ?\$,1x"(B ?\$,1s"(B ?\,Aw(B ?\$,1y (B ?\$,1y!(B ?\$,1xh(B ?\$,1s&(B ?\$,1|p(B ?\$,1|O(B ?\$,1w5(B
+	?\$,1uu(B ?\$,1uQ(B ?\$,1u\(B ?\$,1uX(B ?\$,1yW(B ?\$,1yU(B ?\$,1x%(B ?\$,1xI(B ?\$,1xJ(B ?\$,1yC(B ?\$,1yG(B ?\$,1yD(B ?\$,1yB(B ?\$,1yF(B ?\$,1x((B ?\$,1x)(B
+	?\$,1x@(B ?\$,1x'(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1x/(B ?\$,1x:(B ?\$,1z%(B ?\,A,(B ?\$,1xG(B ?\$,1xH(B ?\$,1wT(B ?\$,1wP(B ?\$,1wQ(B ?\$,1wR(B ?\$,1wS(B
+	?\$,2"*(B ?\$,2=H(B ?\,A.(B ?\,A)(B ?\$,1ub(B ?\$,1x1(B ?\$,1|;(B ?\$,1|<(B ?\$,1|=(B ?\$,1|A(B ?\$,1|B(B ?\$,1|C(B ?\$,1|G(B ?\$,1|H(B ?\$,1|I(B ?\$,1|J(B
+	?\$,3b_(B ?\$,2=I(B ?\$,1xK(B ?\$,1{ (B ?\$,1|N(B ?\$,1{!(B ?\$,1|>(B ?\$,1|?(B ?\$,1|@(B ?\$,1|D(B ?\$,1|E(B ?\$,1|F(B ?\$,1|K(B ?\$,1|L(B ?\$,1|M(B
+	nil]))
+     translation-table)
+  (setq translation-table
+	(make-translation-table-from-vector encoding-vector))
+;;  (define-translation-table 'mac-symbol-decoder translation-table)
+  (define-translation-table 'mac-symbol-encoder
+    (char-table-extra-slot translation-table 0)))
+
+(let
+    ((encoding-vector 
+      (vconcat
+       (make-vector 32 nil)
+       ;; mac-dingbats (32..126) -> emacs-mule mapping
+       [?\  ?\$,2%A(B ?\$,2%B(B ?\$,2%C(B ?\$,2%D(B ?\$,2"n(B ?\$,2%F(B ?\$,2%G(B ?\$,2%H(B ?\$,2%I(B ?\$,2"{(B ?\$,2"~(B ?\$,2%L(B ?\$,2%M(B ?\$,2%N(B ?\$,2%O(B
+	?\$,2%P(B ?\$,2%Q(B ?\$,2%R(B ?\$,2%S(B ?\$,2%T(B ?\$,2%U(B ?\$,2%V(B ?\$,2%W(B ?\$,2%X(B ?\$,2%Y(B ?\$,2%Z(B ?\$,2%[(B ?\$,2%\(B ?\$,2%](B ?\$,2%^(B ?\$,2%_(B
+	?\$,2%`(B ?\$,2%a(B ?\$,2%b(B ?\$,2%c(B ?\$,2%d(B ?\$,2%e(B ?\$,2%f(B ?\$,2%g(B ?\$,2"e(B ?\$,2%i(B ?\$,2%j(B ?\$,2%k(B ?\$,2%l(B ?\$,2%m(B ?\$,2%n(B ?\$,2%o(B
+	?\$,2%p(B ?\$,2%q(B ?\$,2%r(B ?\$,2%s(B ?\$,2%t(B ?\$,2%u(B ?\$,2%v(B ?\$,2%w(B ?\$,2%x(B ?\$,2%y(B ?\$,2%z(B ?\$,2%{(B ?\$,2%|(B ?\$,2%}(B ?\$,2%~(B ?\$,2%(B
+	?\$,2& (B ?\$,2&!(B ?\$,2&"(B ?\$,2&#(B ?\$,2&$(B ?\$,2&%(B ?\$,2&&(B ?\$,2&'(B ?\$,2&((B ?\$,2&)(B ?\$,2&*(B ?\$,2&+(B ?\$,2"/(B ?\$,2&-(B ?\$,2!`(B ?\$,2&/(B
+	?\$,2&0(B ?\$,2&1(B ?\$,2&2(B ?\$,2!r(B ?\$,2!|(B ?\$,2"&(B ?\$,2&6(B ?\$,2"7(B ?\$,2&8(B ?\$,2&9(B ?\$,2&:(B ?\$,2&;(B ?\$,2&<(B ?\$,2&=(B ?\$,2&>(B
+       nil
+       ;; mac-dingbats (128..141) -> emacs-mule mapping
+       ?\$,2&H(B ?\$,2&I(B ?\$,2&J(B ?\$,2&K(B ?\$,2&L(B ?\$,2&M(B ?\$,2&N(B ?\$,2&O(B ?\$,2&P(B ?\$,2&Q(B ?\$,2&R(B ?\$,2&S(B ?\$,2&T(B ?\$,2&U(B]
+       (make-vector (- 161 142) nil)
+       ;; mac-dingbats (161..239) -> emacs-mule mapping
+       [?\$,2&A(B ?\$,2&B(B ?\$,2&C(B ?\$,2&D(B ?\$,2&E(B ?\$,2&F(B ?\$,2&G(B ?\$,2#c(B ?\$,2#f(B ?\$,2#e(B ?\$,2#`(B ?\$,1~@(B ?\$,1~A(B ?\$,1~B(B ?\$,1~C(B
+	?\$,1~D(B ?\$,1~E(B ?\$,1~F(B ?\$,1~G(B ?\$,1~H(B ?\$,1~I(B ?\$,2&V(B ?\$,2&W(B ?\$,2&X(B ?\$,2&Y(B ?\$,2&Z(B ?\$,2&[(B ?\$,2&\(B ?\$,2&](B ?\$,2&^(B ?\$,2&_(B
+	?\$,2&`(B ?\$,2&a(B ?\$,2&b(B ?\$,2&c(B ?\$,2&d(B ?\$,2&e(B ?\$,2&f(B ?\$,2&g(B ?\$,2&h(B ?\$,2&i(B ?\$,2&j(B ?\$,2&k(B ?\$,2&l(B ?\$,2&m(B ?\$,2&n(B ?\$,2&o(B
+	?\$,2&p(B ?\$,2&q(B ?\$,2&r(B ?\$,2&s(B ?\$,2&t(B ?\$,1vr(B ?\$,1vt(B ?\$,1vu(B ?\$,2&x(B ?\$,2&y(B ?\$,2&z(B ?\$,2&{(B ?\$,2&|(B ?\$,2&}(B ?\$,2&~(B ?\$,2&(B
+	?\$,2' (B ?\$,2'!(B ?\$,2'"(B ?\$,2'#(B ?\$,2'$(B ?\$,2'%(B ?\$,2'&(B ?\$,2''(B ?\$,2'((B ?\$,2')(B ?\$,2'*(B ?\$,2'+(B ?\$,2',(B ?\$,2'-(B ?\$,2'.(B ?\$,2'/(B
+	nil
+       ;; mac-dingbats (241..254) -> emacs-mule mapping
+	?\$,2'1(B ?\$,2'2(B ?\$,2'3(B ?\$,2'4(B ?\$,2'5(B ?\$,2'6(B ?\$,2'7(B ?\$,2'8(B ?\$,2'9(B ?\$,2':(B ?\$,2';(B ?\$,2'<(B ?\$,2'=(B ?\$,2'>(B
+	nil]))
+     translation-table)
+  (setq translation-table
+	(make-translation-table-from-vector encoding-vector))
+;;  (define-translation-table 'mac-dingbats-decoder translation-table)
+  (define-translation-table 'mac-dingbats-encoder
+    (char-table-extra-slot translation-table 0)))
+
 (defvar mac-font-encoder-list
   '(("mac-roman" mac-roman-encoder
      ccl-encode-mac-roman-font "%s")
     ("mac-centraleurroman" encode-mac-centraleurroman
      ccl-encode-mac-centraleurroman-font "%s ce")
     ("mac-cyrillic" encode-mac-cyrillic
-     ccl-encode-mac-cyrillic-font "%s cy")))
+     ccl-encode-mac-cyrillic-font "%s cy")
+    ("mac-symbol" mac-symbol-encoder
+     ccl-encode-mac-symbol-font "symbol")
+    ("mac-dingbats" mac-dingbats-encoder
+     ccl-encode-mac-dingbats-font "zapf dingbats")))
 
 (let ((encoder-list
        (mapcar (lambda (lst) (nth 1 lst)) mac-font-encoder-list))
@@ -1497,6 +1338,26 @@
 	   (translate-character encode-mac-cyrillic r0 r1)))))
   "CCL program for Mac Cyrillic font")
 
+(define-ccl-program ccl-encode-mac-symbol-font
+  `(0
+    (if (r0 != ,(charset-id 'ascii))
+	(if (r0 <= ?\x8f)
+	    (translate-character mac-symbol-encoder r0 r1)
+	  ((r1 <<= 7)
+	   (r1 |= r2)
+	   (translate-character mac-symbol-encoder r0 r1)))))
+  "CCL program for Mac Symbol font")
+
+(define-ccl-program ccl-encode-mac-dingbats-font
+  `(0
+    (if (r0 != ,(charset-id 'ascii))
+	(if (r0 <= ?\x8f)
+	    (translate-character mac-dingbats-encoder r0 r1)
+	  ((r1 <<= 7)
+	   (r1 |= r2)
+	   (translate-character mac-dingbats-encoder r0 r1)))))
+  "CCL program for Mac Dingbats font")
+
 
 (setq font-ccl-encoder-alist
       (nconc
--- a/lisp/tooltip.el	Tue Apr 19 13:33:31 2005 +0000
+++ b/lisp/tooltip.el	Mon Apr 25 11:47:55 2005 +0000
@@ -145,6 +145,8 @@
   :tag "Use echo area"
   :group 'tooltip)
 
+(defvaralias 'tooltip-use-echo-area 'tooltip-gud-echo-area)
+(make-obsolete-variable 'tooltip-use-echo-area 'tooltip-gud-echo-area "22.1")
 
 ;;; Variables that are not customizable.
 
--- a/lispref/ChangeLog	Tue Apr 19 13:33:31 2005 +0000
+++ b/lispref/ChangeLog	Mon Apr 25 11:47:55 2005 +0000
@@ -1,3 +1,18 @@
+2005-04-19  Richard M. Stallman  <rms@gnu.org>
+
+	* modes.texi (Search-based Fontification): Explain that
+	facespec is an expression to be evaluated.
+
+2005-04-19  Kevin Ryde  <user42@zip.com.au>
+
+        * streams.texi (Output Functions): Fix xref.
+	* strings.texi (String Conversion): Fix xref.
+
+2005-04-19  Kim F. Storm  <storm@cua.dk>
+
+	* symbols.texi (Symbol Plists): Add safe-get.
+	Mention that `get' may signal an error.
+
 2005-04-18  Nick Roberts  <nickrob@snap.net.nz>
 
 	* customize.texi (Variable Definitions): Replace tooltip-mode
--- a/lispref/modes.texi	Tue Apr 19 13:33:31 2005 +0000
+++ b/lispref/modes.texi	Mon Apr 25 11:47:55 2005 +0000
@@ -2163,9 +2163,10 @@
 Functions}) to calculate the value for @var{subexp}.
 
 @item (@var{matcher} . @var{facespec})
-In this kind of element, @var{facespec} is an object which specifies
-the face variable to use for highlighting.  In the simplest case, it
-is a Lisp variable (a symbol), whose value should be a face name.
+In this kind of element, @var{facespec} is an expression whose value
+specifies the face to use for highlighting.  In the simplest case,
+@var{facespec} is a Lisp variable (a symbol) whose value is a face
+name.
 
 @example
 ;; @r{Highlight occurrences of @samp{fubar},}
@@ -2173,12 +2174,13 @@
 ("fubar" . fubar-face)
 @end example
 
-However, @var{facespec} can also be a list of the form:
+However, @var{facespec} can also evaluate to a list of this form:
 
 @example
 (face @var{face} @var{prop1} @var{val1} @var{prop2} @var{val2}@dots{})
 @end example
 
+@noindent
 to specify the face @var{face} and various additional text properties
 to put on the text that matches.  If you do this, be sure to add the
 other text property names that you set in this way to the value of
@@ -2198,7 +2200,8 @@
 
 The @sc{car}, @var{subexp}, is an integer specifying which subexpression
 of the match to fontify (0 means the entire matching text).  The second
-subelement, @var{facespec}, specifies the face, as described above.
+subelement, @var{facespec}, is an expression whose value specifies the
+face, as described above.
 
 The last two values in @var{subexp-highlighter}, @var{override} and
 @var{laxmatch}, are optional flags.  If @var{override} is @code{t},
--- a/lispref/streams.texi	Tue Apr 19 13:33:31 2005 +0000
+++ b/lispref/streams.texi	Mon Apr 25 11:47:55 2005 +0000
@@ -659,7 +659,7 @@
 @end group
 @end example
 
-See @code{format}, in @ref{String Conversion}, for other ways to obtain
+See @code{format}, in @ref{Formatting Strings}, for other ways to obtain
 the printed representation of a Lisp object as a string.
 @end defun
 
--- a/lispref/strings.texi	Tue Apr 19 13:33:31 2005 +0000
+++ b/lispref/strings.texi	Mon Apr 25 11:47:55 2005 +0000
@@ -549,7 +549,8 @@
 @cindex conversion of strings
 
   This section describes functions for conversions between characters,
-strings and integers.  @code{format} and @code{prin1-to-string}
+strings and integers.  @code{format} (@pxref{Formatting Strings})
+and @code{prin1-to-string}
 (@pxref{Output Functions}) can also convert Lisp objects into strings.
 @code{read-from-string} (@pxref{Input Functions}) can ``convert'' a
 string representation of a Lisp object into an object.  The functions
--- a/lispref/symbols.texi	Tue Apr 19 13:33:31 2005 +0000
+++ b/lispref/symbols.texi	Mon Apr 25 11:47:55 2005 +0000
@@ -496,6 +496,8 @@
 @var{symbol}'s property list.  If there is no such property, @code{nil}
 is returned.  Thus, there is no distinction between a value of
 @code{nil} and the absence of the property.
+A @code{wrong-type-argument} error may be signaled if @var{symbol}
+has a malformed property list.
 
 The name @var{property} is compared with the existing property names
 using @code{eq}, so any object is a legitimate property.
@@ -503,6 +505,12 @@
 See @code{put} for an example.
 @end defun
 
+@defun safe-get symbol property
+This function finds the value of the property named @var{property} in
+@var{symbol}'s property list.  Unlike @code{get}, it just returns
+@code{nil} if @var{symbol} has a malformed property list.
+@end defun
+
 @defun put symbol property value
 This function puts @var{value} onto @var{symbol}'s property list under
 the property name @var{property}, replacing any previous property value.
--- a/man/ChangeLog	Tue Apr 19 13:33:31 2005 +0000
+++ b/man/ChangeLog	Mon Apr 25 11:47:55 2005 +0000
@@ -1,8 +1,12 @@
+2005-04-19  Kim F. Storm  <storm@cua.dk>
+
+	* building.texi (Compilation Mode): Add M-g M-n and M-g M-p bindings.
+
 2005-04-18  Lars Hansen  <larsh@math.ku.dk>
 
 	* misc.texi (Saving Emacs Sessions): Add that "--no-desktop" now
 	turns off desktop-save-mode.
-	
+
 2005-04-17  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* frames.texi (XTerm Mouse): Xterm Mouse mode is no longer enabled
--- a/man/building.texi	Tue Apr 19 13:33:31 2005 +0000
+++ b/man/building.texi	Mon Apr 25 11:47:55 2005 +0000
@@ -163,8 +163,13 @@
 follow output as it comes in.
 
 @table @kbd
-@item C-x `
+@item M-g M-n
+@itemx M-g n
+@itemx C-x `
 Visit the locus of the next compiler error message or @code{grep} match.
+@item M-g M-p
+@itemx M-g p
+Visit the locus of the previous compiler error message or @code{grep} match.
 @item @key{RET}
 Visit the locus of the error message that point is on.
 This command is used in the compilation buffer.
@@ -187,6 +192,8 @@
 compilation buffer produce automatic source display.
 @end table
 
+@kindex M-g M-n
+@kindex M-g n
 @kindex C-x `
 @findex next-error
   You can visit the source for any particular error message by moving
--- a/src/ChangeLog	Tue Apr 19 13:33:31 2005 +0000
+++ b/src/ChangeLog	Mon Apr 25 11:47:55 2005 +0000
@@ -1,3 +1,58 @@
+2005-04-19  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (setup_for_ellipsis): Reset saved_face_id to use default
+	face unless last visible char and first invisible char have the
+	same face.  Also use default face if saved_face_id is undefined.
+
+2005-04-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macgui.h (MacFontStruct): Remove member `fontname'.  Add member
+	`full_name'.
+	[TARGET_API_MAC_CARBON] (MacFontStruct): Use type int for
+	mac_scriptcode member.
+
+	* macterm.c (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
+	(syms_of_mac): Don't initialize them.
+	(Vmac_charset_info_alist): New variable.
+	(syms_of_mac): Defvar it.
+	(create_text_encoding_info_alist): New function.
+	(decode_mac_font_name, mac_to_x_fontname)
+	(x_font_name_to_mac_font_name, init_font_name_table): Don't hard
+	code the correspondence among XLFD charsets, Mac script codes, and
+	Emacs coding systems.  Use Vmac_charset_info_alist and result of
+	create_text_encoding_info_alist instead.
+	(init_font_name_table) [TARGET_API_MAC_CARBON]: Use Font Manager
+	routines also on Mac OS Classic.
+	(init_font_name_table) [!TARGET_API_MAC_CARBON]: Use
+	add_font_name_table_entry.
+	(mac_do_list_fonts): Regard 0 in XLFD scaleble fields as
+	specified.  Derive unspecified scalable fields from specified one.
+	(x_list_fonts): Consider Valternate_fontname_alist.
+	(kDefaultFontSize): Change value from 9 to 12.
+	(XLoadQueryFont): Get decoded font family, font face, and charset
+	from x_font_name_to_mac_font_name.  Set full name of loaded font.
+	(mac_unload_font): Free `full_name' member.
+	(x_load_font): Don't try XLoadQueryFont if x_list_fonts returns
+	NULL.  Copy full_name member of struct MacFontStruct to that of
+	struct font_info.
+
+2005-04-19  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (handle_stop): Set saved_face_id to current face if
+	selective_display_ellipsis_p so ellipsis will be shown in same
+	face as preceding text.
+	(setup_for_ellipsis): Don't set saved_face_id here.
+	(next_element_from_display_vector): Default to saved_face_id.
+
+	* fns.c (Fsafe_get): New function.
+	(syms_of_fns): Defsubr it.
+
+	* lisp.h (Fsafe_get): EXFUN it.
+
+	* xfaces.c (resolve_face_name): Use Fsafe_get to avoid redisplay
+	loops in case of bad face property lists.  Limit number of face
+	alias lookups to 10 (in case of face alias loops).
+
 2005-04-18  Kim F. Storm  <storm@cua.dk>
 
 	* dispextern.h (struct glyph_row): New member overlay_arrow_bitmap.
--- a/src/fns.c	Tue Apr 19 13:33:31 2005 +0000
+++ b/src/fns.c	Mon Apr 25 11:47:55 2005 +0000
@@ -2051,6 +2051,18 @@
   return Fplist_get (XSYMBOL (symbol)->plist, propname);
 }
 
+DEFUN ("safe-get", Fsafe_get, Ssafe_get, 2, 2, 0,
+       doc: /* Return the value of SYMBOL's PROPNAME property.
+This is the last value stored with `(put SYMBOL PROPNAME VALUE)'.
+This function never signals an error.  */)
+     (symbol, propname)
+     Lisp_Object symbol, propname;
+{
+  if (!SYMBOLP (symbol))
+    return Qnil;
+  return Fsafe_plist_get (XSYMBOL (symbol)->plist, propname);
+}
+
 DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0,
        doc: /* Change value in PLIST of PROP to VAL.
 PLIST is a property list, which is a list of the form
@@ -5792,6 +5804,7 @@
   defsubr (&Splist_get);
   defsubr (&Ssafe_plist_get);
   defsubr (&Sget);
+  defsubr (&Ssafe_get);
   defsubr (&Splist_put);
   defsubr (&Sput);
   defsubr (&Slax_plist_get);
--- a/src/lisp.h	Tue Apr 19 13:33:31 2005 +0000
+++ b/src/lisp.h	Mon Apr 25 11:47:55 2005 +0000
@@ -2322,6 +2322,7 @@
 EXFUN (Freverse, 1);
 EXFUN (Fnreverse, 1);
 EXFUN (Fget, 2);
+EXFUN (Fsafe_get, 2);
 EXFUN (Fput, 3);
 EXFUN (Fequal, 2);
 EXFUN (Ffillarray, 2);
--- a/src/macgui.h	Tue Apr 19 13:33:31 2005 +0000
+++ b/src/macgui.h	Mon Apr 25 11:47:55 2005 +0000
@@ -101,12 +101,16 @@
    (xcs).descent = (bds).bottom)
 
 struct MacFontStruct {
-  char *fontname;
+  char *full_name;
 
   short mac_fontnum;  /* font number of font used in this window */
   int mac_fontsize;  /* size of font */
   short mac_fontface;  /* plain, bold, italics, etc. */
+#if TARGET_API_MAC_CARBON
+  int mac_scriptcode;  /* Mac OS script code for font used */
+#else
   short mac_scriptcode;  /* Mac OS script code for font used */
+#endif
 
 #if 0
   SInt16 mFontNum;  /* font number of font used in this window */
--- a/src/macterm.c	Tue Apr 19 13:33:31 2005 +0000
+++ b/src/macterm.c	Mon Apr 25 11:47:55 2005 +0000
@@ -5841,121 +5841,59 @@
 int font_name_table_size = 0;
 int font_name_count = 0;
 
-#if 0
-/* compare two strings ignoring case */
-static int
-stricmp (const char *s, const char *t)
-{
-  for ( ; tolower (*s) == tolower (*t); s++, t++)
-    if (*s == '\0')
-      return 0;
-  return tolower (*s) - tolower (*t);
-}
-
-/* compare two strings ignoring case and handling wildcard */
-static int
-wildstrieq (char *s1, char *s2)
-{
-  if (strcmp (s1, "*") == 0 || strcmp (s2, "*") == 0)
-    return true;
-
-  return stricmp (s1, s2) == 0;
-}
-
-/* Assume parameter 1 is fully qualified, no wildcards. */
-static int
-mac_font_pattern_match (fontname, pattern)
-    char * fontname;
-    char * pattern;
-{
-  char *regex = (char *) alloca (strlen (pattern) * 2 + 3);
-  char *font_name_copy = (char *) alloca (strlen (fontname) + 1);
-  char *ptr;
-
-  /* Copy fontname so we can modify it during comparison.  */
-  strcpy (font_name_copy, fontname);
-
-  ptr = regex;
-  *ptr++ = '^';
-
-  /* Turn pattern into a regexp and do a regexp match.  */
-  for (; *pattern; pattern++)
-    {
-      if (*pattern == '?')
-        *ptr++ = '.';
-      else if (*pattern == '*')
-        {
-          *ptr++ = '.';
-          *ptr++ = '*';
-        }
+/* Alist linking character set strings to Mac text encoding and Emacs
+   coding system. */
+static Lisp_Object Vmac_charset_info_alist;
+
+static Lisp_Object
+create_text_encoding_info_alist ()
+{
+  Lisp_Object result = Qnil, rest;
+
+  for (rest = Vmac_charset_info_alist; CONSP (rest); rest = XCDR (rest))
+    {
+      Lisp_Object charset_info = XCAR (rest);
+      Lisp_Object charset, coding_system, text_encoding;
+      Lisp_Object existing_info;
+
+      if (!(CONSP (charset_info)
+	    && STRINGP (charset = XCAR (charset_info))
+	    && CONSP (XCDR (charset_info))
+	    && INTEGERP (text_encoding = XCAR (XCDR (charset_info)))
+	    && CONSP (XCDR (XCDR (charset_info)))
+	    && SYMBOLP (coding_system = XCAR (XCDR (XCDR (charset_info))))))
+	continue;
+
+      existing_info = assq_no_quit (text_encoding, result);
+      if (NILP (existing_info))
+	result = Fcons (list3 (text_encoding, coding_system, charset),
+			result);
       else
-        *ptr++ = *pattern;
-    }
-  *ptr = '$';
-  *(ptr + 1) = '\0';
-
-  return (fast_c_string_match_ignore_case (build_string (regex),
-                                           font_name_copy) >= 0);
-}
-
-/* Two font specs are considered to match if their foundry, family,
-   weight, slant, and charset match.  */
-static int
-mac_font_match (char *mf, char *xf)
-{
-  char m_foundry[50], m_family[50], m_weight[20], m_slant[2], m_charset[20];
-  char x_foundry[50], x_family[50], x_weight[20], x_slant[2], x_charset[20];
-
-  if (sscanf (mf, "-%49[^-]-%49[^-]-%19[^-]-%1[^-]-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%19s",
-              m_foundry, m_family, m_weight, m_slant, m_charset) != 5)
-    return mac_font_pattern_match (mf, xf);
-
-  if (sscanf (xf, "-%49[^-]-%49[^-]-%19[^-]-%1[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%19s",
-              x_foundry, x_family, x_weight, x_slant, x_charset) != 5)
-    return mac_font_pattern_match (mf, xf);
-
-  return (wildstrieq (m_foundry, x_foundry)
-          && wildstrieq (m_family, x_family)
-          && wildstrieq (m_weight, x_weight)
-          && wildstrieq (m_slant, x_slant)
-          && wildstrieq (m_charset, x_charset))
-         || mac_font_pattern_match (mf, xf);
-}
-#endif
-
-static Lisp_Object Qbig5, Qcn_gb, Qsjis, Qeuc_kr;
-
-static void
-decode_mac_font_name (name, size, scriptcode)
+	if (NILP (Fmember (charset, XCDR (XCDR (existing_info)))))
+	  XSETCDR (XCDR (existing_info),
+		   Fcons (charset, XCDR (XCDR (existing_info))));
+    }
+
+  return result;
+}
+
+
+static void
+decode_mac_font_name (name, size, coding_system)
      char *name;
      int size;
-#if TARGET_API_MAC_CARBON
-     int scriptcode;
-#else
-     short scriptcode;
-#endif
-{
-  Lisp_Object coding_system;
+     Lisp_Object coding_system;
+{
   struct coding_system coding;
-  char *buf;
-
-  switch (scriptcode)
-    {
-    case smTradChinese:
-      coding_system = Qbig5;
-      break;
-    case smSimpChinese:
-      coding_system = Qcn_gb;
+  char *buf, *p;
+
+  for (p = name; *p; p++)
+    if (!isascii (*p) || iscntrl (*p))
       break;
-    case smJapanese:
-      coding_system = Qsjis;
-      break;
-    case smKorean:
-      coding_system = Qeuc_kr;
-      break;
-    default:
-      return;
-    }
+
+  if (*p == '\0'
+      || NILP (coding_system) || NILP (Fcoding_system_p (coding_system)))
+    return;
 
   setup_coding_system (coding_system, &coding);
   coding.src_multibyte = 0;
@@ -5971,68 +5909,26 @@
 
 
 static char *
-mac_to_x_fontname (name, size, style, scriptcode)
+mac_to_x_fontname (name, size, style, charset)
      char *name;
      int size;
      Style style;
-#if TARGET_API_MAC_CARBON
-     int scriptcode;
-#else
-     short scriptcode;
-#endif
+     char *charset;
 {
   char foundry[32], family[32], cs[32];
   char xf[256], *result, *p;
 
-  if (sscanf (name, "%31[^-]-%31[^-]-%31s", foundry, family, cs) != 3)
+  if (sscanf (name, "%31[^-]-%31[^-]-%31s", foundry, family, cs) == 3)
+    charset = cs;
+  else
     {
       strcpy(foundry, "Apple");
       strcpy(family, name);
-
-      switch (scriptcode)
-      {
-      case smTradChinese:	/* == kTextEncodingMacChineseTrad */
-        strcpy(cs, "big5-0");
-        break;
-      case smSimpChinese:	/* == kTextEncodingMacChineseSimp */
-        strcpy(cs, "gb2312.1980-0");
-        break;
-      case smJapanese:		/* == kTextEncodingMacJapanese */
-        strcpy(cs, "jisx0208.1983-sjis");
-        break;
-      case -smJapanese:
-	/* Each Apple Japanese font is entered into the font table
-	   twice: once as a jisx0208.1983-sjis font and once as a
-	   jisx0201.1976-0 font.  The latter can be used to display
-	   the ascii charset and katakana-jisx0201 charset.  A
-	   negative script code signals that the name of this latter
-	   font is being built.  */
-	strcpy(cs, "jisx0201.1976-0");
-	break;
-      case smKorean:		/* == kTextEncodingMacKorean */
-        strcpy(cs, "ksc5601.1989-0");
-        break;
-#if TARGET_API_MAC_CARBON
-      case kTextEncodingMacCyrillic:
-	strcpy(cs, "mac-cyrillic");
-	break;
-      case kTextEncodingMacCentralEurRoman:
-	strcpy(cs, "mac-centraleurroman");
-	break;
-      case kTextEncodingMacSymbol:
-      case kTextEncodingMacDingbats:
-	strcpy(cs, "adobe-fontspecific");
-	break;
-#endif
-      default:
-	strcpy(cs, "mac-roman");
-	break;
-      }
     }
 
   sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-75-75-m-%d-%s",
           foundry, family, style & bold ? "bold" : "medium",
-	  style & italic ? 'i' : 'r', size, size * 10, size * 10, cs);
+	  style & italic ? 'i' : 'r', size, size * 10, size * 10, charset);
 
   result = (char *) xmalloc (strlen (xf) + 1);
   strcpy (result, xf);
@@ -6050,10 +5946,13 @@
    "ETL-Fixed-iso8859-1", "ETL-Fixed-koi8-r", etc.  Both types of font
    names are handled accordingly.  */
 static void
-x_font_name_to_mac_font_name (char *xf, char *mf)
-{
-  char foundry[32], family[32], weight[20], slant[2], cs[32];
-  Lisp_Object coding_system = Qnil;
+x_font_name_to_mac_font_name (xf, mf, mf_decoded, style, cs)
+     char *xf, *mf, *mf_decoded;
+     Style *style;
+     char *cs;
+{
+  char foundry[32], family[32], weight[20], slant[2], *p;
+  Lisp_Object charset_info, coding_system = Qnil;
   struct coding_system coding;
 
   strcpy (mf, "");
@@ -6064,30 +5963,36 @@
               foundry, family, weight, slant, cs) != 5)
     return;
 
-  if (strcmp (cs, "big5-0") == 0)
-    coding_system = Qbig5;
-  else if (strcmp (cs, "gb2312.1980-0") == 0)
-    coding_system = Qcn_gb;
-  else if (strcmp (cs, "jisx0208.1983-sjis") == 0
-	   || strcmp (cs, "jisx0201.1976-0") == 0)
-    coding_system = Qsjis;
-  else if (strcmp (cs, "ksc5601.1989-0") == 0)
-    coding_system = Qeuc_kr;
-  else if (strcmp (cs, "mac-roman") == 0
-	   || strcmp (cs, "mac-cyrillic") == 0
-	   || strcmp (cs, "mac-centraleurroman") == 0
-	   || strcmp (cs, "adobe-fontspecific") == 0)
-    strcpy (mf, family);
+  *style = normal;
+  if (strcmp (weight, "bold") == 0)
+    *style |= bold;
+  if (*slant == 'i')
+    *style |= italic;
+
+  charset_info = Fassoc (build_string (cs), Vmac_charset_info_alist);
+  if (!NILP (charset_info))
+    {
+      strcpy (mf_decoded, family);
+      coding_system = Fcar (Fcdr (Fcdr (charset_info)));
+    }
   else
-    sprintf (mf, "%s-%s-%s", foundry, family, cs);
-
-  if (!NILP (coding_system))
+    sprintf (mf_decoded, "%s-%s-%s", foundry, family, cs);
+
+  for (p = mf_decoded; *p; p++)
+    if (!isascii (*p) || iscntrl (*p))
+      break;
+
+  if (*p == '\0'
+      || NILP (coding_system) || NILP (Fcoding_system_p (coding_system)))
+    strcpy (mf, mf_decoded);
+  else
     {
       setup_coding_system (coding_system, &coding);
       coding.src_multibyte = 1;
       coding.dst_multibyte = 1;
       coding.mode |= CODING_MODE_LAST_BLOCK;
-      encode_coding (&coding, family, mf, strlen (family), sizeof (Str32) - 1);
+      encode_coding (&coding, mf_decoded, mf,
+		     strlen (mf_decoded), sizeof (Str32) - 1);
       mf[coding.produced] = '\0';
     }
 }
@@ -6122,181 +6027,180 @@
 init_font_name_table ()
 {
 #if TARGET_API_MAC_CARBON
-  SInt32 sv;
-
-  if (Gestalt (gestaltSystemVersion, &sv) == noErr && sv >= 0x1000)
-    {
-      FMFontFamilyIterator ffi;
-      FMFontFamilyInstanceIterator ffii;
-      FMFontFamily ff;
-
-      /* Create a dummy instance iterator here to avoid creating and
-	 destroying it in the loop.  */
-      if (FMCreateFontFamilyInstanceIterator (0, &ffii) != noErr)
-	return;
-      /* Create an iterator to enumerate the font families.  */
-      if (FMCreateFontFamilyIterator (NULL, NULL, kFMDefaultOptions, &ffi)
-	  != noErr)
-	{
-	  FMDisposeFontFamilyInstanceIterator (&ffii);
-	  return;
-	}
-
-      while (FMGetNextFontFamily (&ffi, &ff) == noErr)
+  FMFontFamilyIterator ffi;
+  FMFontFamilyInstanceIterator ffii;
+  FMFontFamily ff;
+  Lisp_Object text_encoding_info_alist;
+  struct gcpro gcpro1;
+
+  /* Create a dummy instance iterator here to avoid creating and
+     destroying it in the loop.  */
+  if (FMCreateFontFamilyInstanceIterator (0, &ffii) != noErr)
+    return;
+  /* Create an iterator to enumerate the font families.  */
+  if (FMCreateFontFamilyIterator (NULL, NULL, kFMDefaultOptions, &ffi)
+      != noErr)
+    {
+      FMDisposeFontFamilyInstanceIterator (&ffii);
+      return;
+    }
+
+  text_encoding_info_alist = create_text_encoding_info_alist ();
+
+  GCPRO1 (text_encoding_info_alist);
+
+  while (FMGetNextFontFamily (&ffi, &ff) == noErr)
+    {
+      Str255 name;
+      FMFont font;
+      FMFontStyle style;
+      FMFontSize size;
+      TextEncoding encoding;
+      TextEncodingBase sc;
+      Lisp_Object text_encoding_info;
+
+      if (FMGetFontFamilyName (ff, name) != noErr)
+	break;
+      p2cstr (name);
+      if (*name == '.')
+	continue;
+
+      if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr)
+	break;
+      sc = GetTextEncodingBase (encoding);
+      text_encoding_info = assq_no_quit (make_number (sc),
+					 text_encoding_info_alist);
+      if (!NILP (text_encoding_info))
+	decode_mac_font_name (name, sizeof (name),
+			      XCAR (XCDR (text_encoding_info)));
+      else
+	text_encoding_info = assq_no_quit (make_number (kTextEncodingMacRoman),
+					   text_encoding_info_alist);
+
+      /* Point the instance iterator at the current font family.  */
+      if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr)
+	break;
+
+      while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size)
+	     == noErr)
 	{
-	  Str255 name;
-	  FMFont font;
-	  FMFontStyle style;
-	  FMFontSize size;
-	  TextEncoding encoding;
-	  TextEncodingBase sc;
-
-	  if (FMGetFontFamilyName (ff, name) != noErr)
-	    break;
-	  p2cstr (name);
-	  if (*name == '.')
-	    continue;
-
-	  if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr)
-	    break;
-	  sc = GetTextEncodingBase (encoding);
-	  decode_mac_font_name (name, sizeof (name), sc);
-
-	  /* Point the instance iterator at the current font family.  */
-	  if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr)
-	    break;
-
-	  while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size)
-		 == noErr)
+	  Lisp_Object rest = XCDR (XCDR (text_encoding_info));
+
+	  for (; !NILP (rest); rest = XCDR (rest))
 	    {
-	      /* Both jisx0208.1983-sjis and jisx0201.1976-0 parts are
-		 contained in Apple Japanese (SJIS) font.  */
-	    again:
+	      char *cs = SDATA (XCAR (rest));
+
 	      if (size == 0)
 		{
 		  add_font_name_table_entry (mac_to_x_fontname (name, size,
-								style, sc));
+								style, cs));
 		  add_font_name_table_entry (mac_to_x_fontname (name, size,
-								italic, sc));
+								italic, cs));
 		  add_font_name_table_entry (mac_to_x_fontname (name, size,
-								bold, sc));
+								bold, cs));
 		  add_font_name_table_entry (mac_to_x_fontname (name, size,
 								italic | bold,
-								sc));
+								cs));
 		}
 	      else
-		add_font_name_table_entry (mac_to_x_fontname (name, size,
-							      style, sc));
-	      if (sc == smJapanese)
 		{
-		  sc = -smJapanese;
-		  goto again;
+		  add_font_name_table_entry (mac_to_x_fontname (name, size,
+								style, cs));
 		}
-	      else if (sc == -smJapanese)
-		sc = smJapanese;
 	    }
 	}
-
-      /* Dispose of the iterators.  */
-      FMDisposeFontFamilyIterator (&ffi);
-      FMDisposeFontFamilyInstanceIterator (&ffii);
-    }
-  else
-    {
-#endif  /* TARGET_API_MAC_CARBON */
-      GrafPtr port;
-      SInt16 fontnum, old_fontnum;
-      int num_mac_fonts = CountResources('FOND');
-      int i, j;
-      Handle font_handle, font_handle_2;
-      short id, scriptcode;
-      ResType type;
-      Str32 name;
-      struct FontAssoc *fat;
-      struct AsscEntry *assc_entry;
-
-      GetPort (&port);  /* save the current font number used */
-#if TARGET_API_MAC_CARBON
-      old_fontnum = GetPortTextFont (port);
-#else
-      old_fontnum = port->txFont;
-#endif
-
-      for (i = 1; i <= num_mac_fonts; i++)  /* get all available fonts */
+    }
+
+  UNGCPRO;
+
+  /* Dispose of the iterators.  */
+  FMDisposeFontFamilyIterator (&ffi);
+  FMDisposeFontFamilyInstanceIterator (&ffii);
+#else  /* !TARGET_API_MAC_CARBON */
+  GrafPtr port;
+  SInt16 fontnum, old_fontnum;
+  int num_mac_fonts = CountResources('FOND');
+  int i, j;
+  Handle font_handle, font_handle_2;
+  short id, scriptcode;
+  ResType type;
+  Str32 name;
+  struct FontAssoc *fat;
+  struct AsscEntry *assc_entry;
+  Lisp_Object text_encoding_info_alist, text_encoding_info;
+  struct gcpro gcpro1;
+
+  GetPort (&port);  /* save the current font number used */
+  old_fontnum = port->txFont;
+
+  text_encoding_info_alist = create_text_encoding_info_alist ();
+
+  GCPRO1 (text_encoding_info_alist);
+
+  for (i = 1; i <= num_mac_fonts; i++)  /* get all available fonts */
+    {
+      font_handle = GetIndResource ('FOND', i);
+      if (!font_handle)
+	continue;
+
+      GetResInfo (font_handle, &id, &type, name);
+      GetFNum (name, &fontnum);
+      p2cstr (name);
+      if (fontnum == 0)
+	continue;
+
+      TextFont (fontnum);
+      scriptcode = FontToScript (fontnum);
+      text_encoding_info = assq_no_quit (make_number (scriptcode),
+					 text_encoding_info_alist);
+      if (!NILP (text_encoding_info))
+	decode_mac_font_name (name, sizeof (name),
+			      XCAR (XCDR (text_encoding_info)));
+      else
+	text_encoding_info = assq_no_quit (make_number (smRoman),
+					   text_encoding_info_alist);
+      do
 	{
-	  font_handle = GetIndResource ('FOND', i);
-	  if (!font_handle)
-	    continue;
-
-	  GetResInfo (font_handle, &id, &type, name);
-	  GetFNum (name, &fontnum);
-	  p2cstr (name);
-	  if (fontnum == 0)
-	    continue;
-
-	  TextFont (fontnum);
-	  scriptcode = FontToScript (fontnum);
-	  decode_mac_font_name (name, sizeof (name), scriptcode);
-	  do
+	  HLock (font_handle);
+
+	  if (GetResourceSizeOnDisk (font_handle)
+	      >= sizeof (struct FamRec))
 	    {
-	      HLock (font_handle);
-
-	      if (GetResourceSizeOnDisk (font_handle)
-		  >= sizeof (struct FamRec))
+	      fat = (struct FontAssoc *) (*font_handle
+					  + sizeof (struct FamRec));
+	      assc_entry
+		= (struct AsscEntry *) (*font_handle
+					+ sizeof (struct FamRec)
+					+ sizeof (struct FontAssoc));
+
+	      for (j = 0; j <= fat->numAssoc; j++, assc_entry++)
 		{
-		  fat = (struct FontAssoc *) (*font_handle
-					      + sizeof (struct FamRec));
-		  assc_entry
-		    = (struct AsscEntry *) (*font_handle
-					    + sizeof (struct FamRec)
-					    + sizeof (struct FontAssoc));
-
-		  for (j = 0; j <= fat->numAssoc; j++, assc_entry++)
+		  Lisp_Object rest = XCDR (XCDR (text_encoding_info));
+
+		  for (; !NILP (rest); rest = XCDR (rest))
 		    {
-		      if (font_name_table_size == 0)
-			{
-			  font_name_table_size = 16;
-			  font_name_table = (char **)
-			    xmalloc (font_name_table_size * sizeof (char *));
-			}
-		      else if (font_name_count >= font_name_table_size)
-			{
-			  font_name_table_size += 16;
-			  font_name_table = (char **)
-			    xrealloc (font_name_table,
-				      font_name_table_size * sizeof (char *));
-			}
-		      font_name_table[font_name_count++]
-			= mac_to_x_fontname (name,
-					     assc_entry->fontSize,
-					     assc_entry->fontStyle,
-					     scriptcode);
-		      /* Both jisx0208.1983-sjis and jisx0201.1976-0
-			 parts are contained in Apple Japanese (SJIS)
-			 font.  */
-		      if (smJapanese == scriptcode)
-			{
-			  font_name_table[font_name_count++]
-			    = mac_to_x_fontname (name,
-						 assc_entry->fontSize,
-						 assc_entry->fontStyle,
-						 -smJapanese);
-			}
+		      char *cs = SDATA (XCAR (rest));
+
+		      add_font_name_table_entry (mac_to_x_fontname (name,
+								    assc_entry->fontSize,
+								    assc_entry->fontStyle,
+								    cs));
 		    }
 		}
-
-	      HUnlock (font_handle);
-	      font_handle_2 = GetNextFOND (font_handle);
-	      ReleaseResource (font_handle);
-	      font_handle = font_handle_2;
 	    }
-	  while (ResError () == noErr && font_handle);
+
+	  HUnlock (font_handle);
+	  font_handle_2 = GetNextFOND (font_handle);
+	  ReleaseResource (font_handle);
+	  font_handle = font_handle_2;
 	}
-
-      TextFont (old_fontnum);
-#if TARGET_API_MAC_CARBON
-    }
-#endif  /* TARGET_API_MAC_CARBON */
+      while (ResError () == noErr && font_handle);
+    }
+
+  UNGCPRO;
+
+  TextFont (old_fontnum);
+#endif  /* !TARGET_API_MAC_CARBON */
 }
 
 
@@ -6384,7 +6288,7 @@
 	ptr++;
 	if (i == *field)
 	  {
-	    if ('1' <= *ptr && *ptr <= '9')
+	    if ('0' <= *ptr && *ptr <= '9')
 	      {
 		*val = *ptr++ - '0';
 		while ('0' <= *ptr && *ptr <= '9' && *val < 10000)
@@ -6402,21 +6306,21 @@
 
   if (i == 14 && ptr == NULL)
     {
-      if (scl_val[XLFD_SCL_POINT_SIZE] > 0)
-	{
-	  scl_val[XLFD_SCL_PIXEL_SIZE] = scl_val[XLFD_SCL_POINT_SIZE] / 10;
-	  scl_val[XLFD_SCL_AVGWIDTH] = scl_val[XLFD_SCL_POINT_SIZE];
-	}
-      else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0)
-	{
-	  scl_val[XLFD_SCL_POINT_SIZE] =
-	    scl_val[XLFD_SCL_AVGWIDTH] = scl_val[XLFD_SCL_PIXEL_SIZE] * 10;
-	}
-      else if (scl_val[XLFD_SCL_AVGWIDTH] > 0)
-	{
-	  scl_val[XLFD_SCL_PIXEL_SIZE] = scl_val[XLFD_SCL_AVGWIDTH] / 10;
-	  scl_val[XLFD_SCL_POINT_SIZE] = scl_val[XLFD_SCL_AVGWIDTH];
-	}
+      if (scl_val[XLFD_SCL_PIXEL_SIZE] < 0)
+	scl_val[XLFD_SCL_PIXEL_SIZE] =
+	  (scl_val[XLFD_SCL_POINT_SIZE] > 0 ? scl_val[XLFD_SCL_POINT_SIZE] / 10
+	   : (scl_val[XLFD_SCL_AVGWIDTH] > 0 ? scl_val[XLFD_SCL_AVGWIDTH] / 10
+	      : -1));
+      if (scl_val[XLFD_SCL_POINT_SIZE] < 0)
+	scl_val[XLFD_SCL_POINT_SIZE] =
+	  (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 ? scl_val[XLFD_SCL_PIXEL_SIZE] * 10
+	   : (scl_val[XLFD_SCL_AVGWIDTH] > 0 ? scl_val[XLFD_SCL_AVGWIDTH]
+	      : -1));
+      if (scl_val[XLFD_SCL_AVGWIDTH] < 0)
+	scl_val[XLFD_SCL_AVGWIDTH] =
+	  (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 ? scl_val[XLFD_SCL_PIXEL_SIZE] * 10
+	   : (scl_val[XLFD_SCL_POINT_SIZE] > 0 ? scl_val[XLFD_SCL_POINT_SIZE]
+	      : -1));
     }
   else
     scl_val[XLFD_SCL_PIXEL_SIZE] = -1;
@@ -6507,49 +6411,62 @@
   return font_list;
 }
 
-/* Return a list of at most MAXNAMES font specs matching the one in
-   PATTERN.  Cache matching fonts for patterns in
-   dpyinfo->name_list_element to avoid looking them up again by
-   calling mac_font_pattern_match (slow).  Return as many matching
-   fonts as possible if MAXNAMES = -1.  */
+/* Return a list of names of available fonts matching PATTERN on frame F.
+
+   Frame F null means we have not yet created any frame on Mac, and
+   consult the first display in x_display_list.  MAXNAMES sets a limit
+   on how many fonts to match.  */
 
 Lisp_Object
-x_list_fonts (struct frame *f,
-              Lisp_Object pattern,
-              int size,
-              int maxnames)
-{
-  Lisp_Object newlist = Qnil, tem, key;
-  struct mac_display_info *dpyinfo = f ? FRAME_MAC_DISPLAY_INFO (f) : NULL;
-
-  if (dpyinfo)
-    {
+x_list_fonts (f, pattern, size, maxnames)
+     struct frame *f;
+     Lisp_Object pattern;
+     int size, maxnames;
+{
+  Lisp_Object list = Qnil, patterns, tem, key;
+  struct mac_display_info *dpyinfo
+    = f ? FRAME_MAC_DISPLAY_INFO (f) : x_display_list;
+
+  xassert (size <= 0);
+
+  patterns = Fassoc (pattern, Valternate_fontname_alist);
+  if (NILP (patterns))
+    patterns = Fcons (pattern, Qnil);
+
+  for (; CONSP (patterns); patterns = XCDR (patterns))
+    {
+      pattern = XCAR (patterns);
+
+      if (!STRINGP (pattern))
+        continue;
+
       tem = XCAR (XCDR (dpyinfo->name_list_element));
       key = Fcons (pattern, make_number (maxnames));
 
-      newlist = Fassoc (key, tem);
-      if (!NILP (newlist))
+      list = Fassoc (key, tem);
+      if (!NILP (list))
 	{
-	  newlist = Fcdr_safe (newlist);
+	  list = Fcdr_safe (list);
+	  /* We have a cashed list.  Don't have to get the list again.  */
 	  goto label_cached;
 	}
-    }
-
-  BLOCK_INPUT;
-  newlist = mac_do_list_fonts (SDATA (pattern), maxnames);
-  UNBLOCK_INPUT;
-
-  /* MAC_TODO: add code for matching outline fonts here */
-
-  if (dpyinfo)
-    {
+
+      BLOCK_INPUT;
+      list = mac_do_list_fonts (SDATA (pattern), maxnames);
+      UNBLOCK_INPUT;
+
+      /* MAC_TODO: add code for matching outline fonts here */
+
+      /* Now store the result in the cache.  */
       XSETCAR (XCDR (dpyinfo->name_list_element),
-	       Fcons (Fcons (key, newlist),
+	       Fcons (Fcons (key, list),
 		      XCAR (XCDR (dpyinfo->name_list_element))));
-    }
- label_cached:
-
-  return newlist;
+
+    label_cached:
+      if (NILP (list)) continue; /* Try the remaining alternatives.  */
+    }
+
+  return list;
 }
 
 
@@ -6668,7 +6585,7 @@
 }
 
 
-const int kDefaultFontSize = 9;
+const int kDefaultFontSize = 12;
 
 
 /* XLoadQueryFont creates and returns an internal representation for a
@@ -6680,17 +6597,25 @@
 static MacFontStruct *
 XLoadQueryFont (Display *dpy, char *fontname)
 {
-  int i, size, is_two_byte_font, char_width;
+  int i, size, point_size, avgwidth, is_two_byte_font, char_width;
   char *name;
   GrafPtr port;
   SInt16 old_fontnum, old_fontsize;
   Style old_fontface;
-  Str32 mfontname;
+  Str32 mfontname, mfontname_decoded, charset;
   SInt16 fontnum;
-  Style fontface = normal;
+  Style fontface;
+#if TARGET_API_MAC_CARBON
+  TextEncoding encoding;
+  int scriptcode;
+#else
+  short scriptcode;
+#endif
   MacFontStruct *font;
   FontInfo the_fontinfo;
-  char s_weight[7], c_slant;
+#ifdef MAC_OSX
+  UInt32 old_flags, new_flags;
+#endif
 
   if (is_fully_specified_xlfd (fontname))
     name = fontname;
@@ -6715,46 +6640,50 @@
   old_fontface = port->txFace;
 #endif
 
-  if (sscanf (name, "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%d-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%*s", &size) != 1)
+  if (sscanf (name, "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%d-%d-%*[^-]-%*[^-]-%*c-%d-%*s", &size, &point_size, &avgwidth) != 3)
+    size = 0;
+  else
+    {
+      if (size == 0)
+	if (point_size > 0)
+	  size = point_size / 10;
+	else if (avgwidth > 0)
+	  size = avgwidth / 10;
+    }
+  if (size == 0)
     size = kDefaultFontSize;
 
-  if (sscanf (name, "-%*[^-]-%*[^-]-%6[^-]-%*c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%*s", s_weight) == 1)
-    if (strcmp (s_weight, "bold") == 0)
-      fontface |= bold;
-
-  if (sscanf (name, "-%*[^-]-%*[^-]-%*[^-]-%c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%*s", &c_slant) == 1)
-    if (c_slant == 'i')
-      fontface |= italic;
-
-  x_font_name_to_mac_font_name (name, mfontname);
+  x_font_name_to_mac_font_name (name, mfontname, mfontname_decoded,
+				&fontface, charset);
   c2pstr (mfontname);
+#if TARGET_API_MAC_CARBON
+  fontnum = FMGetFontFamilyFromName (mfontname);
+  if (fontnum == kInvalidFontFamily
+      || FMGetFontFamilyTextEncoding (fontnum, &encoding) != noErr)
+    return NULL;
+  scriptcode = GetTextEncodingBase (encoding);
+#else
   GetFNum (mfontname, &fontnum);
   if (fontnum == 0)
     return NULL;
+  scriptcode = FontToScript (fontnum);
+#endif
 
   font = (MacFontStruct *) xmalloc (sizeof (struct MacFontStruct));
 
-  font->fontname = (char *) xmalloc (strlen (name) + 1);
-  bcopy (name, font->fontname, strlen (name) + 1);
-
   font->mac_fontnum = fontnum;
   font->mac_fontsize = size;
   font->mac_fontface = fontface;
-  font->mac_scriptcode = FontToScript (fontnum);
+  font->mac_scriptcode = scriptcode;
 
   /* Apple Japanese (SJIS) font is listed as both
      "*-jisx0208.1983-sjis" (Japanese script) and "*-jisx0201.1976-0"
      (Roman script) in init_font_name_table ().  The latter should be
      treated as a one-byte font.  */
-  {
-    char cs[32];
-
-    if (sscanf (name,
-		"-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s",
-		cs) == 1
-	&& 0 == strcmp (cs, "jisx0201.1976-0"))
-      font->mac_scriptcode = smRoman;
-  }
+  if (scriptcode == smJapanese && strcmp (charset, "jisx0201.1976-0") == 0)
+    font->mac_scriptcode = smRoman;
+
+  font->full_name = mac_to_x_fontname (mfontname_decoded, size, fontface, charset);
 
   is_two_byte_font = font->mac_scriptcode == smJapanese ||
                      font->mac_scriptcode == smTradChinese ||
@@ -6879,7 +6808,7 @@
      struct mac_display_info *dpyinfo;
      XFontStruct *font;
 {
-  xfree (font->fontname);
+  xfree (font->full_name);
   if (font->per_char)
     xfree (font->per_char);
   xfree (font);
@@ -6919,6 +6848,8 @@
 			      SDATA (XCAR (tail)))))
 	    return (dpyinfo->font_table + i);
     }
+  else
+    return NULL;
 
   /* Load the font and add it to the table.  */
   {
@@ -6928,13 +6859,7 @@
     unsigned long value;
     int i;
 
-    /* If we have found fonts by x_list_font, load one of them.  If
-       not, we still try to load a font by the name given as FONTNAME
-       because XListFonts (called in x_list_font) of some X server has
-       a bug of not finding a font even if the font surely exists and
-       is loadable by XLoadQueryFont.  */
-    if (size > 0 && !NILP (font_names))
-      fontname = (char *) SDATA (XCAR (font_names));
+    fontname = (char *) SDATA (XCAR (font_names));
 
     BLOCK_INPUT;
     font = (MacFontStruct *) XLoadQueryFont (FRAME_MAC_DISPLAY (f), fontname);
@@ -6967,8 +6892,8 @@
     bzero (fontp, sizeof (*fontp));
     fontp->font = font;
     fontp->font_idx = i;
-    fontp->name = (char *) xmalloc (strlen (font->fontname) + 1);
-    bcopy (font->fontname, fontp->name, strlen (font->fontname) + 1);
+    fontp->name = (char *) xmalloc (strlen (fontname) + 1);
+    bcopy (fontname, fontp->name, strlen (fontname) + 1);
 
     if (font->min_bounds.width == font->max_bounds.width)
       {
@@ -6999,7 +6924,8 @@
 	  fontp->average_width = FONT_WIDTH (font);
       }
 
-    fontp->full_name = fontp->name;
+    fontp->full_name = (char *) xmalloc (strlen (font->full_name) + 1);
+    bcopy (font->full_name, fontp->full_name, strlen (font->full_name) + 1);
 
     fontp->size = font->max_bounds.width;
     fontp->height = FONT_HEIGHT (font);
@@ -9811,18 +9737,6 @@
   Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop");
   staticpro (&Qmac_ready_for_drag_n_drop);
 
-  Qbig5 = intern ("big5");
-  staticpro (&Qbig5);
-
-  Qcn_gb = intern ("cn-gb");
-  staticpro (&Qcn_gb);
-
-  Qsjis = intern ("sjis");
-  staticpro (&Qsjis);
-
-  Qeuc_kr = intern ("euc-kr");
-  staticpro (&Qeuc_kr);
-
   DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
 	       doc: /* If not nil, Emacs uses toolkit scroll bars.  */);
   Vx_toolkit_scroll_bars = Qt;
@@ -9889,6 +9803,22 @@
 The text will be rendered using Core Graphics text rendering which
 may anti-alias the text.  */);
   Vmac_use_core_graphics = Qnil;
+
+  /* Register an entry for `mac-roman' so that it can be used when
+     creating the terminal frame on Mac OS 9 before loading
+     term/mac-win.elc.  */
+  DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist,
+               doc: /* Alist linking Emacs character sets to Mac text encoding and Emacs coding system.
+Each entry should be of the form:
+
+   (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM)
+
+where CHARSET-NAME is a string used in font names to identify the
+charset, TEXT-ENCODING is a TextEncodingBase value, and CODING_SYSTEM
+is a coding system corresponding to TEXT-ENCODING.  */);
+  Vmac_charset_info_alist =
+    Fcons (list3 (build_string ("mac-roman"),
+		  make_number (smRoman), Qnil), Qnil);
 }
 
 /* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b
--- a/src/xdisp.c	Tue Apr 19 13:33:31 2005 +0000
+++ b/src/xdisp.c	Mon Apr 25 11:47:55 2005 +0000
@@ -2702,6 +2702,10 @@
   it->dpvec = NULL;
   it->current.dpvec_index = -1;
 
+  /* Use face of preceding text for ellipsis (if invisible) */
+  if (it->selective_display_ellipsis_p)
+    it->saved_face_id = it->face_id;
+
   do
     {
       handled = HANDLED_NORMALLY;
@@ -3379,8 +3383,11 @@
   it->dpvec_face_id = -1;
 
   /* Remember the current face id in case glyphs specify faces.
-     IT's face is restored in set_iterator_to_next.  */
-  it->saved_face_id = it->face_id;
+     IT's face is restored in set_iterator_to_next.
+     saved_face_id was set to preceding char's face in handle_stop.  */
+  if (it->saved_face_id < 0 || it->saved_face_id != it->face_id)
+    it->saved_face_id = it->face_id = DEFAULT_FACE_ID;
+
   it->method = GET_FROM_DISPLAY_VECTOR;
   it->ellipsis_p = 1;
 }
@@ -5419,6 +5426,8 @@
   /* Precondition.  */
   xassert (it->dpvec && it->current.dpvec_index >= 0);
 
+  it->face_id = it->saved_face_id;
+
   if (INTEGERP (*it->dpvec)
       && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec)))
     {
--- a/src/xfaces.c	Tue Apr 19 13:33:31 2005 +0000
+++ b/src/xfaces.c	Mon Apr 25 11:47:55 2005 +0000
@@ -3228,25 +3228,19 @@
      Lisp_Object face_name;
 {
   Lisp_Object aliased;
-  Lisp_Object args[2];
-  int c = 0;
+  int alias_loop_max = 10;
 
   if (STRINGP (face_name))
     face_name = intern (SDATA (face_name));
 
-  /* Protect against loops by limiting the number of indirections.  */
-  while (SYMBOLP (face_name) && c < 10)
-    {
-      /* Fget can signal an error; just ignore it.  */
-      args[0] = face_name;
-      args[1] = Qface_alias;
-      aliased = internal_condition_case_2 (internal_resolve_face_name, 2, args, Qt,
-                                           resolve_face_name_error);
+  while (SYMBOLP (face_name))
+    {
+      aliased = Fsafe_get (face_name, Qface_alias);
       if (NILP (aliased))
 	break;
-      else
-	face_name = aliased;
-      c++;
+      if (--alias_loop_max == 0)
+	break;
+      face_name = aliased;
     }
 
   return face_name;