aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2005-04-25 11:47:55 +0000
committerKaroly Lorentey2005-04-25 11:47:55 +0000
commit5ad1bc4dead80db3e81a6855714bc0b5817f5fc0 (patch)
treed9a6baba163ca50b60f19b3f63adeb29dac2071b
parent8d6f9bce72ee94ed6c297b79a181eac3f5beca74 (diff)
parent37c5c4a7273ea3e538d3aab8862645b9096af738 (diff)
downloademacs-5ad1bc4dead80db3e81a6855714bc0b5817f5fc0.tar.gz
emacs-5ad1bc4dead80db3e81a6855714bc0b5817f5fc0.zip
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
-rw-r--r--admin/ChangeLog4
-rw-r--r--admin/make-tarball.txt13
-rw-r--r--etc/NEWS21
-rw-r--r--lisp/ChangeLog50
-rw-r--r--lisp/bindings.el23
-rw-r--r--lisp/loadhist.el85
-rw-r--r--lisp/paren.el8
-rw-r--r--lisp/progmodes/flymake.el11
-rw-r--r--lisp/simple.el17
-rw-r--r--lisp/subr.el4
-rw-r--r--lisp/term/mac-win.el401
-rw-r--r--lisp/tooltip.el2
-rw-r--r--lispref/ChangeLog15
-rw-r--r--lispref/modes.texi13
-rw-r--r--lispref/streams.texi2
-rw-r--r--lispref/strings.texi3
-rw-r--r--lispref/symbols.texi8
-rw-r--r--man/ChangeLog6
-rw-r--r--man/building.texi9
-rw-r--r--src/ChangeLog55
-rw-r--r--src/fns.c13
-rw-r--r--src/lisp.h1
-rw-r--r--src/macgui.h6
-rw-r--r--src/macterm.c724
-rw-r--r--src/xdisp.c13
-rw-r--r--src/xfaces.c18
26 files changed, 755 insertions, 770 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 64e9c806d4c..03f5e0ed066 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,7 @@
12005-04-19 Lute Kamstra <lute@gnu.org>
2
3 * make-tarball.txt: Don't commit lisp/loaddefs.el.
4
12005-04-14 Lute Kamstra <lute@gnu.org> 52005-04-14 Lute Kamstra <lute@gnu.org>
2 6
3 * nt/makedist.bat (elfiles): Update. 7 * nt/makedist.bat (elfiles): Update.
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index 30f5dc33082..4ca4a21feab 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -21,10 +21,11 @@ For each step, check for possible errors.
21 21
225. rm configure; make bootstrap 225. rm configure; make bootstrap
23 23
246. Commit configure, README, AUTHORS, lisp/loaddefs.el, 246. Commit configure, README, AUTHORS, lisp/cus-load.el,
25 lisp/cus-load.el, lisp/finder-inf.el, lisp/version.el, 25 lisp/finder-inf.el, lisp/version.el, man/emacs.texi.
26 man/emacs.texi. For a release, also commit the ChangeLog files in 26 Copy lisp/loaddefs.el to lisp/ldefs-boot.el and commit
27 all directories. 27 lisp/ldefs-boot.el. For a release, also commit the ChangeLog
28 files in all directories.
28 29
297. make-dist --snapshot. Check the contents of the new tar with 307. make-dist --snapshot. Check the contents of the new tar with
30 admin/diff-tar-files against an older tar file. Some old pretest 31 admin/diff-tar-files against an older tar file. Some old pretest
@@ -34,12 +35,12 @@ For each step, check for possible errors.
348. xdelta delta emacs-OLD.tar.gz emacs-NEW.tar.gz emacs-OLD-NEW.xdelta 358. xdelta delta emacs-OLD.tar.gz emacs-NEW.tar.gz emacs-OLD-NEW.xdelta
35 36
369. tar -zxf emacs-NEW.tar.gz; cd emacs-NEW 379. tar -zxf emacs-NEW.tar.gz; cd emacs-NEW
37 configure && make && make -n install 38 ./configure && make && make -n install
38 Use `script' or M-x compile to save the compilation log in 39 Use `script' or M-x compile to save the compilation log in
39 compile-NEW.log and compare it against an old one. The easiest way 40 compile-NEW.log and compare it against an old one. The easiest way
40 to do that is to visit the old log in Emacs, change the version 41 to do that is to visit the old log in Emacs, change the version
41 number of the old Emacs to __, do the same with the new log and do 42 number of the old Emacs to __, do the same with the new log and do
42 M-x ediff. Especially check that Info files aren't built. 43 M-x ediff. Especially check that Info files aren't built.
43 44
4410. cd EMACS_ROOT_DIR; cvs tag TAG 4510. cd EMACS_ROOT_DIR; cvs tag TAG
45 TAG is EMACS_PRETEST_XX_YY_ZZZ for a pretest, EMACS_XX_YY for a 46 TAG is EMACS_PRETEST_XX_YY_ZZZ for a pretest, EMACS_XX_YY for a
diff --git a/etc/NEWS b/etc/NEWS
index 4696853e27d..cb383d0534c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -142,7 +142,11 @@ commands cp, mv, and ln follow.) Thus, M-x copy-file RET ~/foo RET
142M-o M-o requests refontification. 142M-o M-o requests refontification.
143 143
144+++ 144+++
145** M-g is now a prefix key. M-g g and M-g M-g run goto-line. 145** M-g is now a prefix key.
146
147M-g g and M-g M-g run goto-line.
148M-g n and M-g M-n run next-error (like C-x `).
149M-g p and M-g M-p run previous-error.
146 150
147+++ 151+++
148** font-lock-lines-before specifies a number of lines before the 152** font-lock-lines-before specifies a number of lines before the
@@ -309,8 +313,9 @@ characters.
309in the current input method to input a character at point. 313in the current input method to input a character at point.
310 314
311+++ 315+++
312** Convenient commands to switch buffers in a cyclic order are C-x <left> 316** You can now switch buffers in a cyclic order with C-x C-left and
313(prev-buffer) and C-x <right> (next-buffer). 317(prev-buffer) and C-x C-right (next-buffer). C-x left and C-x right
318can be used as well.
314 319
315--- 320---
316** Commands winner-redo and winner-undo, from winner.el, are now bound to 321** Commands winner-redo and winner-undo, from winner.el, are now bound to
@@ -4190,9 +4195,15 @@ This returns the mode-line or header-line of the selected (or a
4190specified) window as a string with or without text properties. 4195specified) window as a string with or without text properties.
4191 4196
4192+++ 4197+++
4193** New function safe-plist-get. 4198** New function `safe-get'.
4199
4200This function is like `get', but never signals an error for
4201a malformed symbol property list.
4202
4203+++
4204** New function `safe-plist-get'.
4194 4205
4195This function is like plist-get, but never signals an error for 4206This function is like `plist-get', but never signals an error for
4196a malformed property list. 4207a malformed property list.
4197 4208
4198+++ 4209+++
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4d8e8c6dd52..b4437f350da 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,53 @@
12005-04-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * term/mac-win.el (mac-symbol-encoder): Fix mappings of left and
4 right angle brackets.
5
62005-04-20 Nick Roberts <nickrob@snap.net.nz>
7
8 * tooltip.el (tooltip-use-echo-area): Replace as alias and deprecate.
9
102005-04-19 Stefan Monnier <monnier@iro.umontreal.ca>
11
12 * progmodes/flymake.el (flymake-get-absolute-file-name-basedir):
13 Remove. Update callers to use expand-file-name instead.
14
15 * subr.el (syntax-class): New function.
16
17 * simple.el (blink-matching-open): Use it.
18
19 * paren.el (show-paren-function): Use it to recognize parens that are
20 also used in 2-char comment markers.
21
222005-04-19 Lute Kamstra <lute@gnu.org>
23
24 * loadhist.el (unload-feature): Update for new format of
25 load-history. Simplify the code.
26
272005-04-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
28
29 * term/mac-win.el: Add coding: tag and set it to iso-2022-7bit.
30 (mac-add-charset-info): New function. Initialize variable
31 mac-charset-info-alist using it.
32 (mac-centraleurroman, mac-cyrillic): Do not use UCS in table data
33 for translation.
34 (mac-symbol-encoder, mac-dingbats-encoder): New translation table.
35 (mac-font-encoder-list): Add entries for mac-symbol and mac-dingbats.
36 (ccl-encode-mac-symbol-font, ccl-encode-mac-dingbats-font):
37 New CCL programs.
38
392005-04-19 Kim F. Storm <storm@cua.dk>
40
41 * simple.el (next-buffer, prev-buffer, next-error)
42 (scroll-other-window, keyboard-quit, keyboard-escape-quit)
43 (clone-indirect-buffer-other-window): Move bindings to bindings.el.
44
45 * bindings.el (next-buffer, prev-buffer, next-error)
46 (scroll-other-window, keyboard-quit, keyboard-escape-quit)
47 (clone-indirect-buffer-other-window): Move bindings from simple.el.
48 (next-buffer, prev-buffer): Add C-x C-right and C-x C-left bindings.
49 (next-error, previous-error): Add M-g M-n/n and M-g M-p/p bindings.
50
12005-04-18 Stefan Monnier <monnier@iro.umontreal.ca> 512005-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 52
3 * isearch.el (isearch-edit-string): Make the search-ring available for 53 * isearch.el (isearch-edit-string): Make the search-ring available for
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 52a91378275..fa10873c33b 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -628,6 +628,10 @@ language you are using."
628;; (define-key ctl-x-map "n" 'narrow-to-region) 628;; (define-key ctl-x-map "n" 'narrow-to-region)
629;; (define-key ctl-x-map "w" 'widen) 629;; (define-key ctl-x-map "w" 'widen)
630 630
631;; Quitting
632(define-key global-map "\e\e\e" 'keyboard-escape-quit)
633(define-key global-map "\C-g" 'keyboard-quit)
634
631(define-key global-map "\C-j" 'newline-and-indent) 635(define-key global-map "\C-j" 'newline-and-indent)
632(define-key global-map "\C-m" 'newline) 636(define-key global-map "\C-m" 'newline)
633(define-key global-map "\C-o" 'open-line) 637(define-key global-map "\C-o" 'open-line)
@@ -652,9 +656,18 @@ language you are using."
652;; Many people are used to typing C-/ on X terminals and getting C-_. 656;; Many people are used to typing C-/ on X terminals and getting C-_.
653(define-key global-map [?\C-/] 'undo) 657(define-key global-map [?\C-/] 'undo)
654(define-key global-map "\C-_" 'undo) 658(define-key global-map "\C-_" 'undo)
659;; Richard said that we should not use C-x <uppercase letter> and I have
660;; no idea whereas to bind it. Any suggestion welcome. -stef
661;; (define-key ctl-x-map "U" 'undo-only)
662
655(define-key esc-map "!" 'shell-command) 663(define-key esc-map "!" 'shell-command)
656(define-key esc-map "|" 'shell-command-on-region) 664(define-key esc-map "|" 'shell-command-on-region)
657 665
666(define-key global-map [?\C-x right] 'next-buffer)
667(define-key global-map [?\C-x C-right] 'next-buffer)
668(define-key global-map [?\C-x left] 'prev-buffer)
669(define-key global-map [?\C-x C-left] 'prev-buffer)
670
658(let ((map minibuffer-local-map)) 671(let ((map minibuffer-local-map))
659 (define-key map "\en" 'next-history-element) 672 (define-key map "\en" 'next-history-element)
660 (define-key map [next] 'next-history-element) 673 (define-key map [next] 'next-history-element)
@@ -709,6 +722,13 @@ language you are using."
709(define-key esc-map "g\M-g" 'goto-line) 722(define-key esc-map "g\M-g" 'goto-line)
710(define-key esc-map "gg" 'goto-line) 723(define-key esc-map "gg" 'goto-line)
711 724
725(define-key esc-map "gn" 'next-error)
726(define-key esc-map "g\M-n" 'next-error)
727(define-key ctl-x-map "`" 'next-error)
728
729(define-key esc-map "gp" 'previous-error)
730(define-key esc-map "g\M-p" 'previous-error)
731
712;;(defun function-key-error () 732;;(defun function-key-error ()
713;; (interactive) 733;; (interactive)
714;; (error "That function key is not bound to anything")) 734;; (error "That function key is not bound to anything"))
@@ -737,6 +757,7 @@ language you are using."
737(define-key global-map [C-next] 'scroll-left) 757(define-key global-map [C-next] 'scroll-left)
738(define-key global-map [M-next] 'scroll-other-window) 758(define-key global-map [M-next] 'scroll-other-window)
739(define-key global-map [M-prior] 'scroll-other-window-down) 759(define-key global-map [M-prior] 'scroll-other-window-down)
760(define-key esc-map [?\C-\S-v] 'scroll-other-window-down)
740(define-key global-map [end] 'end-of-line) 761(define-key global-map [end] 'end-of-line)
741(define-key global-map [C-end] 'end-of-buffer) 762(define-key global-map [C-end] 'end-of-buffer)
742(define-key global-map [M-end] 'end-of-buffer-other-window) 763(define-key global-map [M-end] 'end-of-buffer-other-window)
@@ -1020,6 +1041,8 @@ language you are using."
1020 1041
1021(define-key ctl-x-map "z" 'repeat) 1042(define-key ctl-x-map "z" 'repeat)
1022 1043
1044(define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window)
1045
1023;; Don't look for autoload cookies in this file. 1046;; Don't look for autoload cookies in this file.
1024;; Local Variables: 1047;; Local Variables:
1025;; no-update-autoloads: t 1048;; no-update-autoloads: t
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 473c8dc3bc8..1c71cc6cd07 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -1,6 +1,6 @@
1;;; loadhist.el --- lisp functions for working with feature groups 1;;; loadhist.el --- lisp functions for working with feature groups
2 2
3;; Copyright (C) 1995, 1998, 2000 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1998, 2000, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Eric S. Raymond <esr@snark.thyrsus.com> 5;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -155,16 +155,16 @@ variable `unload-hook-features-list' and could remove features from it
155in the event that the package has done something normally-ill-advised, 155in the event that the package has done something normally-ill-advised,
156such as redefining an Emacs function." 156such as redefining an Emacs function."
157 (interactive (list (read-feature "Feature: ") current-prefix-arg)) 157 (interactive (list (read-feature "Feature: ") current-prefix-arg))
158 (if (not (featurep feature)) 158 (unless (featurep feature)
159 (error "%s is not a currently loaded feature" (symbol-name feature))) 159 (error "%s is not a currently loaded feature" (symbol-name feature)))
160 (if (not force) 160 (unless force
161 (let* ((file (feature-file feature)) 161 (let* ((file (feature-file feature))
162 (dependents (delete file (copy-sequence (file-dependents file))))) 162 (dependents (delete file (copy-sequence (file-dependents file)))))
163 (if dependents 163 (when dependents
164 (error "Loaded libraries %s depend on %s" 164 (error "Loaded libraries %s depend on %s"
165 (prin1-to-string dependents) file)))) 165 (prin1-to-string dependents) file))))
166 (let* ((unload-hook-features-list (feature-symbols feature)) 166 (let* ((unload-hook-features-list (feature-symbols feature))
167 (file (car unload-hook-features-list)) 167 (file (pop unload-hook-features-list))
168 (unload-hook (intern-soft (concat (symbol-name feature) 168 (unload-hook (intern-soft (concat (symbol-name feature)
169 "-unload-hook")))) 169 "-unload-hook"))))
170 ;; Try to avoid losing badly when hooks installed in critical 170 ;; Try to avoid losing badly when hooks installed in critical
@@ -183,38 +183,39 @@ such as redefining an Emacs function."
183 ;; normally works. 183 ;; normally works.
184 (mapatoms 184 (mapatoms
185 (lambda (x) 185 (lambda (x)
186 (if (or (and (boundp x) ; Random hooks. 186 (when (and (boundp x)
187 (consp (symbol-value x)) 187 (or (and (consp (symbol-value x)) ; Random hooks.
188 (string-match "-hooks?\\'" (symbol-name x))) 188 (string-match "-hooks?\\'" (symbol-name x)))
189 (and (boundp x) ; Known abnormal hooks etc. 189 (memq x unload-feature-special-hooks))) ; Known abnormal hooks etc.
190 (memq x unload-feature-special-hooks))) 190 (dolist (y unload-hook-features-list)
191 (dolist (y (cdr unload-hook-features-list)) 191 (when (eq (car-safe y) 'defun)
192 (remove-hook x y)))))) 192 (remove-hook x (cdr y))))))))
193 (if (fboundp 'elp-restore-function) ; remove ELP stuff first 193 (when (fboundp 'elp-restore-function) ; remove ELP stuff first
194 (dolist (elt (cdr unload-hook-features-list)) 194 (dolist (elt unload-hook-features-list)
195 (if (symbolp elt) 195 (when (symbolp elt)
196 (elp-restore-function elt)))) 196 (elp-restore-function elt))))
197 (dolist (x (cdr unload-hook-features-list)) 197 (dolist (x unload-hook-features-list)
198 (when (consp x) 198 (if (consp x)
199 ;; Remove any feature names that this file provided. 199 (progn
200 (if (eq (car x) 'provide) 200 ;; Remove any feature names that this file provided.
201 (setq features (delq (cdr x) features))) 201 (when (eq (car x) 'provide)
202 (when (eq (car x) 'defvar) 202 (setq features (delq (cdr x) features)))
203 ;; Kill local values as much as possible. 203 (when (eq (car x) 'defun)
204 (dolist (buf (buffer-list)) 204 (let ((fun (cdr x)))
205 (with-current-buffer buf 205 (when (fboundp fun)
206 (kill-local-variable (cdr x)))) 206 (when (fboundp 'ad-unadvise)
207 ;; Get rid of the default binding if we can. 207 (ad-unadvise fun))
208 (unless (local-variable-if-set-p (cdr x)) 208 (fmakunbound fun)
209 (makunbound (cdr x)))) 209 (let ((aload (get fun 'autoload)))
210 (when (eq (car x) 'defun) 210 (when aload
211 (let ((fun (cdr x))) 211 (fset fun (cons 'autoload aload))))))))
212 (when (fboundp fun) 212 ;; Kill local values as much as possible.
213 (if (fboundp 'ad-unadvise) 213 (dolist (buf (buffer-list))
214 (ad-unadvise fun)) 214 (with-current-buffer buf
215 (fmakunbound fun) 215 (kill-local-variable x)))
216 (let ((aload (get fun 'autoload))) 216 ;; Get rid of the default binding if we can.
217 (if aload (fset fun (cons 'autoload aload))))))))) 217 (unless (local-variable-if-set-p x)
218 (makunbound x))))
218 ;; Delete the load-history element for this file. 219 ;; Delete the load-history element for this file.
219 (let ((elt (assoc file load-history))) 220 (let ((elt (assoc file load-history)))
220 (setq load-history (delq elt load-history))))) 221 (setq load-history (delq elt load-history)))))
diff --git a/lisp/paren.el b/lisp/paren.el
index 63300ce6238..fe2beae4edd 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -1,6 +1,6 @@
1;;; paren.el --- highlight matching paren 1;;; paren.el --- highlight matching paren
2 2
3;; Copyright (C) 1993, 1996, 2001, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1996, 2001, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: rms@gnu.org 5;; Author: rms@gnu.org
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -139,8 +139,8 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time."
139(defun show-paren-function () 139(defun show-paren-function ()
140 (if show-paren-mode 140 (if show-paren-mode
141 (let ((oldpos (point)) 141 (let ((oldpos (point))
142 (dir (cond ((eq (car (syntax-after (1- (point)))) 5) -1) 142 (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1)
143 ((eq (car (syntax-after (point))) 4) 1))) 143 ((eq (syntax-class (syntax-after (point))) 4) 1)))
144 pos mismatch face) 144 pos mismatch face)
145 ;; 145 ;;
146 ;; Find the other end of the sexp. 146 ;; Find the other end of the sexp.
@@ -169,7 +169,7 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time."
169 ;; kind of paren to match the one we started at. 169 ;; kind of paren to match the one we started at.
170 (when (integerp pos) 170 (when (integerp pos)
171 (let ((beg (min pos oldpos)) (end (max pos oldpos))) 171 (let ((beg (min pos oldpos)) (end (max pos oldpos)))
172 (unless (eq (car (syntax-after beg)) 8) ;Not syntax `$'. 172 (unless (eq (syntax-class (syntax-after beg)) 8)
173 (setq mismatch 173 (setq mismatch
174 (not (or (eq (char-before end) 174 (not (or (eq (char-before end)
175 ;; This can give nil. 175 ;; This can give nil.
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 7067ddca21c..73d77affdc4 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1765,7 +1765,7 @@ Return full-name. Names are real, not patched."
1765 (this-real-name (nth 1 (nth (1- file-count) files)))) 1765 (this-real-name (nth 1 (nth (1- file-count) files))))
1766 ;;+(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) 1766 ;;+(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)
1767 (when (and this-dir this-file (flymake-same-files 1767 (when (and this-dir this-file (flymake-same-files
1768 (flymake-get-absolute-file-name-basedir file-name-from-err-msg this-dir) 1768 (expand-file-name file-name-from-err-msg this-dir)
1769 this-file)) 1769 this-file))
1770 (setq real-name this-real-name))) 1770 (setq real-name this-real-name)))
1771 (setq file-count (1- file-count))) 1771 (setq file-count (1- file-count)))
@@ -1778,18 +1778,13 @@ Return full-name. Names are real, not patched."
1778 (setq real-name file-name-from-err-msg) 1778 (setq real-name file-name-from-err-msg)
1779 (let* ((base-dirs-count (length base-dirs))) 1779 (let* ((base-dirs-count (length base-dirs)))
1780 (while (and (not real-name) (> base-dirs-count 0)) 1780 (while (and (not real-name) (> base-dirs-count 0))
1781 (let* ((full-name (flymake-get-absolute-file-name-basedir file-name-from-err-msg 1781 (let* ((full-name (expand-file-name file-name-from-err-msg
1782 (nth (1- base-dirs-count) base-dirs)))) 1782 (nth (1- base-dirs-count) base-dirs))))
1783 (if (file-exists-p full-name) 1783 (if (file-exists-p full-name)
1784 (setq real-name full-name)) 1784 (setq real-name full-name))
1785 (setq base-dirs-count (1- base-dirs-count)))))) 1785 (setq base-dirs-count (1- base-dirs-count))))))
1786 real-name)) 1786 real-name))
1787 1787
1788(defun flymake-get-absolute-file-name-basedir (file-name dir-name)
1789 (if (file-name-absolute-p file-name)
1790 file-name
1791 (concat dir-name "/" file-name)))
1792
1793(defun flymake-init-find-buildfile-dir (buffer source-file-name buildfile-name) 1788(defun flymake-init-find-buildfile-dir (buffer source-file-name buildfile-name)
1794 "Find buildfile, store its dir in buffer data and return its dir, if found." 1789 "Find buildfile, store its dir in buffer data and return its dir, if found."
1795 (let* ((buildfile-dir (flymake-find-buildfile buildfile-name 1790 (let* ((buildfile-dir (flymake-find-buildfile buildfile-name
diff --git a/lisp/simple.el b/lisp/simple.el
index 1b7b40a367a..cc66ef12d16 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -51,8 +51,6 @@ wait this many seconds after Emacs becomes idle before doing an update."
51 "Highlight (un)matching of parens and expressions." 51 "Highlight (un)matching of parens and expressions."
52 :group 'matching) 52 :group 'matching)
53 53
54(define-key global-map [?\C-x right] 'next-buffer)
55(define-key global-map [?\C-x left] 'prev-buffer)
56(defun next-buffer () 54(defun next-buffer ()
57 "Switch to the next buffer in cyclic order." 55 "Switch to the next buffer in cyclic order."
58 (interactive) 56 (interactive)
@@ -258,8 +256,6 @@ See variables `compilation-parse-errors-function' and
258(defalias 'goto-next-locus 'next-error) 256(defalias 'goto-next-locus 'next-error)
259(defalias 'next-match 'next-error) 257(defalias 'next-match 'next-error)
260 258
261(define-key ctl-x-map "`" 'next-error)
262
263(defun previous-error (&optional n) 259(defun previous-error (&optional n)
264 "Visit previous next-error message and corresponding source code. 260 "Visit previous next-error message and corresponding source code.
265 261
@@ -1398,9 +1394,6 @@ A numeric argument serves as a repeat count.
1398Contrary to `undo', this will not redo a previous undo." 1394Contrary to `undo', this will not redo a previous undo."
1399 (interactive "*p") 1395 (interactive "*p")
1400 (let ((undo-no-redo t)) (undo arg))) 1396 (let ((undo-no-redo t)) (undo arg)))
1401;; Richard said that we should not use C-x <uppercase letter> and I have
1402;; no idea whereas to bind it. Any suggestion welcome. -stef
1403;; (define-key ctl-x-map "U" 'undo-only)
1404 1397
1405(defvar undo-in-progress nil 1398(defvar undo-in-progress nil
1406 "Non-nil while performing an undo. 1399 "Non-nil while performing an undo.
@@ -3635,7 +3628,6 @@ For more details, see the documentation for `scroll-other-window'."
3635 (if (eq lines '-) nil 3628 (if (eq lines '-) nil
3636 (if (null lines) '- 3629 (if (null lines) '-
3637 (- (prefix-numeric-value lines)))))) 3630 (- (prefix-numeric-value lines))))))
3638(define-key esc-map [?\C-\S-v] 'scroll-other-window-down)
3639 3631
3640(defun beginning-of-buffer-other-window (arg) 3632(defun beginning-of-buffer-other-window (arg)
3641 "Move point to the beginning of the buffer in the other window. 3633 "Move point to the beginning of the buffer in the other window.
@@ -4205,11 +4197,12 @@ when it is off screen)."
4205 (setq blinkpos (scan-sexps oldpos -1))) 4197 (setq blinkpos (scan-sexps oldpos -1)))
4206 (error nil))) 4198 (error nil)))
4207 (and blinkpos 4199 (and blinkpos
4208 (not (eq (car (syntax-after blinkpos)) 8)) ;Not syntax '$'. 4200 ;; Not syntax '$'.
4201 (not (eq (syntax-class (syntax-after blinkpos)) 8))
4209 (setq matching-paren 4202 (setq matching-paren
4210 (let ((syntax (syntax-after blinkpos))) 4203 (let ((syntax (syntax-after blinkpos)))
4211 (and (consp syntax) 4204 (and (consp syntax)
4212 (eq (logand (car syntax) 255) 4) 4205 (eq (syntax-class syntax) 4)
4213 (cdr syntax))) 4206 (cdr syntax)))
4214 mismatch 4207 mismatch
4215 (or (null matching-paren) 4208 (or (null matching-paren)
@@ -4279,8 +4272,6 @@ At top-level, as an editor command, this simply beeps."
4279 (setq defining-kbd-macro nil) 4272 (setq defining-kbd-macro nil)
4280 (signal 'quit nil)) 4273 (signal 'quit nil))
4281 4274
4282(define-key global-map "\C-g" 'keyboard-quit)
4283
4284(defvar buffer-quit-function nil 4275(defvar buffer-quit-function nil
4285 "Function to call to \"quit\" the current buffer, or nil if none. 4276 "Function to call to \"quit\" the current buffer, or nil if none.
4286\\[keyboard-escape-quit] calls this function when its more local actions 4277\\[keyboard-escape-quit] calls this function when its more local actions
@@ -4323,7 +4314,6 @@ specification for `play-sound'."
4323 (push 'sound sound) 4314 (push 'sound sound)
4324 (play-sound sound))) 4315 (play-sound sound)))
4325 4316
4326(define-key global-map "\e\e\e" 'keyboard-escape-quit)
4327 4317
4328(defcustom read-mail-command 'rmail 4318(defcustom read-mail-command 'rmail
4329 "*Your preference for a mail reading package. 4319 "*Your preference for a mail reading package.
@@ -5116,7 +5106,6 @@ the front of the list of recently selected ones."
5116 (set-buffer buffer) 5106 (set-buffer buffer)
5117 (clone-indirect-buffer nil t norecord))) 5107 (clone-indirect-buffer nil t norecord)))
5118 5108
5119(define-key ctl-x-4-map "c" 'clone-indirect-buffer-other-window)
5120 5109
5121;;; Handling of Backspace and Delete keys. 5110;;; Handling of Backspace and Delete keys.
5122 5111
diff --git a/lisp/subr.el b/lisp/subr.el
index adaf2f481c9..a1384ab685d 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2298,6 +2298,10 @@ from `standard-syntax-table' otherwise."
2298 (if (consp st) st 2298 (if (consp st) st
2299 (aref (or st (syntax-table)) (char-after pos)))))) 2299 (aref (or st (syntax-table)) (char-after pos))))))
2300 2300
2301(defun syntax-class (syntax)
2302 "Return the syntax class part of the syntax descriptor SYNTAX."
2303 (logand (car syntax) 255))
2304
2301(defun add-to-invisibility-spec (arg) 2305(defun add-to-invisibility-spec (arg)
2302 "Add elements to `buffer-invisibility-spec'. 2306 "Add elements to `buffer-invisibility-spec'.
2303See documentation for `buffer-invisibility-spec' for the kind of elements 2307See documentation for `buffer-invisibility-spec' for the kind of elements
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index d5fd541c727..7cdaa2b7257 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1,4 +1,4 @@
1;;; mac-win.el --- parse switches controlling interface with Mac window system 1;;; mac-win.el --- parse switches controlling interface with Mac window system -*-coding: iso-2022-7bit;-*-
2 2
3;; Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 3;; Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
@@ -1105,6 +1105,31 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1105 base 1105 base
1106 (coding-system-change-eol-conversion base 'mac))) 1106 (coding-system-change-eol-conversion base 'mac)))
1107 "Coding system derived from the system script code.") 1107 "Coding system derived from the system script code.")
1108
1109(defun mac-add-charset-info (xlfd-charset mac-text-encoding)
1110 "Function to add character sets to display with Mac fonts.
1111Creates entries in `mac-charset-info-alist'.
1112XLFD-CHARSET is a string which will appear in the XLFD font name
1113to identify the character set. MAC-TEXT-ENCODING is the
1114correspoinding TextEncodingBase value."
1115 (add-to-list 'mac-charset-info-alist
1116 (list xlfd-charset mac-text-encoding
1117 (cdr (assq mac-text-encoding
1118 mac-script-code-coding-systems)))))
1119
1120(setq mac-charset-info-alist nil)
1121(mac-add-charset-info "mac-roman" 0)
1122(mac-add-charset-info "jisx0208.1983-sjis" 1)
1123(mac-add-charset-info "jisx0201.1976-0" 1)
1124(mac-add-charset-info "big5-0" 2)
1125(mac-add-charset-info "ksc5601.1989-0" 3)
1126(mac-add-charset-info "mac-cyrillic" 7)
1127(mac-add-charset-info "gb2312.1980-0" 25)
1128(mac-add-charset-info "mac-centraleurroman" 29)
1129(mac-add-charset-info "mac-symbol" 33)
1130(mac-add-charset-info "adobe-fontspecific" 33) ; for X-Symbol
1131(mac-add-charset-info "mac-dingbats" 34)
1132
1108 1133
1109;;;; Keyboard layout/language change events 1134;;;; Keyboard layout/language change events
1110(defun mac-handle-language-change (event) 1135(defun mac-handle-language-change (event)
@@ -1166,289 +1191,105 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1166 1191
1167(cp-make-coding-system 1192(cp-make-coding-system
1168 mac-centraleurroman 1193 mac-centraleurroman
1169 (apply 1194 [?\,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
1170 'vector 1195 ?\$,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
1171 (mapcar 1196 ?\$,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
1172 (lambda (c) (decode-char 'ucs c)) 1197 ?\$,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
1173 ;; mac-centraleurroman (128..255) -> UCS mapping 1198 ?\$,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
1174 [ #x00C4 ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS 1199 ?\$,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
1175 #x0100 ;; 129:LATIN CAPITAL LETTER A WITH MACRON 1200 ?\$,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
1176 #x0101 ;; 130:LATIN SMALL LETTER A WITH MACRON 1201 ?\$,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]
1177 #x00C9 ;; 131:LATIN CAPITAL LETTER E WITH ACUTE
1178 #x0104 ;; 132:LATIN CAPITAL LETTER A WITH OGONEK
1179 #x00D6 ;; 133:LATIN CAPITAL LETTER O WITH DIAERESIS
1180 #x00DC ;; 134:LATIN CAPITAL LETTER U WITH DIAERESIS
1181 #x00E1 ;; 135:LATIN SMALL LETTER A WITH ACUTE
1182 #x0105 ;; 136:LATIN SMALL LETTER A WITH OGONEK
1183 #x010C ;; 137:LATIN CAPITAL LETTER C WITH CARON
1184 #x00E4 ;; 138:LATIN SMALL LETTER A WITH DIAERESIS
1185 #x010D ;; 139:LATIN SMALL LETTER C WITH CARON
1186 #x0106 ;; 140:LATIN CAPITAL LETTER C WITH ACUTE
1187 #x0107 ;; 141:LATIN SMALL LETTER C WITH ACUTE
1188 #x00E9 ;; 142:LATIN SMALL LETTER E WITH ACUTE
1189 #x0179 ;; 143:LATIN CAPITAL LETTER Z WITH ACUTE
1190 #x017A ;; 144:LATIN SMALL LETTER Z WITH ACUTE
1191 #x010E ;; 145:LATIN CAPITAL LETTER D WITH CARON
1192 #x00ED ;; 146:LATIN SMALL LETTER I WITH ACUTE
1193 #x010F ;; 147:LATIN SMALL LETTER D WITH CARON
1194 #x0112 ;; 148:LATIN CAPITAL LETTER E WITH MACRON
1195 #x0113 ;; 149:LATIN SMALL LETTER E WITH MACRON
1196 #x0116 ;; 150:LATIN CAPITAL LETTER E WITH DOT ABOVE
1197 #x00F3 ;; 151:LATIN SMALL LETTER O WITH ACUTE
1198 #x0117 ;; 152:LATIN SMALL LETTER E WITH DOT ABOVE
1199 #x00F4 ;; 153:LATIN SMALL LETTER O WITH CIRCUMFLEX
1200 #x00F6 ;; 154:LATIN SMALL LETTER O WITH DIAERESIS
1201 #x00F5 ;; 155:LATIN SMALL LETTER O WITH TILDE
1202 #x00FA ;; 156:LATIN SMALL LETTER U WITH ACUTE
1203 #x011A ;; 157:LATIN CAPITAL LETTER E WITH CARON
1204 #x011B ;; 158:LATIN SMALL LETTER E WITH CARON
1205 #x00FC ;; 159:LATIN SMALL LETTER U WITH DIAERESIS
1206 #x2020 ;; 160:DAGGER
1207 #x00B0 ;; 161:DEGREE SIGN
1208 #x0118 ;; 162:LATIN CAPITAL LETTER E WITH OGONEK
1209 #x00A3 ;; 163:POUND SIGN
1210 #x00A7 ;; 164:SECTION SIGN
1211 #x2022 ;; 165:BULLET
1212 #x00B6 ;; 166:PILCROW SIGN
1213 #x00DF ;; 167:LATIN SMALL LETTER SHARP S
1214 #x00AE ;; 168:REGISTERED SIGN
1215 #x00A9 ;; 169:COPYRIGHT SIGN
1216 #x2122 ;; 170:TRADE MARK SIGN
1217 #x0119 ;; 171:LATIN SMALL LETTER E WITH OGONEK
1218 #x00A8 ;; 172:DIAERESIS
1219 #x2260 ;; 173:NOT EQUAL TO
1220 #x0123 ;; 174:LATIN SMALL LETTER G WITH CEDILLA
1221 #x012E ;; 175:LATIN CAPITAL LETTER I WITH OGONEK
1222 #x012F ;; 176:LATIN SMALL LETTER I WITH OGONEK
1223 #x012A ;; 177:LATIN CAPITAL LETTER I WITH MACRON
1224 #x2264 ;; 178:LESS-THAN OR EQUAL TO
1225 #x2265 ;; 179:GREATER-THAN OR EQUAL TO
1226 #x012B ;; 180:LATIN SMALL LETTER I WITH MACRON
1227 #x0136 ;; 181:LATIN CAPITAL LETTER K WITH CEDILLA
1228 #x2202 ;; 182:PARTIAL DIFFERENTIAL
1229 #x2211 ;; 183:N-ARY SUMMATION
1230 #x0142 ;; 184:LATIN SMALL LETTER L WITH STROKE
1231 #x013B ;; 185:LATIN CAPITAL LETTER L WITH CEDILLA
1232 #x013C ;; 186:LATIN SMALL LETTER L WITH CEDILLA
1233 #x013D ;; 187:LATIN CAPITAL LETTER L WITH CARON
1234 #x013E ;; 188:LATIN SMALL LETTER L WITH CARON
1235 #x0139 ;; 189:LATIN CAPITAL LETTER L WITH ACUTE
1236 #x013A ;; 190:LATIN SMALL LETTER L WITH ACUTE
1237 #x0145 ;; 191:LATIN CAPITAL LETTER N WITH CEDILLA
1238 #x0146 ;; 192:LATIN SMALL LETTER N WITH CEDILLA
1239 #x0143 ;; 193:LATIN CAPITAL LETTER N WITH ACUTE
1240 #x00AC ;; 194:NOT SIGN
1241 #x221A ;; 195:SQUARE ROOT
1242 #x0144 ;; 196:LATIN SMALL LETTER N WITH ACUTE
1243 #x0147 ;; 197:LATIN CAPITAL LETTER N WITH CARON
1244 #x2206 ;; 198:INCREMENT
1245 #x00AB ;; 199:LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
1246 #x00BB ;; 200:RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
1247 #x2026 ;; 201:HORIZONTAL ELLIPSIS
1248 #x00A0 ;; 202:NO-BREAK SPACE
1249 #x0148 ;; 203:LATIN SMALL LETTER N WITH CARON
1250 #x0150 ;; 204:LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
1251 #x00D5 ;; 205:LATIN CAPITAL LETTER O WITH TILDE
1252 #x0151 ;; 206:LATIN SMALL LETTER O WITH DOUBLE ACUTE
1253 #x014C ;; 207:LATIN CAPITAL LETTER O WITH MACRON
1254 #x2013 ;; 208:EN DASH
1255 #x2014 ;; 209:EM DASH
1256 #x201C ;; 210:LEFT DOUBLE QUOTATION MARK
1257 #x201D ;; 211:RIGHT DOUBLE QUOTATION MARK
1258 #x2018 ;; 212:LEFT SINGLE QUOTATION MARK
1259 #x2019 ;; 213:RIGHT SINGLE QUOTATION MARK
1260 #x00F7 ;; 214:DIVISION SIGN
1261 #x25CA ;; 215:LOZENGE
1262 #x014D ;; 216:LATIN SMALL LETTER O WITH MACRON
1263 #x0154 ;; 217:LATIN CAPITAL LETTER R WITH ACUTE
1264 #x0155 ;; 218:LATIN SMALL LETTER R WITH ACUTE
1265 #x0158 ;; 219:LATIN CAPITAL LETTER R WITH CARON
1266 #x2039 ;; 220:SINGLE LEFT-POINTING ANGLE QUOTATION MARK
1267 #x203A ;; 221:SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
1268 #x0159 ;; 222:LATIN SMALL LETTER R WITH CARON
1269 #x0156 ;; 223:LATIN CAPITAL LETTER R WITH CEDILLA
1270 #x0157 ;; 224:LATIN SMALL LETTER R WITH CEDILLA
1271 #x0160 ;; 225:LATIN CAPITAL LETTER S WITH CARON
1272 #x201A ;; 226:SINGLE LOW-9 QUOTATION MARK
1273 #x201E ;; 227:DOUBLE LOW-9 QUOTATION MARK
1274 #x0161 ;; 228:LATIN SMALL LETTER S WITH CARON
1275 #x015A ;; 229:LATIN CAPITAL LETTER S WITH ACUTE
1276 #x015B ;; 230:LATIN SMALL LETTER S WITH ACUTE
1277 #x00C1 ;; 231:LATIN CAPITAL LETTER A WITH ACUTE
1278 #x0164 ;; 232:LATIN CAPITAL LETTER T WITH CARON
1279 #x0165 ;; 233:LATIN SMALL LETTER T WITH CARON
1280 #x00CD ;; 234:LATIN CAPITAL LETTER I WITH ACUTE
1281 #x017D ;; 235:LATIN CAPITAL LETTER Z WITH CARON
1282 #x017E ;; 236:LATIN SMALL LETTER Z WITH CARON
1283 #x016A ;; 237:LATIN CAPITAL LETTER U WITH MACRON
1284 #x00D3 ;; 238:LATIN CAPITAL LETTER O WITH ACUTE
1285 #x00D4 ;; 239:LATIN CAPITAL LETTER O WITH CIRCUMFLEX
1286 #x016B ;; 240:LATIN SMALL LETTER U WITH MACRON
1287 #x016E ;; 241:LATIN CAPITAL LETTER U WITH RING ABOVE
1288 #x00DA ;; 242:LATIN CAPITAL LETTER U WITH ACUTE
1289 #x016F ;; 243:LATIN SMALL LETTER U WITH RING ABOVE
1290 #x0170 ;; 244:LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
1291 #x0171 ;; 245:LATIN SMALL LETTER U WITH DOUBLE ACUTE
1292 #x0172 ;; 246:LATIN CAPITAL LETTER U WITH OGONEK
1293 #x0173 ;; 247:LATIN SMALL LETTER U WITH OGONEK
1294 #x00DD ;; 248:LATIN CAPITAL LETTER Y WITH ACUTE
1295 #x00FD ;; 249:LATIN SMALL LETTER Y WITH ACUTE
1296 #x0137 ;; 250:LATIN SMALL LETTER K WITH CEDILLA
1297 #x017B ;; 251:LATIN CAPITAL LETTER Z WITH DOT ABOVE
1298 #x0141 ;; 252:LATIN CAPITAL LETTER L WITH STROKE
1299 #x017C ;; 253:LATIN SMALL LETTER Z WITH DOT ABOVE
1300 #x0122 ;; 254:LATIN CAPITAL LETTER G WITH CEDILLA
1301 #x02C7 ;; 255:CARON
1302 ]))
1303 "Mac Central European Roman Encoding (MIME:x-mac-centraleurroman).") 1202 "Mac Central European Roman Encoding (MIME:x-mac-centraleurroman).")
1304(coding-system-put 'mac-centraleurroman 'mime-charset 'x-mac-centraleurroman) 1203(coding-system-put 'mac-centraleurroman 'mime-charset 'x-mac-centraleurroman)
1305 1204
1306(cp-make-coding-system 1205(cp-make-coding-system
1307 mac-cyrillic 1206 mac-cyrillic
1308 (apply 1207 [?\$,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
1309 'vector 1208 ?\$,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
1310 (mapcar 1209 ?\$,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
1311 (lambda (c) (decode-char 'ucs c)) 1210 ?\$,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
1312 ;; mac-cyrillic (128..255) -> UCS mapping 1211 ?\$,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
1313 [ #x0410 ;; 128:CYRILLIC CAPITAL LETTER A 1212 ?\$,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
1314 #x0411 ;; 129:CYRILLIC CAPITAL LETTER BE 1213 ?\$,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
1315 #x0412 ;; 130:CYRILLIC CAPITAL LETTER VE 1214 ?\$,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]
1316 #x0413 ;; 131:CYRILLIC CAPITAL LETTER GHE
1317 #x0414 ;; 132:CYRILLIC CAPITAL LETTER DE
1318 #x0415 ;; 133:CYRILLIC CAPITAL LETTER IE
1319 #x0416 ;; 134:CYRILLIC CAPITAL LETTER ZHE
1320 #x0417 ;; 135:CYRILLIC CAPITAL LETTER ZE
1321 #x0418 ;; 136:CYRILLIC CAPITAL LETTER I
1322 #x0419 ;; 137:CYRILLIC CAPITAL LETTER SHORT I
1323 #x041A ;; 138:CYRILLIC CAPITAL LETTER KA
1324 #x041B ;; 139:CYRILLIC CAPITAL LETTER EL
1325 #x041C ;; 140:CYRILLIC CAPITAL LETTER EM
1326 #x041D ;; 141:CYRILLIC CAPITAL LETTER EN
1327 #x041E ;; 142:CYRILLIC CAPITAL LETTER O
1328 #x041F ;; 143:CYRILLIC CAPITAL LETTER PE
1329 #x0420 ;; 144:CYRILLIC CAPITAL LETTER ER
1330 #x0421 ;; 145:CYRILLIC CAPITAL LETTER ES
1331 #x0422 ;; 146:CYRILLIC CAPITAL LETTER TE
1332 #x0423 ;; 147:CYRILLIC CAPITAL LETTER U
1333 #x0424 ;; 148:CYRILLIC CAPITAL LETTER EF
1334 #x0425 ;; 149:CYRILLIC CAPITAL LETTER HA
1335 #x0426 ;; 150:CYRILLIC CAPITAL LETTER TSE
1336 #x0427 ;; 151:CYRILLIC CAPITAL LETTER CHE
1337 #x0428 ;; 152:CYRILLIC CAPITAL LETTER SHA
1338 #x0429 ;; 153:CYRILLIC CAPITAL LETTER SHCHA
1339 #x042A ;; 154:CYRILLIC CAPITAL LETTER HARD SIGN
1340 #x042B ;; 155:CYRILLIC CAPITAL LETTER YERU
1341 #x042C ;; 156:CYRILLIC CAPITAL LETTER SOFT SIGN
1342 #x042D ;; 157:CYRILLIC CAPITAL LETTER E
1343 #x042E ;; 158:CYRILLIC CAPITAL LETTER YU
1344 #x042F ;; 159:CYRILLIC CAPITAL LETTER YA
1345 #x2020 ;; 160:DAGGER
1346 #x00B0 ;; 161:DEGREE SIGN
1347 #x0490 ;; 162:CYRILLIC CAPITAL LETTER GHE WITH UPTURN
1348 #x00A3 ;; 163:POUND SIGN
1349 #x00A7 ;; 164:SECTION SIGN
1350 #x2022 ;; 165:BULLET
1351 #x00B6 ;; 166:PILCROW SIGN
1352 #x0406 ;; 167:CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
1353 #x00AE ;; 168:REGISTERED SIGN
1354 #x00A9 ;; 169:COPYRIGHT SIGN
1355 #x2122 ;; 170:TRADE MARK SIGN
1356 #x0402 ;; 171:CYRILLIC CAPITAL LETTER DJE
1357 #x0452 ;; 172:CYRILLIC SMALL LETTER DJE
1358 #x2260 ;; 173:NOT EQUAL TO
1359 #x0403 ;; 174:CYRILLIC CAPITAL LETTER GJE
1360 #x0453 ;; 175:CYRILLIC SMALL LETTER GJE
1361 #x221E ;; 176:INFINITY
1362 #x00B1 ;; 177:PLUS-MINUS SIGN
1363 #x2264 ;; 178:LESS-THAN OR EQUAL TO
1364 #x2265 ;; 179:GREATER-THAN OR EQUAL TO
1365 #x0456 ;; 180:CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
1366 #x00B5 ;; 181:MICRO SIGN
1367 #x0491 ;; 182:CYRILLIC SMALL LETTER GHE WITH UPTURN
1368 #x0408 ;; 183:CYRILLIC CAPITAL LETTER JE
1369 #x0404 ;; 184:CYRILLIC CAPITAL LETTER UKRAINIAN IE
1370 #x0454 ;; 185:CYRILLIC SMALL LETTER UKRAINIAN IE
1371 #x0407 ;; 186:CYRILLIC CAPITAL LETTER YI
1372 #x0457 ;; 187:CYRILLIC SMALL LETTER YI
1373 #x0409 ;; 188:CYRILLIC CAPITAL LETTER LJE
1374 #x0459 ;; 189:CYRILLIC SMALL LETTER LJE
1375 #x040A ;; 190:CYRILLIC CAPITAL LETTER NJE
1376 #x045A ;; 191:CYRILLIC SMALL LETTER NJE
1377 #x0458 ;; 192:CYRILLIC SMALL LETTER JE
1378 #x0405 ;; 193:CYRILLIC CAPITAL LETTER DZE
1379 #x00AC ;; 194:NOT SIGN
1380 #x221A ;; 195:SQUARE ROOT
1381 #x0192 ;; 196:LATIN SMALL LETTER F WITH HOOK
1382 #x2248 ;; 197:ALMOST EQUAL TO
1383 #x2206 ;; 198:INCREMENT
1384 #x00AB ;; 199:LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
1385 #x00BB ;; 200:RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
1386 #x2026 ;; 201:HORIZONTAL ELLIPSIS
1387 #x00A0 ;; 202:NO-BREAK SPACE
1388 #x040B ;; 203:CYRILLIC CAPITAL LETTER TSHE
1389 #x045B ;; 204:CYRILLIC SMALL LETTER TSHE
1390 #x040C ;; 205:CYRILLIC CAPITAL LETTER KJE
1391 #x045C ;; 206:CYRILLIC SMALL LETTER KJE
1392 #x0455 ;; 207:CYRILLIC SMALL LETTER DZE
1393 #x2013 ;; 208:EN DASH
1394 #x2014 ;; 209:EM DASH
1395 #x201C ;; 210:LEFT DOUBLE QUOTATION MARK
1396 #x201D ;; 211:RIGHT DOUBLE QUOTATION MARK
1397 #x2018 ;; 212:LEFT SINGLE QUOTATION MARK
1398 #x2019 ;; 213:RIGHT SINGLE QUOTATION MARK
1399 #x00F7 ;; 214:DIVISION SIGN
1400 #x201E ;; 215:DOUBLE LOW-9 QUOTATION MARK
1401 #x040E ;; 216:CYRILLIC CAPITAL LETTER SHORT U
1402 #x045E ;; 217:CYRILLIC SMALL LETTER SHORT U
1403 #x040F ;; 218:CYRILLIC CAPITAL LETTER DZHE
1404 #x045F ;; 219:CYRILLIC SMALL LETTER DZHE
1405 #x2116 ;; 220:NUMERO SIGN
1406 #x0401 ;; 221:CYRILLIC CAPITAL LETTER IO
1407 #x0451 ;; 222:CYRILLIC SMALL LETTER IO
1408 #x044F ;; 223:CYRILLIC SMALL LETTER YA
1409 #x0430 ;; 224:CYRILLIC SMALL LETTER A
1410 #x0431 ;; 225:CYRILLIC SMALL LETTER BE
1411 #x0432 ;; 226:CYRILLIC SMALL LETTER VE
1412 #x0433 ;; 227:CYRILLIC SMALL LETTER GHE
1413 #x0434 ;; 228:CYRILLIC SMALL LETTER DE
1414 #x0435 ;; 229:CYRILLIC SMALL LETTER IE
1415 #x0436 ;; 230:CYRILLIC SMALL LETTER ZHE
1416 #x0437 ;; 231:CYRILLIC SMALL LETTER ZE
1417 #x0438 ;; 232:CYRILLIC SMALL LETTER I
1418 #x0439 ;; 233:CYRILLIC SMALL LETTER SHORT I
1419 #x043A ;; 234:CYRILLIC SMALL LETTER KA
1420 #x043B ;; 235:CYRILLIC SMALL LETTER EL
1421 #x043C ;; 236:CYRILLIC SMALL LETTER EM
1422 #x043D ;; 237:CYRILLIC SMALL LETTER EN
1423 #x043E ;; 238:CYRILLIC SMALL LETTER O
1424 #x043F ;; 239:CYRILLIC SMALL LETTER PE
1425 #x0440 ;; 240:CYRILLIC SMALL LETTER ER
1426 #x0441 ;; 241:CYRILLIC SMALL LETTER ES
1427 #x0442 ;; 242:CYRILLIC SMALL LETTER TE
1428 #x0443 ;; 243:CYRILLIC SMALL LETTER U
1429 #x0444 ;; 244:CYRILLIC SMALL LETTER EF
1430 #x0445 ;; 245:CYRILLIC SMALL LETTER HA
1431 #x0446 ;; 246:CYRILLIC SMALL LETTER TSE
1432 #x0447 ;; 247:CYRILLIC SMALL LETTER CHE
1433 #x0448 ;; 248:CYRILLIC SMALL LETTER SHA
1434 #x0449 ;; 249:CYRILLIC SMALL LETTER SHCHA
1435 #x044A ;; 250:CYRILLIC SMALL LETTER HARD SIGN
1436 #x044B ;; 251:CYRILLIC SMALL LETTER YERU
1437 #x044C ;; 252:CYRILLIC SMALL LETTER SOFT SIGN
1438 #x044D ;; 253:CYRILLIC SMALL LETTER E
1439 #x044E ;; 254:CYRILLIC SMALL LETTER YU
1440 #x20AC ;; 255:EURO SIGN
1441 ]))
1442 "Mac Cyrillic Encoding (MIME:x-mac-cyrillic).") 1215 "Mac Cyrillic Encoding (MIME:x-mac-cyrillic).")
1443(coding-system-put 'mac-cyrillic 'mime-charset 'x-mac-cyrillic) 1216(coding-system-put 'mac-cyrillic 'mime-charset 'x-mac-cyrillic)
1444 1217
1218(let
1219 ((encoding-vector
1220 (vconcat
1221 (make-vector 32 nil)
1222 ;; mac-symbol (32..126) -> emacs-mule mapping
1223 [?\ ?\! ?\$,1x (B ?\# ?\$,1x#(B ?\% ?\& ?\$,1x-(B ?\( ?\) ?\$,1x7(B ?\+ ?\, ?\$,1x2(B ?\. ?\/
1224 ?\0 ?\1 ?\2 ?\3 ?\4 ?\5 ?\6 ?\7 ?\8 ?\9 ?\: ?\; ?\< ?\= ?\> ?\?
1225 ?\$,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
1226 ?\$,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 ?\_
1227 ?\$,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
1228 ?\$,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]
1229 (make-vector (- 160 127) nil)
1230 ;; mac-symbol (160..254) -> emacs-mule mapping
1231 ;; Mapping of the following characters are changed from the
1232 ;; original one:
1233 ;; 0xE2 0x00AE+0xF87F -> 0x00AE # REGISTERED SIGN, alternate: sans serif
1234 ;; 0xE3 0x00A9+0xF87F -> 0x00A9 # COPYRIGHT SIGN, alternate: sans serif
1235 ;; 0xE4 0x2122+0xF87F -> 0x2122 # TRADE MARK SIGN, alternate: sans serif
1236 [?\$,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
1237 ?\,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
1238 ?\$,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
1239 ?\$,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
1240 ?\$,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
1241 ?\$,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
1242 nil]))
1243 translation-table)
1244 (setq translation-table
1245 (make-translation-table-from-vector encoding-vector))
1246;; (define-translation-table 'mac-symbol-decoder translation-table)
1247 (define-translation-table 'mac-symbol-encoder
1248 (char-table-extra-slot translation-table 0)))
1249
1250(let
1251 ((encoding-vector
1252 (vconcat
1253 (make-vector 32 nil)
1254 ;; mac-dingbats (32..126) -> emacs-mule mapping
1255 [?\ ?\$,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
1256 ?\$,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
1257 ?\$,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
1258 ?\$,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
1259 ?\$,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
1260 ?\$,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
1261 nil
1262 ;; mac-dingbats (128..141) -> emacs-mule mapping
1263 ?\$,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]
1264 (make-vector (- 161 142) nil)
1265 ;; mac-dingbats (161..239) -> emacs-mule mapping
1266 [?\$,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
1267 ?\$,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
1268 ?\$,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
1269 ?\$,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
1270 ?\$,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
1271 nil
1272 ;; mac-dingbats (241..254) -> emacs-mule mapping
1273 ?\$,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
1274 nil]))
1275 translation-table)
1276 (setq translation-table
1277 (make-translation-table-from-vector encoding-vector))
1278;; (define-translation-table 'mac-dingbats-decoder translation-table)
1279 (define-translation-table 'mac-dingbats-encoder
1280 (char-table-extra-slot translation-table 0)))
1281
1445(defvar mac-font-encoder-list 1282(defvar mac-font-encoder-list
1446 '(("mac-roman" mac-roman-encoder 1283 '(("mac-roman" mac-roman-encoder
1447 ccl-encode-mac-roman-font "%s") 1284 ccl-encode-mac-roman-font "%s")
1448 ("mac-centraleurroman" encode-mac-centraleurroman 1285 ("mac-centraleurroman" encode-mac-centraleurroman
1449 ccl-encode-mac-centraleurroman-font "%s ce") 1286 ccl-encode-mac-centraleurroman-font "%s ce")
1450 ("mac-cyrillic" encode-mac-cyrillic 1287 ("mac-cyrillic" encode-mac-cyrillic
1451 ccl-encode-mac-cyrillic-font "%s cy"))) 1288 ccl-encode-mac-cyrillic-font "%s cy")
1289 ("mac-symbol" mac-symbol-encoder
1290 ccl-encode-mac-symbol-font "symbol")
1291 ("mac-dingbats" mac-dingbats-encoder
1292 ccl-encode-mac-dingbats-font "zapf dingbats")))
1452 1293
1453(let ((encoder-list 1294(let ((encoder-list
1454 (mapcar (lambda (lst) (nth 1 lst)) mac-font-encoder-list)) 1295 (mapcar (lambda (lst) (nth 1 lst)) mac-font-encoder-list))
@@ -1497,6 +1338,26 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1497 (translate-character encode-mac-cyrillic r0 r1))))) 1338 (translate-character encode-mac-cyrillic r0 r1)))))
1498 "CCL program for Mac Cyrillic font") 1339 "CCL program for Mac Cyrillic font")
1499 1340
1341(define-ccl-program ccl-encode-mac-symbol-font
1342 `(0
1343 (if (r0 != ,(charset-id 'ascii))
1344 (if (r0 <= ?\x8f)
1345 (translate-character mac-symbol-encoder r0 r1)
1346 ((r1 <<= 7)
1347 (r1 |= r2)
1348 (translate-character mac-symbol-encoder r0 r1)))))
1349 "CCL program for Mac Symbol font")
1350
1351(define-ccl-program ccl-encode-mac-dingbats-font
1352 `(0
1353 (if (r0 != ,(charset-id 'ascii))
1354 (if (r0 <= ?\x8f)
1355 (translate-character mac-dingbats-encoder r0 r1)
1356 ((r1 <<= 7)
1357 (r1 |= r2)
1358 (translate-character mac-dingbats-encoder r0 r1)))))
1359 "CCL program for Mac Dingbats font")
1360
1500 1361
1501(setq font-ccl-encoder-alist 1362(setq font-ccl-encoder-alist
1502 (nconc 1363 (nconc
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index d70e20e5b6b..054f9c95711 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -145,6 +145,8 @@ only tooltips in the buffer containing the overlay arrow."
145 :tag "Use echo area" 145 :tag "Use echo area"
146 :group 'tooltip) 146 :group 'tooltip)
147 147
148(defvaralias 'tooltip-use-echo-area 'tooltip-gud-echo-area)
149(make-obsolete-variable 'tooltip-use-echo-area 'tooltip-gud-echo-area "22.1")
148 150
149;;; Variables that are not customizable. 151;;; Variables that are not customizable.
150 152
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 14be8680906..2e440e48fa5 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,18 @@
12005-04-19 Richard M. Stallman <rms@gnu.org>
2
3 * modes.texi (Search-based Fontification): Explain that
4 facespec is an expression to be evaluated.
5
62005-04-19 Kevin Ryde <user42@zip.com.au>
7
8 * streams.texi (Output Functions): Fix xref.
9 * strings.texi (String Conversion): Fix xref.
10
112005-04-19 Kim F. Storm <storm@cua.dk>
12
13 * symbols.texi (Symbol Plists): Add safe-get.
14 Mention that `get' may signal an error.
15
12005-04-18 Nick Roberts <nickrob@snap.net.nz> 162005-04-18 Nick Roberts <nickrob@snap.net.nz>
2 17
3 * customize.texi (Variable Definitions): Replace tooltip-mode 18 * customize.texi (Variable Definitions): Replace tooltip-mode
diff --git a/lispref/modes.texi b/lispref/modes.texi
index b43b22275cc..6087d7f89ae 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -2163,9 +2163,10 @@ If you use @code{regexp-opt} to produce the regular expression
2163Functions}) to calculate the value for @var{subexp}. 2163Functions}) to calculate the value for @var{subexp}.
2164 2164
2165@item (@var{matcher} . @var{facespec}) 2165@item (@var{matcher} . @var{facespec})
2166In this kind of element, @var{facespec} is an object which specifies 2166In this kind of element, @var{facespec} is an expression whose value
2167the face variable to use for highlighting. In the simplest case, it 2167specifies the face to use for highlighting. In the simplest case,
2168is a Lisp variable (a symbol), whose value should be a face name. 2168@var{facespec} is a Lisp variable (a symbol) whose value is a face
2169name.
2169 2170
2170@example 2171@example
2171;; @r{Highlight occurrences of @samp{fubar},} 2172;; @r{Highlight occurrences of @samp{fubar},}
@@ -2173,12 +2174,13 @@ is a Lisp variable (a symbol), whose value should be a face name.
2173("fubar" . fubar-face) 2174("fubar" . fubar-face)
2174@end example 2175@end example
2175 2176
2176However, @var{facespec} can also be a list of the form: 2177However, @var{facespec} can also evaluate to a list of this form:
2177 2178
2178@example 2179@example
2179(face @var{face} @var{prop1} @var{val1} @var{prop2} @var{val2}@dots{}) 2180(face @var{face} @var{prop1} @var{val1} @var{prop2} @var{val2}@dots{})
2180@end example 2181@end example
2181 2182
2183@noindent
2182to specify the face @var{face} and various additional text properties 2184to specify the face @var{face} and various additional text properties
2183to put on the text that matches. If you do this, be sure to add the 2185to put on the text that matches. If you do this, be sure to add the
2184other text property names that you set in this way to the value of 2186other text property names that you set in this way to the value of
@@ -2198,7 +2200,8 @@ It has the form:
2198 2200
2199The @sc{car}, @var{subexp}, is an integer specifying which subexpression 2201The @sc{car}, @var{subexp}, is an integer specifying which subexpression
2200of the match to fontify (0 means the entire matching text). The second 2202of the match to fontify (0 means the entire matching text). The second
2201subelement, @var{facespec}, specifies the face, as described above. 2203subelement, @var{facespec}, is an expression whose value specifies the
2204face, as described above.
2202 2205
2203The last two values in @var{subexp-highlighter}, @var{override} and 2206The last two values in @var{subexp-highlighter}, @var{override} and
2204@var{laxmatch}, are optional flags. If @var{override} is @code{t}, 2207@var{laxmatch}, are optional flags. If @var{override} is @code{t},
diff --git a/lispref/streams.texi b/lispref/streams.texi
index f459c1c821a..09f8695cd25 100644
--- a/lispref/streams.texi
+++ b/lispref/streams.texi
@@ -659,7 +659,7 @@ characters in the output. (This argument is supported in Emacs versions
659@end group 659@end group
660@end example 660@end example
661 661
662See @code{format}, in @ref{String Conversion}, for other ways to obtain 662See @code{format}, in @ref{Formatting Strings}, for other ways to obtain
663the printed representation of a Lisp object as a string. 663the printed representation of a Lisp object as a string.
664@end defun 664@end defun
665 665
diff --git a/lispref/strings.texi b/lispref/strings.texi
index bfe0f1f7e19..b70e8d9f9d4 100644
--- a/lispref/strings.texi
+++ b/lispref/strings.texi
@@ -549,7 +549,8 @@ for a kind of string comparison; see @ref{Regexp Search}.
549@cindex conversion of strings 549@cindex conversion of strings
550 550
551 This section describes functions for conversions between characters, 551 This section describes functions for conversions between characters,
552strings and integers. @code{format} and @code{prin1-to-string} 552strings and integers. @code{format} (@pxref{Formatting Strings})
553and @code{prin1-to-string}
553(@pxref{Output Functions}) can also convert Lisp objects into strings. 554(@pxref{Output Functions}) can also convert Lisp objects into strings.
554@code{read-from-string} (@pxref{Input Functions}) can ``convert'' a 555@code{read-from-string} (@pxref{Input Functions}) can ``convert'' a
555string representation of a Lisp object into an object. The functions 556string representation of a Lisp object into an object. The functions
diff --git a/lispref/symbols.texi b/lispref/symbols.texi
index 92c8b0f1e82..2c81cb9493c 100644
--- a/lispref/symbols.texi
+++ b/lispref/symbols.texi
@@ -496,6 +496,8 @@ This function finds the value of the property named @var{property} in
496@var{symbol}'s property list. If there is no such property, @code{nil} 496@var{symbol}'s property list. If there is no such property, @code{nil}
497is returned. Thus, there is no distinction between a value of 497is returned. Thus, there is no distinction between a value of
498@code{nil} and the absence of the property. 498@code{nil} and the absence of the property.
499A @code{wrong-type-argument} error may be signaled if @var{symbol}
500has a malformed property list.
499 501
500The name @var{property} is compared with the existing property names 502The name @var{property} is compared with the existing property names
501using @code{eq}, so any object is a legitimate property. 503using @code{eq}, so any object is a legitimate property.
@@ -503,6 +505,12 @@ using @code{eq}, so any object is a legitimate property.
503See @code{put} for an example. 505See @code{put} for an example.
504@end defun 506@end defun
505 507
508@defun safe-get symbol property
509This function finds the value of the property named @var{property} in
510@var{symbol}'s property list. Unlike @code{get}, it just returns
511@code{nil} if @var{symbol} has a malformed property list.
512@end defun
513
506@defun put symbol property value 514@defun put symbol property value
507This function puts @var{value} onto @var{symbol}'s property list under 515This function puts @var{value} onto @var{symbol}'s property list under
508the property name @var{property}, replacing any previous property value. 516the property name @var{property}, replacing any previous property value.
diff --git a/man/ChangeLog b/man/ChangeLog
index 694196c47b8..bda82361828 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,8 +1,12 @@
12005-04-19 Kim F. Storm <storm@cua.dk>
2
3 * building.texi (Compilation Mode): Add M-g M-n and M-g M-p bindings.
4
12005-04-18 Lars Hansen <larsh@math.ku.dk> 52005-04-18 Lars Hansen <larsh@math.ku.dk>
2 6
3 * misc.texi (Saving Emacs Sessions): Add that "--no-desktop" now 7 * misc.texi (Saving Emacs Sessions): Add that "--no-desktop" now
4 turns off desktop-save-mode. 8 turns off desktop-save-mode.
5 9
62005-04-17 Luc Teirlinck <teirllm@auburn.edu> 102005-04-17 Luc Teirlinck <teirllm@auburn.edu>
7 11
8 * frames.texi (XTerm Mouse): Xterm Mouse mode is no longer enabled 12 * frames.texi (XTerm Mouse): Xterm Mouse mode is no longer enabled
diff --git a/man/building.texi b/man/building.texi
index 10b7b8053d2..408d0eb339a 100644
--- a/man/building.texi
+++ b/man/building.texi
@@ -163,8 +163,13 @@ non-@code{nil} value, then the compilation buffer always scrolls to
163follow output as it comes in. 163follow output as it comes in.
164 164
165@table @kbd 165@table @kbd
166@item C-x ` 166@item M-g M-n
167@itemx M-g n
168@itemx C-x `
167Visit the locus of the next compiler error message or @code{grep} match. 169Visit the locus of the next compiler error message or @code{grep} match.
170@item M-g M-p
171@itemx M-g p
172Visit the locus of the previous compiler error message or @code{grep} match.
168@item @key{RET} 173@item @key{RET}
169Visit the locus of the error message that point is on. 174Visit the locus of the error message that point is on.
170This command is used in the compilation buffer. 175This command is used in the compilation buffer.
@@ -187,6 +192,8 @@ Toggle Next Error Follow minor mode, which makes cursor motion in the
187compilation buffer produce automatic source display. 192compilation buffer produce automatic source display.
188@end table 193@end table
189 194
195@kindex M-g M-n
196@kindex M-g n
190@kindex C-x ` 197@kindex C-x `
191@findex next-error 198@findex next-error
192 You can visit the source for any particular error message by moving 199 You can visit the source for any particular error message by moving
diff --git a/src/ChangeLog b/src/ChangeLog
index ac7d5fb07f3..e2a5fa1fd9c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,58 @@
12005-04-19 Kim F. Storm <storm@cua.dk>
2
3 * xdisp.c (setup_for_ellipsis): Reset saved_face_id to use default
4 face unless last visible char and first invisible char have the
5 same face. Also use default face if saved_face_id is undefined.
6
72005-04-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8
9 * macgui.h (MacFontStruct): Remove member `fontname'. Add member
10 `full_name'.
11 [TARGET_API_MAC_CARBON] (MacFontStruct): Use type int for
12 mac_scriptcode member.
13
14 * macterm.c (Qbig5, Qcn_gb, Qsjis, Qeuc_kr): Remove variables.
15 (syms_of_mac): Don't initialize them.
16 (Vmac_charset_info_alist): New variable.
17 (syms_of_mac): Defvar it.
18 (create_text_encoding_info_alist): New function.
19 (decode_mac_font_name, mac_to_x_fontname)
20 (x_font_name_to_mac_font_name, init_font_name_table): Don't hard
21 code the correspondence among XLFD charsets, Mac script codes, and
22 Emacs coding systems. Use Vmac_charset_info_alist and result of
23 create_text_encoding_info_alist instead.
24 (init_font_name_table) [TARGET_API_MAC_CARBON]: Use Font Manager
25 routines also on Mac OS Classic.
26 (init_font_name_table) [!TARGET_API_MAC_CARBON]: Use
27 add_font_name_table_entry.
28 (mac_do_list_fonts): Regard 0 in XLFD scaleble fields as
29 specified. Derive unspecified scalable fields from specified one.
30 (x_list_fonts): Consider Valternate_fontname_alist.
31 (kDefaultFontSize): Change value from 9 to 12.
32 (XLoadQueryFont): Get decoded font family, font face, and charset
33 from x_font_name_to_mac_font_name. Set full name of loaded font.
34 (mac_unload_font): Free `full_name' member.
35 (x_load_font): Don't try XLoadQueryFont if x_list_fonts returns
36 NULL. Copy full_name member of struct MacFontStruct to that of
37 struct font_info.
38
392005-04-19 Kim F. Storm <storm@cua.dk>
40
41 * xdisp.c (handle_stop): Set saved_face_id to current face if
42 selective_display_ellipsis_p so ellipsis will be shown in same
43 face as preceding text.
44 (setup_for_ellipsis): Don't set saved_face_id here.
45 (next_element_from_display_vector): Default to saved_face_id.
46
47 * fns.c (Fsafe_get): New function.
48 (syms_of_fns): Defsubr it.
49
50 * lisp.h (Fsafe_get): EXFUN it.
51
52 * xfaces.c (resolve_face_name): Use Fsafe_get to avoid redisplay
53 loops in case of bad face property lists. Limit number of face
54 alias lookups to 10 (in case of face alias loops).
55
12005-04-18 Kim F. Storm <storm@cua.dk> 562005-04-18 Kim F. Storm <storm@cua.dk>
2 57
3 * dispextern.h (struct glyph_row): New member overlay_arrow_bitmap. 58 * dispextern.h (struct glyph_row): New member overlay_arrow_bitmap.
diff --git a/src/fns.c b/src/fns.c
index daa9e10c465..088b6ca500d 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2051,6 +2051,18 @@ This is the last value stored with `(put SYMBOL PROPNAME VALUE)'. */)
2051 return Fplist_get (XSYMBOL (symbol)->plist, propname); 2051 return Fplist_get (XSYMBOL (symbol)->plist, propname);
2052} 2052}
2053 2053
2054DEFUN ("safe-get", Fsafe_get, Ssafe_get, 2, 2, 0,
2055 doc: /* Return the value of SYMBOL's PROPNAME property.
2056This is the last value stored with `(put SYMBOL PROPNAME VALUE)'.
2057This function never signals an error. */)
2058 (symbol, propname)
2059 Lisp_Object symbol, propname;
2060{
2061 if (!SYMBOLP (symbol))
2062 return Qnil;
2063 return Fsafe_plist_get (XSYMBOL (symbol)->plist, propname);
2064}
2065
2054DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0, 2066DEFUN ("plist-put", Fplist_put, Splist_put, 3, 3, 0,
2055 doc: /* Change value in PLIST of PROP to VAL. 2067 doc: /* Change value in PLIST of PROP to VAL.
2056PLIST is a property list, which is a list of the form 2068PLIST is a property list, which is a list of the form
@@ -5792,6 +5804,7 @@ used if both `use-dialog-box' and this variable are non-nil. */);
5792 defsubr (&Splist_get); 5804 defsubr (&Splist_get);
5793 defsubr (&Ssafe_plist_get); 5805 defsubr (&Ssafe_plist_get);
5794 defsubr (&Sget); 5806 defsubr (&Sget);
5807 defsubr (&Ssafe_get);
5795 defsubr (&Splist_put); 5808 defsubr (&Splist_put);
5796 defsubr (&Sput); 5809 defsubr (&Sput);
5797 defsubr (&Slax_plist_get); 5810 defsubr (&Slax_plist_get);
diff --git a/src/lisp.h b/src/lisp.h
index e1727697802..c3ae08b8d76 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2322,6 +2322,7 @@ EXFUN (Fsort, 2);
2322EXFUN (Freverse, 1); 2322EXFUN (Freverse, 1);
2323EXFUN (Fnreverse, 1); 2323EXFUN (Fnreverse, 1);
2324EXFUN (Fget, 2); 2324EXFUN (Fget, 2);
2325EXFUN (Fsafe_get, 2);
2325EXFUN (Fput, 3); 2326EXFUN (Fput, 3);
2326EXFUN (Fequal, 2); 2327EXFUN (Fequal, 2);
2327EXFUN (Ffillarray, 2); 2328EXFUN (Ffillarray, 2);
diff --git a/src/macgui.h b/src/macgui.h
index 96fd54a603b..5d4f1894e2e 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -101,12 +101,16 @@ typedef struct _XCharStruct
101 (xcs).descent = (bds).bottom) 101 (xcs).descent = (bds).bottom)
102 102
103struct MacFontStruct { 103struct MacFontStruct {
104 char *fontname; 104 char *full_name;
105 105
106 short mac_fontnum; /* font number of font used in this window */ 106 short mac_fontnum; /* font number of font used in this window */
107 int mac_fontsize; /* size of font */ 107 int mac_fontsize; /* size of font */
108 short mac_fontface; /* plain, bold, italics, etc. */ 108 short mac_fontface; /* plain, bold, italics, etc. */
109#if TARGET_API_MAC_CARBON
110 int mac_scriptcode; /* Mac OS script code for font used */
111#else
109 short mac_scriptcode; /* Mac OS script code for font used */ 112 short mac_scriptcode; /* Mac OS script code for font used */
113#endif
110 114
111#if 0 115#if 0
112 SInt16 mFontNum; /* font number of font used in this window */ 116 SInt16 mFontNum; /* font number of font used in this window */
diff --git a/src/macterm.c b/src/macterm.c
index 7bef378b590..1c7893e8d03 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -5841,121 +5841,59 @@ char **font_name_table = NULL;
5841int font_name_table_size = 0; 5841int font_name_table_size = 0;
5842int font_name_count = 0; 5842int font_name_count = 0;
5843 5843
5844#if 0 5844/* Alist linking character set strings to Mac text encoding and Emacs
5845/* compare two strings ignoring case */ 5845 coding system. */
5846static int 5846static Lisp_Object Vmac_charset_info_alist;
5847stricmp (const char *s, const char *t)
5848{
5849 for ( ; tolower (*s) == tolower (*t); s++, t++)
5850 if (*s == '\0')
5851 return 0;
5852 return tolower (*s) - tolower (*t);
5853}
5854 5847
5855/* compare two strings ignoring case and handling wildcard */ 5848static Lisp_Object
5856static int 5849create_text_encoding_info_alist ()
5857wildstrieq (char *s1, char *s2)
5858{
5859 if (strcmp (s1, "*") == 0 || strcmp (s2, "*") == 0)
5860 return true;
5861
5862 return stricmp (s1, s2) == 0;
5863}
5864
5865/* Assume parameter 1 is fully qualified, no wildcards. */
5866static int
5867mac_font_pattern_match (fontname, pattern)
5868 char * fontname;
5869 char * pattern;
5870{ 5850{
5871 char *regex = (char *) alloca (strlen (pattern) * 2 + 3); 5851 Lisp_Object result = Qnil, rest;
5872 char *font_name_copy = (char *) alloca (strlen (fontname) + 1);
5873 char *ptr;
5874 5852
5875 /* Copy fontname so we can modify it during comparison. */ 5853 for (rest = Vmac_charset_info_alist; CONSP (rest); rest = XCDR (rest))
5876 strcpy (font_name_copy, fontname); 5854 {
5855 Lisp_Object charset_info = XCAR (rest);
5856 Lisp_Object charset, coding_system, text_encoding;
5857 Lisp_Object existing_info;
5877 5858
5878 ptr = regex; 5859 if (!(CONSP (charset_info)
5879 *ptr++ = '^'; 5860 && STRINGP (charset = XCAR (charset_info))
5861 && CONSP (XCDR (charset_info))
5862 && INTEGERP (text_encoding = XCAR (XCDR (charset_info)))
5863 && CONSP (XCDR (XCDR (charset_info)))
5864 && SYMBOLP (coding_system = XCAR (XCDR (XCDR (charset_info))))))
5865 continue;
5880 5866
5881 /* Turn pattern into a regexp and do a regexp match. */ 5867 existing_info = assq_no_quit (text_encoding, result);
5882 for (; *pattern; pattern++) 5868 if (NILP (existing_info))
5883 { 5869 result = Fcons (list3 (text_encoding, coding_system, charset),
5884 if (*pattern == '?') 5870 result);
5885 *ptr++ = '.';
5886 else if (*pattern == '*')
5887 {
5888 *ptr++ = '.';
5889 *ptr++ = '*';
5890 }
5891 else 5871 else
5892 *ptr++ = *pattern; 5872 if (NILP (Fmember (charset, XCDR (XCDR (existing_info)))))
5873 XSETCDR (XCDR (existing_info),
5874 Fcons (charset, XCDR (XCDR (existing_info))));
5893 } 5875 }
5894 *ptr = '$';
5895 *(ptr + 1) = '\0';
5896
5897 return (fast_c_string_match_ignore_case (build_string (regex),
5898 font_name_copy) >= 0);
5899}
5900
5901/* Two font specs are considered to match if their foundry, family,
5902 weight, slant, and charset match. */
5903static int
5904mac_font_match (char *mf, char *xf)
5905{
5906 char m_foundry[50], m_family[50], m_weight[20], m_slant[2], m_charset[20];
5907 char x_foundry[50], x_family[50], x_weight[20], x_slant[2], x_charset[20];
5908
5909 if (sscanf (mf, "-%49[^-]-%49[^-]-%19[^-]-%1[^-]-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%19s",
5910 m_foundry, m_family, m_weight, m_slant, m_charset) != 5)
5911 return mac_font_pattern_match (mf, xf);
5912 5876
5913 if (sscanf (xf, "-%49[^-]-%49[^-]-%19[^-]-%1[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%19s", 5877 return result;
5914 x_foundry, x_family, x_weight, x_slant, x_charset) != 5)
5915 return mac_font_pattern_match (mf, xf);
5916
5917 return (wildstrieq (m_foundry, x_foundry)
5918 && wildstrieq (m_family, x_family)
5919 && wildstrieq (m_weight, x_weight)
5920 && wildstrieq (m_slant, x_slant)
5921 && wildstrieq (m_charset, x_charset))
5922 || mac_font_pattern_match (mf, xf);
5923} 5878}
5924#endif
5925 5879
5926static Lisp_Object Qbig5, Qcn_gb, Qsjis, Qeuc_kr;
5927 5880
5928static void 5881static void
5929decode_mac_font_name (name, size, scriptcode) 5882decode_mac_font_name (name, size, coding_system)
5930 char *name; 5883 char *name;
5931 int size; 5884 int size;
5932#if TARGET_API_MAC_CARBON 5885 Lisp_Object coding_system;
5933 int scriptcode;
5934#else
5935 short scriptcode;
5936#endif
5937{ 5886{
5938 Lisp_Object coding_system;
5939 struct coding_system coding; 5887 struct coding_system coding;
5940 char *buf; 5888 char *buf, *p;
5941 5889
5942 switch (scriptcode) 5890 for (p = name; *p; p++)
5943 { 5891 if (!isascii (*p) || iscntrl (*p))
5944 case smTradChinese:
5945 coding_system = Qbig5;
5946 break; 5892 break;
5947 case smSimpChinese: 5893
5948 coding_system = Qcn_gb; 5894 if (*p == '\0'
5949 break; 5895 || NILP (coding_system) || NILP (Fcoding_system_p (coding_system)))
5950 case smJapanese: 5896 return;
5951 coding_system = Qsjis;
5952 break;
5953 case smKorean:
5954 coding_system = Qeuc_kr;
5955 break;
5956 default:
5957 return;
5958 }
5959 5897
5960 setup_coding_system (coding_system, &coding); 5898 setup_coding_system (coding_system, &coding);
5961 coding.src_multibyte = 0; 5899 coding.src_multibyte = 0;
@@ -5971,68 +5909,26 @@ decode_mac_font_name (name, size, scriptcode)
5971 5909
5972 5910
5973static char * 5911static char *
5974mac_to_x_fontname (name, size, style, scriptcode) 5912mac_to_x_fontname (name, size, style, charset)
5975 char *name; 5913 char *name;
5976 int size; 5914 int size;
5977 Style style; 5915 Style style;
5978#if TARGET_API_MAC_CARBON 5916 char *charset;
5979 int scriptcode;
5980#else
5981 short scriptcode;
5982#endif
5983{ 5917{
5984 char foundry[32], family[32], cs[32]; 5918 char foundry[32], family[32], cs[32];
5985 char xf[256], *result, *p; 5919 char xf[256], *result, *p;
5986 5920
5987 if (sscanf (name, "%31[^-]-%31[^-]-%31s", foundry, family, cs) != 3) 5921 if (sscanf (name, "%31[^-]-%31[^-]-%31s", foundry, family, cs) == 3)
5922 charset = cs;
5923 else
5988 { 5924 {
5989 strcpy(foundry, "Apple"); 5925 strcpy(foundry, "Apple");
5990 strcpy(family, name); 5926 strcpy(family, name);
5991
5992 switch (scriptcode)
5993 {
5994 case smTradChinese: /* == kTextEncodingMacChineseTrad */
5995 strcpy(cs, "big5-0");
5996 break;
5997 case smSimpChinese: /* == kTextEncodingMacChineseSimp */
5998 strcpy(cs, "gb2312.1980-0");
5999 break;
6000 case smJapanese: /* == kTextEncodingMacJapanese */
6001 strcpy(cs, "jisx0208.1983-sjis");
6002 break;
6003 case -smJapanese:
6004 /* Each Apple Japanese font is entered into the font table
6005 twice: once as a jisx0208.1983-sjis font and once as a
6006 jisx0201.1976-0 font. The latter can be used to display
6007 the ascii charset and katakana-jisx0201 charset. A
6008 negative script code signals that the name of this latter
6009 font is being built. */
6010 strcpy(cs, "jisx0201.1976-0");
6011 break;
6012 case smKorean: /* == kTextEncodingMacKorean */
6013 strcpy(cs, "ksc5601.1989-0");
6014 break;
6015#if TARGET_API_MAC_CARBON
6016 case kTextEncodingMacCyrillic:
6017 strcpy(cs, "mac-cyrillic");
6018 break;
6019 case kTextEncodingMacCentralEurRoman:
6020 strcpy(cs, "mac-centraleurroman");
6021 break;
6022 case kTextEncodingMacSymbol:
6023 case kTextEncodingMacDingbats:
6024 strcpy(cs, "adobe-fontspecific");
6025 break;
6026#endif
6027 default:
6028 strcpy(cs, "mac-roman");
6029 break;
6030 }
6031 } 5927 }
6032 5928
6033 sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-75-75-m-%d-%s", 5929 sprintf(xf, "-%s-%s-%s-%c-normal--%d-%d-75-75-m-%d-%s",
6034 foundry, family, style & bold ? "bold" : "medium", 5930 foundry, family, style & bold ? "bold" : "medium",
6035 style & italic ? 'i' : 'r', size, size * 10, size * 10, cs); 5931 style & italic ? 'i' : 'r', size, size * 10, size * 10, charset);
6036 5932
6037 result = (char *) xmalloc (strlen (xf) + 1); 5933 result = (char *) xmalloc (strlen (xf) + 1);
6038 strcpy (result, xf); 5934 strcpy (result, xf);
@@ -6050,10 +5946,13 @@ mac_to_x_fontname (name, size, style, scriptcode)
6050 "ETL-Fixed-iso8859-1", "ETL-Fixed-koi8-r", etc. Both types of font 5946 "ETL-Fixed-iso8859-1", "ETL-Fixed-koi8-r", etc. Both types of font
6051 names are handled accordingly. */ 5947 names are handled accordingly. */
6052static void 5948static void
6053x_font_name_to_mac_font_name (char *xf, char *mf) 5949x_font_name_to_mac_font_name (xf, mf, mf_decoded, style, cs)
5950 char *xf, *mf, *mf_decoded;
5951 Style *style;
5952 char *cs;
6054{ 5953{
6055 char foundry[32], family[32], weight[20], slant[2], cs[32]; 5954 char foundry[32], family[32], weight[20], slant[2], *p;
6056 Lisp_Object coding_system = Qnil; 5955 Lisp_Object charset_info, coding_system = Qnil;
6057 struct coding_system coding; 5956 struct coding_system coding;
6058 5957
6059 strcpy (mf, ""); 5958 strcpy (mf, "");
@@ -6064,30 +5963,36 @@ x_font_name_to_mac_font_name (char *xf, char *mf)
6064 foundry, family, weight, slant, cs) != 5) 5963 foundry, family, weight, slant, cs) != 5)
6065 return; 5964 return;
6066 5965
6067 if (strcmp (cs, "big5-0") == 0) 5966 *style = normal;
6068 coding_system = Qbig5; 5967 if (strcmp (weight, "bold") == 0)
6069 else if (strcmp (cs, "gb2312.1980-0") == 0) 5968 *style |= bold;
6070 coding_system = Qcn_gb; 5969 if (*slant == 'i')
6071 else if (strcmp (cs, "jisx0208.1983-sjis") == 0 5970 *style |= italic;
6072 || strcmp (cs, "jisx0201.1976-0") == 0) 5971
6073 coding_system = Qsjis; 5972 charset_info = Fassoc (build_string (cs), Vmac_charset_info_alist);
6074 else if (strcmp (cs, "ksc5601.1989-0") == 0) 5973 if (!NILP (charset_info))
6075 coding_system = Qeuc_kr; 5974 {
6076 else if (strcmp (cs, "mac-roman") == 0 5975 strcpy (mf_decoded, family);
6077 || strcmp (cs, "mac-cyrillic") == 0 5976 coding_system = Fcar (Fcdr (Fcdr (charset_info)));
6078 || strcmp (cs, "mac-centraleurroman") == 0 5977 }
6079 || strcmp (cs, "adobe-fontspecific") == 0)
6080 strcpy (mf, family);
6081 else 5978 else
6082 sprintf (mf, "%s-%s-%s", foundry, family, cs); 5979 sprintf (mf_decoded, "%s-%s-%s", foundry, family, cs);
6083 5980
6084 if (!NILP (coding_system)) 5981 for (p = mf_decoded; *p; p++)
5982 if (!isascii (*p) || iscntrl (*p))
5983 break;
5984
5985 if (*p == '\0'
5986 || NILP (coding_system) || NILP (Fcoding_system_p (coding_system)))
5987 strcpy (mf, mf_decoded);
5988 else
6085 { 5989 {
6086 setup_coding_system (coding_system, &coding); 5990 setup_coding_system (coding_system, &coding);
6087 coding.src_multibyte = 1; 5991 coding.src_multibyte = 1;
6088 coding.dst_multibyte = 1; 5992 coding.dst_multibyte = 1;
6089 coding.mode |= CODING_MODE_LAST_BLOCK; 5993 coding.mode |= CODING_MODE_LAST_BLOCK;
6090 encode_coding (&coding, family, mf, strlen (family), sizeof (Str32) - 1); 5994 encode_coding (&coding, mf_decoded, mf,
5995 strlen (mf_decoded), sizeof (Str32) - 1);
6091 mf[coding.produced] = '\0'; 5996 mf[coding.produced] = '\0';
6092 } 5997 }
6093} 5998}
@@ -6122,181 +6027,180 @@ static void
6122init_font_name_table () 6027init_font_name_table ()
6123{ 6028{
6124#if TARGET_API_MAC_CARBON 6029#if TARGET_API_MAC_CARBON
6125 SInt32 sv; 6030 FMFontFamilyIterator ffi;
6031 FMFontFamilyInstanceIterator ffii;
6032 FMFontFamily ff;
6033 Lisp_Object text_encoding_info_alist;
6034 struct gcpro gcpro1;
6035
6036 /* Create a dummy instance iterator here to avoid creating and
6037 destroying it in the loop. */
6038 if (FMCreateFontFamilyInstanceIterator (0, &ffii) != noErr)
6039 return;
6040 /* Create an iterator to enumerate the font families. */
6041 if (FMCreateFontFamilyIterator (NULL, NULL, kFMDefaultOptions, &ffi)
6042 != noErr)
6043 {
6044 FMDisposeFontFamilyInstanceIterator (&ffii);
6045 return;
6046 }
6047
6048 text_encoding_info_alist = create_text_encoding_info_alist ();
6126 6049
6127 if (Gestalt (gestaltSystemVersion, &sv) == noErr && sv >= 0x1000) 6050 GCPRO1 (text_encoding_info_alist);
6051
6052 while (FMGetNextFontFamily (&ffi, &ff) == noErr)
6128 { 6053 {
6129 FMFontFamilyIterator ffi; 6054 Str255 name;
6130 FMFontFamilyInstanceIterator ffii; 6055 FMFont font;
6131 FMFontFamily ff; 6056 FMFontStyle style;
6057 FMFontSize size;
6058 TextEncoding encoding;
6059 TextEncodingBase sc;
6060 Lisp_Object text_encoding_info;
6132 6061
6133 /* Create a dummy instance iterator here to avoid creating and 6062 if (FMGetFontFamilyName (ff, name) != noErr)
6134 destroying it in the loop. */ 6063 break;
6135 if (FMCreateFontFamilyInstanceIterator (0, &ffii) != noErr) 6064 p2cstr (name);
6136 return; 6065 if (*name == '.')
6137 /* Create an iterator to enumerate the font families. */ 6066 continue;
6138 if (FMCreateFontFamilyIterator (NULL, NULL, kFMDefaultOptions, &ffi)
6139 != noErr)
6140 {
6141 FMDisposeFontFamilyInstanceIterator (&ffii);
6142 return;
6143 }
6144 6067
6145 while (FMGetNextFontFamily (&ffi, &ff) == noErr) 6068 if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr)
6146 { 6069 break;
6147 Str255 name; 6070 sc = GetTextEncodingBase (encoding);
6148 FMFont font; 6071 text_encoding_info = assq_no_quit (make_number (sc),
6149 FMFontStyle style; 6072 text_encoding_info_alist);
6150 FMFontSize size; 6073 if (!NILP (text_encoding_info))
6151 TextEncoding encoding; 6074 decode_mac_font_name (name, sizeof (name),
6152 TextEncodingBase sc; 6075 XCAR (XCDR (text_encoding_info)));
6153 6076 else
6154 if (FMGetFontFamilyName (ff, name) != noErr) 6077 text_encoding_info = assq_no_quit (make_number (kTextEncodingMacRoman),
6155 break; 6078 text_encoding_info_alist);
6156 p2cstr (name);
6157 if (*name == '.')
6158 continue;
6159 6079
6160 if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr) 6080 /* Point the instance iterator at the current font family. */
6161 break; 6081 if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr)
6162 sc = GetTextEncodingBase (encoding); 6082 break;
6163 decode_mac_font_name (name, sizeof (name), sc);
6164 6083
6165 /* Point the instance iterator at the current font family. */ 6084 while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size)
6166 if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr) 6085 == noErr)
6167 break; 6086 {
6087 Lisp_Object rest = XCDR (XCDR (text_encoding_info));
6168 6088
6169 while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size) 6089 for (; !NILP (rest); rest = XCDR (rest))
6170 == noErr)
6171 { 6090 {
6172 /* Both jisx0208.1983-sjis and jisx0201.1976-0 parts are 6091 char *cs = SDATA (XCAR (rest));
6173 contained in Apple Japanese (SJIS) font. */ 6092
6174 again:
6175 if (size == 0) 6093 if (size == 0)
6176 { 6094 {
6177 add_font_name_table_entry (mac_to_x_fontname (name, size, 6095 add_font_name_table_entry (mac_to_x_fontname (name, size,
6178 style, sc)); 6096 style, cs));
6179 add_font_name_table_entry (mac_to_x_fontname (name, size, 6097 add_font_name_table_entry (mac_to_x_fontname (name, size,
6180 italic, sc)); 6098 italic, cs));
6181 add_font_name_table_entry (mac_to_x_fontname (name, size, 6099 add_font_name_table_entry (mac_to_x_fontname (name, size,
6182 bold, sc)); 6100 bold, cs));
6183 add_font_name_table_entry (mac_to_x_fontname (name, size, 6101 add_font_name_table_entry (mac_to_x_fontname (name, size,
6184 italic | bold, 6102 italic | bold,
6185 sc)); 6103 cs));
6186 } 6104 }
6187 else 6105 else
6188 add_font_name_table_entry (mac_to_x_fontname (name, size,
6189 style, sc));
6190 if (sc == smJapanese)
6191 { 6106 {
6192 sc = -smJapanese; 6107 add_font_name_table_entry (mac_to_x_fontname (name, size,
6193 goto again; 6108 style, cs));
6194 } 6109 }
6195 else if (sc == -smJapanese)
6196 sc = smJapanese;
6197 } 6110 }
6198 } 6111 }
6199
6200 /* Dispose of the iterators. */
6201 FMDisposeFontFamilyIterator (&ffi);
6202 FMDisposeFontFamilyInstanceIterator (&ffii);
6203 } 6112 }
6204 else 6113
6114 UNGCPRO;
6115
6116 /* Dispose of the iterators. */
6117 FMDisposeFontFamilyIterator (&ffi);
6118 FMDisposeFontFamilyInstanceIterator (&ffii);
6119#else /* !TARGET_API_MAC_CARBON */
6120 GrafPtr port;
6121 SInt16 fontnum, old_fontnum;
6122 int num_mac_fonts = CountResources('FOND');
6123 int i, j;
6124 Handle font_handle, font_handle_2;
6125 short id, scriptcode;
6126 ResType type;
6127 Str32 name;
6128 struct FontAssoc *fat;
6129 struct AsscEntry *assc_entry;
6130 Lisp_Object text_encoding_info_alist, text_encoding_info;
6131 struct gcpro gcpro1;
6132
6133 GetPort (&port); /* save the current font number used */
6134 old_fontnum = port->txFont;
6135
6136 text_encoding_info_alist = create_text_encoding_info_alist ();
6137
6138 GCPRO1 (text_encoding_info_alist);
6139
6140 for (i = 1; i <= num_mac_fonts; i++) /* get all available fonts */
6205 { 6141 {
6206#endif /* TARGET_API_MAC_CARBON */ 6142 font_handle = GetIndResource ('FOND', i);
6207 GrafPtr port; 6143 if (!font_handle)
6208 SInt16 fontnum, old_fontnum; 6144 continue;
6209 int num_mac_fonts = CountResources('FOND');
6210 int i, j;
6211 Handle font_handle, font_handle_2;
6212 short id, scriptcode;
6213 ResType type;
6214 Str32 name;
6215 struct FontAssoc *fat;
6216 struct AsscEntry *assc_entry;
6217
6218 GetPort (&port); /* save the current font number used */
6219#if TARGET_API_MAC_CARBON
6220 old_fontnum = GetPortTextFont (port);
6221#else
6222 old_fontnum = port->txFont;
6223#endif
6224 6145
6225 for (i = 1; i <= num_mac_fonts; i++) /* get all available fonts */ 6146 GetResInfo (font_handle, &id, &type, name);
6226 { 6147 GetFNum (name, &fontnum);
6227 font_handle = GetIndResource ('FOND', i); 6148 p2cstr (name);
6228 if (!font_handle) 6149 if (fontnum == 0)
6229 continue; 6150 continue;
6230 6151
6231 GetResInfo (font_handle, &id, &type, name); 6152 TextFont (fontnum);
6232 GetFNum (name, &fontnum); 6153 scriptcode = FontToScript (fontnum);
6233 p2cstr (name); 6154 text_encoding_info = assq_no_quit (make_number (scriptcode),
6234 if (fontnum == 0) 6155 text_encoding_info_alist);
6235 continue; 6156 if (!NILP (text_encoding_info))
6157 decode_mac_font_name (name, sizeof (name),
6158 XCAR (XCDR (text_encoding_info)));
6159 else
6160 text_encoding_info = assq_no_quit (make_number (smRoman),
6161 text_encoding_info_alist);
6162 do
6163 {
6164 HLock (font_handle);
6236 6165
6237 TextFont (fontnum); 6166 if (GetResourceSizeOnDisk (font_handle)
6238 scriptcode = FontToScript (fontnum); 6167 >= sizeof (struct FamRec))
6239 decode_mac_font_name (name, sizeof (name), scriptcode);
6240 do
6241 { 6168 {
6242 HLock (font_handle); 6169 fat = (struct FontAssoc *) (*font_handle
6243 6170 + sizeof (struct FamRec));
6244 if (GetResourceSizeOnDisk (font_handle) 6171 assc_entry
6245 >= sizeof (struct FamRec)) 6172 = (struct AsscEntry *) (*font_handle
6173 + sizeof (struct FamRec)
6174 + sizeof (struct FontAssoc));
6175
6176 for (j = 0; j <= fat->numAssoc; j++, assc_entry++)
6246 { 6177 {
6247 fat = (struct FontAssoc *) (*font_handle 6178 Lisp_Object rest = XCDR (XCDR (text_encoding_info));
6248 + sizeof (struct FamRec)); 6179
6249 assc_entry 6180 for (; !NILP (rest); rest = XCDR (rest))
6250 = (struct AsscEntry *) (*font_handle
6251 + sizeof (struct FamRec)
6252 + sizeof (struct FontAssoc));
6253
6254 for (j = 0; j <= fat->numAssoc; j++, assc_entry++)
6255 { 6181 {
6256 if (font_name_table_size == 0) 6182 char *cs = SDATA (XCAR (rest));
6257 { 6183
6258 font_name_table_size = 16; 6184 add_font_name_table_entry (mac_to_x_fontname (name,
6259 font_name_table = (char **) 6185 assc_entry->fontSize,
6260 xmalloc (font_name_table_size * sizeof (char *)); 6186 assc_entry->fontStyle,
6261 } 6187 cs));
6262 else if (font_name_count >= font_name_table_size)
6263 {
6264 font_name_table_size += 16;
6265 font_name_table = (char **)
6266 xrealloc (font_name_table,
6267 font_name_table_size * sizeof (char *));
6268 }
6269 font_name_table[font_name_count++]
6270 = mac_to_x_fontname (name,
6271 assc_entry->fontSize,
6272 assc_entry->fontStyle,
6273 scriptcode);
6274 /* Both jisx0208.1983-sjis and jisx0201.1976-0
6275 parts are contained in Apple Japanese (SJIS)
6276 font. */
6277 if (smJapanese == scriptcode)
6278 {
6279 font_name_table[font_name_count++]
6280 = mac_to_x_fontname (name,
6281 assc_entry->fontSize,
6282 assc_entry->fontStyle,
6283 -smJapanese);
6284 }
6285 } 6188 }
6286 } 6189 }
6287
6288 HUnlock (font_handle);
6289 font_handle_2 = GetNextFOND (font_handle);
6290 ReleaseResource (font_handle);
6291 font_handle = font_handle_2;
6292 } 6190 }
6293 while (ResError () == noErr && font_handle);
6294 }
6295 6191
6296 TextFont (old_fontnum); 6192 HUnlock (font_handle);
6297#if TARGET_API_MAC_CARBON 6193 font_handle_2 = GetNextFOND (font_handle);
6194 ReleaseResource (font_handle);
6195 font_handle = font_handle_2;
6196 }
6197 while (ResError () == noErr && font_handle);
6298 } 6198 }
6299#endif /* TARGET_API_MAC_CARBON */ 6199
6200 UNGCPRO;
6201
6202 TextFont (old_fontnum);
6203#endif /* !TARGET_API_MAC_CARBON */
6300} 6204}
6301 6205
6302 6206
@@ -6384,7 +6288,7 @@ mac_do_list_fonts (pattern, maxnames)
6384 ptr++; 6288 ptr++;
6385 if (i == *field) 6289 if (i == *field)
6386 { 6290 {
6387 if ('1' <= *ptr && *ptr <= '9') 6291 if ('0' <= *ptr && *ptr <= '9')
6388 { 6292 {
6389 *val = *ptr++ - '0'; 6293 *val = *ptr++ - '0';
6390 while ('0' <= *ptr && *ptr <= '9' && *val < 10000) 6294 while ('0' <= *ptr && *ptr <= '9' && *val < 10000)
@@ -6402,21 +6306,21 @@ mac_do_list_fonts (pattern, maxnames)
6402 6306
6403 if (i == 14 && ptr == NULL) 6307 if (i == 14 && ptr == NULL)
6404 { 6308 {
6405 if (scl_val[XLFD_SCL_POINT_SIZE] > 0) 6309 if (scl_val[XLFD_SCL_PIXEL_SIZE] < 0)
6406 { 6310 scl_val[XLFD_SCL_PIXEL_SIZE] =
6407 scl_val[XLFD_SCL_PIXEL_SIZE] = scl_val[XLFD_SCL_POINT_SIZE] / 10; 6311 (scl_val[XLFD_SCL_POINT_SIZE] > 0 ? scl_val[XLFD_SCL_POINT_SIZE] / 10
6408 scl_val[XLFD_SCL_AVGWIDTH] = scl_val[XLFD_SCL_POINT_SIZE]; 6312 : (scl_val[XLFD_SCL_AVGWIDTH] > 0 ? scl_val[XLFD_SCL_AVGWIDTH] / 10
6409 } 6313 : -1));
6410 else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0) 6314 if (scl_val[XLFD_SCL_POINT_SIZE] < 0)
6411 { 6315 scl_val[XLFD_SCL_POINT_SIZE] =
6412 scl_val[XLFD_SCL_POINT_SIZE] = 6316 (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 ? scl_val[XLFD_SCL_PIXEL_SIZE] * 10
6413 scl_val[XLFD_SCL_AVGWIDTH] = scl_val[XLFD_SCL_PIXEL_SIZE] * 10; 6317 : (scl_val[XLFD_SCL_AVGWIDTH] > 0 ? scl_val[XLFD_SCL_AVGWIDTH]
6414 } 6318 : -1));
6415 else if (scl_val[XLFD_SCL_AVGWIDTH] > 0) 6319 if (scl_val[XLFD_SCL_AVGWIDTH] < 0)
6416 { 6320 scl_val[XLFD_SCL_AVGWIDTH] =
6417 scl_val[XLFD_SCL_PIXEL_SIZE] = scl_val[XLFD_SCL_AVGWIDTH] / 10; 6321 (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 ? scl_val[XLFD_SCL_PIXEL_SIZE] * 10
6418 scl_val[XLFD_SCL_POINT_SIZE] = scl_val[XLFD_SCL_AVGWIDTH]; 6322 : (scl_val[XLFD_SCL_POINT_SIZE] > 0 ? scl_val[XLFD_SCL_POINT_SIZE]
6419 } 6323 : -1));
6420 } 6324 }
6421 else 6325 else
6422 scl_val[XLFD_SCL_PIXEL_SIZE] = -1; 6326 scl_val[XLFD_SCL_PIXEL_SIZE] = -1;
@@ -6507,49 +6411,62 @@ mac_do_list_fonts (pattern, maxnames)
6507 return font_list; 6411 return font_list;
6508} 6412}
6509 6413
6510/* Return a list of at most MAXNAMES font specs matching the one in 6414/* Return a list of names of available fonts matching PATTERN on frame F.
6511 PATTERN. Cache matching fonts for patterns in 6415
6512 dpyinfo->name_list_element to avoid looking them up again by 6416 Frame F null means we have not yet created any frame on Mac, and
6513 calling mac_font_pattern_match (slow). Return as many matching 6417 consult the first display in x_display_list. MAXNAMES sets a limit
6514 fonts as possible if MAXNAMES = -1. */ 6418 on how many fonts to match. */
6515 6419
6516Lisp_Object 6420Lisp_Object
6517x_list_fonts (struct frame *f, 6421x_list_fonts (f, pattern, size, maxnames)
6518 Lisp_Object pattern, 6422 struct frame *f;
6519 int size, 6423 Lisp_Object pattern;
6520 int maxnames) 6424 int size, maxnames;
6521{ 6425{
6522 Lisp_Object newlist = Qnil, tem, key; 6426 Lisp_Object list = Qnil, patterns, tem, key;
6523 struct mac_display_info *dpyinfo = f ? FRAME_MAC_DISPLAY_INFO (f) : NULL; 6427 struct mac_display_info *dpyinfo
6428 = f ? FRAME_MAC_DISPLAY_INFO (f) : x_display_list;
6524 6429
6525 if (dpyinfo) 6430 xassert (size <= 0);
6431
6432 patterns = Fassoc (pattern, Valternate_fontname_alist);
6433 if (NILP (patterns))
6434 patterns = Fcons (pattern, Qnil);
6435
6436 for (; CONSP (patterns); patterns = XCDR (patterns))
6526 { 6437 {
6438 pattern = XCAR (patterns);
6439
6440 if (!STRINGP (pattern))
6441 continue;
6442
6527 tem = XCAR (XCDR (dpyinfo->name_list_element)); 6443 tem = XCAR (XCDR (dpyinfo->name_list_element));
6528 key = Fcons (pattern, make_number (maxnames)); 6444 key = Fcons (pattern, make_number (maxnames));
6529 6445
6530 newlist = Fassoc (key, tem); 6446 list = Fassoc (key, tem);
6531 if (!NILP (newlist)) 6447 if (!NILP (list))
6532 { 6448 {
6533 newlist = Fcdr_safe (newlist); 6449 list = Fcdr_safe (list);
6450 /* We have a cashed list. Don't have to get the list again. */
6534 goto label_cached; 6451 goto label_cached;
6535 } 6452 }
6536 }
6537 6453
6538 BLOCK_INPUT; 6454 BLOCK_INPUT;
6539 newlist = mac_do_list_fonts (SDATA (pattern), maxnames); 6455 list = mac_do_list_fonts (SDATA (pattern), maxnames);
6540 UNBLOCK_INPUT; 6456 UNBLOCK_INPUT;
6541 6457
6542 /* MAC_TODO: add code for matching outline fonts here */ 6458 /* MAC_TODO: add code for matching outline fonts here */
6543 6459
6544 if (dpyinfo) 6460 /* Now store the result in the cache. */
6545 {
6546 XSETCAR (XCDR (dpyinfo->name_list_element), 6461 XSETCAR (XCDR (dpyinfo->name_list_element),
6547 Fcons (Fcons (key, newlist), 6462 Fcons (Fcons (key, list),
6548 XCAR (XCDR (dpyinfo->name_list_element)))); 6463 XCAR (XCDR (dpyinfo->name_list_element))));
6464
6465 label_cached:
6466 if (NILP (list)) continue; /* Try the remaining alternatives. */
6549 } 6467 }
6550 label_cached:
6551 6468
6552 return newlist; 6469 return list;
6553} 6470}
6554 6471
6555 6472
@@ -6668,7 +6585,7 @@ is_fully_specified_xlfd (char *p)
6668} 6585}
6669 6586
6670 6587
6671const int kDefaultFontSize = 9; 6588const int kDefaultFontSize = 12;
6672 6589
6673 6590
6674/* XLoadQueryFont creates and returns an internal representation for a 6591/* XLoadQueryFont creates and returns an internal representation for a
@@ -6680,17 +6597,25 @@ const int kDefaultFontSize = 9;
6680static MacFontStruct * 6597static MacFontStruct *
6681XLoadQueryFont (Display *dpy, char *fontname) 6598XLoadQueryFont (Display *dpy, char *fontname)
6682{ 6599{
6683 int i, size, is_two_byte_font, char_width; 6600 int i, size, point_size, avgwidth, is_two_byte_font, char_width;
6684 char *name; 6601 char *name;
6685 GrafPtr port; 6602 GrafPtr port;
6686 SInt16 old_fontnum, old_fontsize; 6603 SInt16 old_fontnum, old_fontsize;
6687 Style old_fontface; 6604 Style old_fontface;
6688 Str32 mfontname; 6605 Str32 mfontname, mfontname_decoded, charset;
6689 SInt16 fontnum; 6606 SInt16 fontnum;
6690 Style fontface = normal; 6607 Style fontface;
6608#if TARGET_API_MAC_CARBON
6609 TextEncoding encoding;
6610 int scriptcode;
6611#else
6612 short scriptcode;
6613#endif
6691 MacFontStruct *font; 6614 MacFontStruct *font;
6692 FontInfo the_fontinfo; 6615 FontInfo the_fontinfo;
6693 char s_weight[7], c_slant; 6616#ifdef MAC_OSX
6617 UInt32 old_flags, new_flags;
6618#endif
6694 6619
6695 if (is_fully_specified_xlfd (fontname)) 6620 if (is_fully_specified_xlfd (fontname))
6696 name = fontname; 6621 name = fontname;
@@ -6715,46 +6640,50 @@ XLoadQueryFont (Display *dpy, char *fontname)
6715 old_fontface = port->txFace; 6640 old_fontface = port->txFace;
6716#endif 6641#endif
6717 6642
6718 if (sscanf (name, "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%d-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%*s", &size) != 1) 6643 if (sscanf (name, "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%d-%d-%*[^-]-%*[^-]-%*c-%d-%*s", &size, &point_size, &avgwidth) != 3)
6644 size = 0;
6645 else
6646 {
6647 if (size == 0)
6648 if (point_size > 0)
6649 size = point_size / 10;
6650 else if (avgwidth > 0)
6651 size = avgwidth / 10;
6652 }
6653 if (size == 0)
6719 size = kDefaultFontSize; 6654 size = kDefaultFontSize;
6720 6655
6721 if (sscanf (name, "-%*[^-]-%*[^-]-%6[^-]-%*c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%*s", s_weight) == 1) 6656 x_font_name_to_mac_font_name (name, mfontname, mfontname_decoded,
6722 if (strcmp (s_weight, "bold") == 0) 6657 &fontface, charset);
6723 fontface |= bold;
6724
6725 if (sscanf (name, "-%*[^-]-%*[^-]-%*[^-]-%c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%*s", &c_slant) == 1)
6726 if (c_slant == 'i')
6727 fontface |= italic;
6728
6729 x_font_name_to_mac_font_name (name, mfontname);
6730 c2pstr (mfontname); 6658 c2pstr (mfontname);
6659#if TARGET_API_MAC_CARBON
6660 fontnum = FMGetFontFamilyFromName (mfontname);
6661 if (fontnum == kInvalidFontFamily
6662 || FMGetFontFamilyTextEncoding (fontnum, &encoding) != noErr)
6663 return NULL;
6664 scriptcode = GetTextEncodingBase (encoding);
6665#else
6731 GetFNum (mfontname, &fontnum); 6666 GetFNum (mfontname, &fontnum);
6732 if (fontnum == 0) 6667 if (fontnum == 0)
6733 return NULL; 6668 return NULL;
6669 scriptcode = FontToScript (fontnum);
6670#endif
6734 6671
6735 font = (MacFontStruct *) xmalloc (sizeof (struct MacFontStruct)); 6672 font = (MacFontStruct *) xmalloc (sizeof (struct MacFontStruct));
6736 6673
6737 font->fontname = (char *) xmalloc (strlen (name) + 1);
6738 bcopy (name, font->fontname, strlen (name) + 1);
6739
6740 font->mac_fontnum = fontnum; 6674 font->mac_fontnum = fontnum;
6741 font->mac_fontsize = size; 6675 font->mac_fontsize = size;
6742 font->mac_fontface = fontface; 6676 font->mac_fontface = fontface;
6743 font->mac_scriptcode = FontToScript (fontnum); 6677 font->mac_scriptcode = scriptcode;
6744 6678
6745 /* Apple Japanese (SJIS) font is listed as both 6679 /* Apple Japanese (SJIS) font is listed as both
6746 "*-jisx0208.1983-sjis" (Japanese script) and "*-jisx0201.1976-0" 6680 "*-jisx0208.1983-sjis" (Japanese script) and "*-jisx0201.1976-0"
6747 (Roman script) in init_font_name_table (). The latter should be 6681 (Roman script) in init_font_name_table (). The latter should be
6748 treated as a one-byte font. */ 6682 treated as a one-byte font. */
6749 { 6683 if (scriptcode == smJapanese && strcmp (charset, "jisx0201.1976-0") == 0)
6750 char cs[32]; 6684 font->mac_scriptcode = smRoman;
6751 6685
6752 if (sscanf (name, 6686 font->full_name = mac_to_x_fontname (mfontname_decoded, size, fontface, charset);
6753 "-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]--%*[^-]-%*[^-]-%*[^-]-%*[^-]-%*c-%*[^-]-%31s",
6754 cs) == 1
6755 && 0 == strcmp (cs, "jisx0201.1976-0"))
6756 font->mac_scriptcode = smRoman;
6757 }
6758 6687
6759 is_two_byte_font = font->mac_scriptcode == smJapanese || 6688 is_two_byte_font = font->mac_scriptcode == smJapanese ||
6760 font->mac_scriptcode == smTradChinese || 6689 font->mac_scriptcode == smTradChinese ||
@@ -6879,7 +6808,7 @@ mac_unload_font (dpyinfo, font)
6879 struct mac_display_info *dpyinfo; 6808 struct mac_display_info *dpyinfo;
6880 XFontStruct *font; 6809 XFontStruct *font;
6881{ 6810{
6882 xfree (font->fontname); 6811 xfree (font->full_name);
6883 if (font->per_char) 6812 if (font->per_char)
6884 xfree (font->per_char); 6813 xfree (font->per_char);
6885 xfree (font); 6814 xfree (font);
@@ -6919,6 +6848,8 @@ x_load_font (f, fontname, size)
6919 SDATA (XCAR (tail))))) 6848 SDATA (XCAR (tail)))))
6920 return (dpyinfo->font_table + i); 6849 return (dpyinfo->font_table + i);
6921 } 6850 }
6851 else
6852 return NULL;
6922 6853
6923 /* Load the font and add it to the table. */ 6854 /* Load the font and add it to the table. */
6924 { 6855 {
@@ -6928,13 +6859,7 @@ x_load_font (f, fontname, size)
6928 unsigned long value; 6859 unsigned long value;
6929 int i; 6860 int i;
6930 6861
6931 /* If we have found fonts by x_list_font, load one of them. If 6862 fontname = (char *) SDATA (XCAR (font_names));
6932 not, we still try to load a font by the name given as FONTNAME
6933 because XListFonts (called in x_list_font) of some X server has
6934 a bug of not finding a font even if the font surely exists and
6935 is loadable by XLoadQueryFont. */
6936 if (size > 0 && !NILP (font_names))
6937 fontname = (char *) SDATA (XCAR (font_names));
6938 6863
6939 BLOCK_INPUT; 6864 BLOCK_INPUT;
6940 font = (MacFontStruct *) XLoadQueryFont (FRAME_MAC_DISPLAY (f), fontname); 6865 font = (MacFontStruct *) XLoadQueryFont (FRAME_MAC_DISPLAY (f), fontname);
@@ -6967,8 +6892,8 @@ x_load_font (f, fontname, size)
6967 bzero (fontp, sizeof (*fontp)); 6892 bzero (fontp, sizeof (*fontp));
6968 fontp->font = font; 6893 fontp->font = font;
6969 fontp->font_idx = i; 6894 fontp->font_idx = i;
6970 fontp->name = (char *) xmalloc (strlen (font->fontname) + 1); 6895 fontp->name = (char *) xmalloc (strlen (fontname) + 1);
6971 bcopy (font->fontname, fontp->name, strlen (font->fontname) + 1); 6896 bcopy (fontname, fontp->name, strlen (fontname) + 1);
6972 6897
6973 if (font->min_bounds.width == font->max_bounds.width) 6898 if (font->min_bounds.width == font->max_bounds.width)
6974 { 6899 {
@@ -6999,7 +6924,8 @@ x_load_font (f, fontname, size)
6999 fontp->average_width = FONT_WIDTH (font); 6924 fontp->average_width = FONT_WIDTH (font);
7000 } 6925 }
7001 6926
7002 fontp->full_name = fontp->name; 6927 fontp->full_name = (char *) xmalloc (strlen (font->full_name) + 1);
6928 bcopy (font->full_name, fontp->full_name, strlen (font->full_name) + 1);
7003 6929
7004 fontp->size = font->max_bounds.width; 6930 fontp->size = font->max_bounds.width;
7005 fontp->height = FONT_HEIGHT (font); 6931 fontp->height = FONT_HEIGHT (font);
@@ -9811,18 +9737,6 @@ syms_of_macterm ()
9811 Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop"); 9737 Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop");
9812 staticpro (&Qmac_ready_for_drag_n_drop); 9738 staticpro (&Qmac_ready_for_drag_n_drop);
9813 9739
9814 Qbig5 = intern ("big5");
9815 staticpro (&Qbig5);
9816
9817 Qcn_gb = intern ("cn-gb");
9818 staticpro (&Qcn_gb);
9819
9820 Qsjis = intern ("sjis");
9821 staticpro (&Qsjis);
9822
9823 Qeuc_kr = intern ("euc-kr");
9824 staticpro (&Qeuc_kr);
9825
9826 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, 9740 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
9827 doc: /* If not nil, Emacs uses toolkit scroll bars. */); 9741 doc: /* If not nil, Emacs uses toolkit scroll bars. */);
9828 Vx_toolkit_scroll_bars = Qt; 9742 Vx_toolkit_scroll_bars = Qt;
@@ -9889,6 +9803,22 @@ Toolbox for processing before Emacs sees it. */);
9889The text will be rendered using Core Graphics text rendering which 9803The text will be rendered using Core Graphics text rendering which
9890may anti-alias the text. */); 9804may anti-alias the text. */);
9891 Vmac_use_core_graphics = Qnil; 9805 Vmac_use_core_graphics = Qnil;
9806
9807 /* Register an entry for `mac-roman' so that it can be used when
9808 creating the terminal frame on Mac OS 9 before loading
9809 term/mac-win.elc. */
9810 DEFVAR_LISP ("mac-charset-info-alist", &Vmac_charset_info_alist,
9811 doc: /* Alist linking Emacs character sets to Mac text encoding and Emacs coding system.
9812Each entry should be of the form:
9813
9814 (CHARSET-NAME TEXT-ENCODING CODING-SYSTEM)
9815
9816where CHARSET-NAME is a string used in font names to identify the
9817charset, TEXT-ENCODING is a TextEncodingBase value, and CODING_SYSTEM
9818is a coding system corresponding to TEXT-ENCODING. */);
9819 Vmac_charset_info_alist =
9820 Fcons (list3 (build_string ("mac-roman"),
9821 make_number (smRoman), Qnil), Qnil);
9892} 9822}
9893 9823
9894/* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b 9824/* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b
diff --git a/src/xdisp.c b/src/xdisp.c
index 12ee4fef7d3..736b60f9a95 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2702,6 +2702,10 @@ handle_stop (it)
2702 it->dpvec = NULL; 2702 it->dpvec = NULL;
2703 it->current.dpvec_index = -1; 2703 it->current.dpvec_index = -1;
2704 2704
2705 /* Use face of preceding text for ellipsis (if invisible) */
2706 if (it->selective_display_ellipsis_p)
2707 it->saved_face_id = it->face_id;
2708
2705 do 2709 do
2706 { 2710 {
2707 handled = HANDLED_NORMALLY; 2711 handled = HANDLED_NORMALLY;
@@ -3379,8 +3383,11 @@ setup_for_ellipsis (it, len)
3379 it->dpvec_face_id = -1; 3383 it->dpvec_face_id = -1;
3380 3384
3381 /* Remember the current face id in case glyphs specify faces. 3385 /* Remember the current face id in case glyphs specify faces.
3382 IT's face is restored in set_iterator_to_next. */ 3386 IT's face is restored in set_iterator_to_next.
3383 it->saved_face_id = it->face_id; 3387 saved_face_id was set to preceding char's face in handle_stop. */
3388 if (it->saved_face_id < 0 || it->saved_face_id != it->face_id)
3389 it->saved_face_id = it->face_id = DEFAULT_FACE_ID;
3390
3384 it->method = GET_FROM_DISPLAY_VECTOR; 3391 it->method = GET_FROM_DISPLAY_VECTOR;
3385 it->ellipsis_p = 1; 3392 it->ellipsis_p = 1;
3386} 3393}
@@ -5419,6 +5426,8 @@ next_element_from_display_vector (it)
5419 /* Precondition. */ 5426 /* Precondition. */
5420 xassert (it->dpvec && it->current.dpvec_index >= 0); 5427 xassert (it->dpvec && it->current.dpvec_index >= 0);
5421 5428
5429 it->face_id = it->saved_face_id;
5430
5422 if (INTEGERP (*it->dpvec) 5431 if (INTEGERP (*it->dpvec)
5423 && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec))) 5432 && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec)))
5424 { 5433 {
diff --git a/src/xfaces.c b/src/xfaces.c
index 89267c8f7f6..099ad673ddd 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3228,25 +3228,19 @@ resolve_face_name (face_name)
3228 Lisp_Object face_name; 3228 Lisp_Object face_name;
3229{ 3229{
3230 Lisp_Object aliased; 3230 Lisp_Object aliased;
3231 Lisp_Object args[2]; 3231 int alias_loop_max = 10;
3232 int c = 0;
3233 3232
3234 if (STRINGP (face_name)) 3233 if (STRINGP (face_name))
3235 face_name = intern (SDATA (face_name)); 3234 face_name = intern (SDATA (face_name));
3236 3235
3237 /* Protect against loops by limiting the number of indirections. */ 3236 while (SYMBOLP (face_name))
3238 while (SYMBOLP (face_name) && c < 10)
3239 { 3237 {
3240 /* Fget can signal an error; just ignore it. */ 3238 aliased = Fsafe_get (face_name, Qface_alias);
3241 args[0] = face_name;
3242 args[1] = Qface_alias;
3243 aliased = internal_condition_case_2 (internal_resolve_face_name, 2, args, Qt,
3244 resolve_face_name_error);
3245 if (NILP (aliased)) 3239 if (NILP (aliased))
3246 break; 3240 break;
3247 else 3241 if (--alias_loop_max == 0)
3248 face_name = aliased; 3242 break;
3249 c++; 3243 face_name = aliased;
3250 } 3244 }
3251 3245
3252 return face_name; 3246 return face_name;