;;; faces.el --- Lisp faces
;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; unavailable, and we fall back on the courier and helv families,
;; which are generally available.
(defcustom face-font-family-alternatives
+ (mapcar (lambda (arg) (mapcar 'purecopy arg))
'(("Monospace" "courier" "fixed")
("courier" "CMU Typewriter Text" "fixed")
("Sans Serif" "helv" "helvetica" "arial" "fixed")
- ("helv" "helvetica" "arial" "fixed"))
+ ("helv" "helvetica" "arial" "fixed")))
"Alist of alternative font family names.
Each element has the form (FAMILY ALTERNATIVE1 ALTERNATIVE2 ...).
If fonts of family FAMILY can't be loaded, try ALTERNATIVE1, then
;; This is defined originally in xfaces.c.
(defcustom face-font-registry-alternatives
+ (mapcar (lambda (arg) (mapcar 'purecopy arg))
(if (eq system-type 'windows-nt)
'(("iso8859-1" "ms-oemlatin")
("gb2312.1980" "gb2312" "gbk" "gb18030")
'(("gb2312.1980" "gb2312.80&gb8565.88" "gbk" "gb18030")
("jisx0208.1990" "jisx0208.1983" "jisx0208.1978")
("ksc5601.1989" "ksx1001.1992" "ksc5601.1987")
- ("muletibetan-2" "muletibetan-0")))
+ ("muletibetan-2" "muletibetan-0"))))
"Alist of alternative font registry names.
Each element has the form (REGISTRY ALTERNATIVE1 ALTERNATIVE2 ...).
If fonts of registry REGISTRY can be loaded, font selection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defcustom face-x-resources
+ (mapcar
+ (lambda (arg)
+ ;; FIXME; can we purecopy some of the conses too?
+ (cons (car arg)
+ (cons (purecopy (car (cdr arg))) (purecopy (cdr (cdr arg))))))
'((:family (".attributeFamily" . "Face.AttributeFamily"))
(:foundry (".attributeFoundry" . "Face.AttributeFoundry"))
(:width (".attributeWidth" . "Face.AttributeWidth"))
(:bold (".attributeBold" . "Face.AttributeBold"))
(:italic (".attributeItalic" . "Face.AttributeItalic"))
(:font (".attributeFont" . "Face.AttributeFont"))
- (:inherit (".attributeInherit" . "Face.AttributeInherit")))
+ (:inherit (".attributeInherit" . "Face.AttributeInherit"))))
"List of X resources and classes for face attributes.
Each element has the form (ATTRIBUTE ENTRY1 ENTRY2...) where ATTRIBUTE is
the name of a face attribute, and each ENTRY is a cons of the form
attribute is changed on all frames).
ARGS must come in pairs ATTRIBUTE VALUE. ATTRIBUTE must be a valid
-face attribute name. All attributes can be set to `unspecified';
+face attribute name. All attributes can be set to `unspecified';
this fact is not further mentioned below.
The following attributes are recognized:
(unless foundry
(setq foundry (match-string 1 family)))
(setq family (match-string 2 family)))
- (when (stringp family)
+ (when (or (stringp family) (eq family 'unspecified))
(internal-set-lisp-face-attribute face :family (purecopy family)
where))
- (when (stringp foundry)
+ (when (or (stringp foundry) (eq foundry 'unspecified))
(internal-set-lisp-face-attribute face :foundry (purecopy foundry)
where)))
(while args
(defun face-valid-attribute-values (attribute &optional frame)
"Return valid values for face attribute ATTRIBUTE.
The optional argument FRAME is used to determine available fonts
-and colors. If it is nil or not specified, the selected frame is
-used. Value is an alist of (NAME . VALUE) if ATTRIBUTE expects a value
-out of a set of discrete values. Value is `integerp' if ATTRIBUTE expects
+and colors. If it is nil or not specified, the selected frame is used.
+Value is an alist of (NAME . VALUE) if ATTRIBUTE expects a value out
+of a set of discrete values. Value is `integerp' if ATTRIBUTE expects
an integer value."
(let ((valid
(case attribute
valid)))
-(defvar face-attribute-name-alist
+(defconst face-attribute-name-alist
'((:family . "font family")
(:foundry . "font foundry")
(:width . "character set width")
;;; Listing faces.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defvar list-faces-sample-text
+(defconst list-faces-sample-text
"abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"*Text string to display as the sample text for `list-faces-display'.")
(setq max-length (1+ max-length)
line-format (format "%%-%ds" max-length))
(with-help-window "*Faces*"
- (save-excursion
- (set-buffer standard-output)
+ (with-current-buffer standard-output
(setq truncate-lines t)
(insert
(substitute-command-keys
(if (not (listp face))
(setq face (list face)))
(with-help-window (help-buffer)
- (save-excursion
- (set-buffer standard-output)
+ (with-current-buffer standard-output
(dolist (f face)
(if (stringp f) (setq f (intern f)))
;; We may get called for anonymous faces (i.e., faces
settings, X resources, and `face-new-frame-defaults'.
Finally, apply any relevant face attributes found amongst the
frame parameters in PARAMETERS and `default-frame-alist'."
- (dolist (face (nreverse (face-list)))
+ (dolist (face (nreverse (face-list))) ;Why reverse? --Stef
(condition-case ()
(progn
;; Initialize faces from face spec and custom theme.
\f
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Compatiblity with 20.2
+;;; Compatibility with 20.2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Update a frame's faces when we change its default font.
(encoding "[^-]+")
)
(setq x-font-regexp
- (concat "\\`\\*?[-?*]"
+ (purecopy (concat "\\`\\*?[-?*]"
foundry - family - weight\? - slant\? - swidth - adstyle -
pixelsize - pointsize - resx - resy - spacing - avgwidth -
registry - encoding "\\*?\\'"
- ))
+ )))
(setq x-font-regexp-head
- (concat "\\`[-?*]" foundry - family - weight\? - slant\?
- "\\([-*?]\\|\\'\\)"))
- (setq x-font-regexp-slant (concat - slant -))
- (setq x-font-regexp-weight (concat - weight -))
+ (purecopy (concat "\\`[-?*]" foundry - family - weight\? - slant\?
+ "\\([-*?]\\|\\'\\)")))
+ (setq x-font-regexp-slant (purecopy (concat - slant -)))
+ (setq x-font-regexp-weight (purecopy (concat - weight -)))
nil)