(format "Set face %s %s: " face name))
alist)))
(cond ((equal value "none")
- nil)
+ '(nil))
((equal value "")
default)
(t value))))
FOREGROUND and BACKGROUND should be a colour name string (or list of strings to
try) or nil. STIPPLE should be a stipple pattern name string or nil.
If nil, means do not change the display attribute corresponding to that arg.
+If (nil), that means clear out the attribute.
BOLD-P, ITALIC-P, UNDERLINE-P, and INVERSE-P specify whether
the face should be set bold, italic, underlined or in inverse-video,
(message "Face %s: %s" face
(mapconcat 'identity
(delq nil
- (list (and foreground (concat (downcase foreground) " foreground"))
- (and background (concat (downcase background) " background"))
- (and stipple (concat (downcase new-stipple-string) " stipple"))
+ (list (if (equal foreground '(nil))
+ " no foreground"
+ (and foreground (concat (downcase foreground) " foreground")))
+ (if (equal background '(nil))
+ " no background"
+ (and background (concat (downcase background) " background")))
+ (if (equal stipple '(nil))
+ " no stipple"
+ (and stipple (concat (downcase new-stipple-string) " stipple")))
(and bold-p "bold") (and italic-p "italic")
(and inverse-p "inverse")
(and underline-p "underline"))) ", "))
(let ((faces (sort (face-list) (function string-lessp)))
(face nil)
(frame (selected-frame))
- disp-frame window)
+ disp-frame window
+ (face-name-max-length
+ (car (sort (mapcar (function string-width)
+ (mapcar (function symbol-name) (face-list)))
+ (function >)))))
(with-output-to-temp-buffer "*Faces*"
(save-excursion
(set-buffer standard-output)
(while faces
(setq face (car faces))
(setq faces (cdr faces))
- (insert (format "%25s " (symbol-name face)))
+ (insert (format
+ (format "%%-%ds "
+ face-name-max-length)
+ (symbol-name face)))
(let ((beg (point)))
(insert list-faces-sample-text)
(insert "\n")
(goto-char beg)
(forward-line 1)
(while (not (eobp))
- (insert " ")
+ (insert-char ? (1+ face-name-max-length))
(forward-line 1))))
- (goto-char (point-min))))
+ (goto-char (point-min)))
+ (print-help-return-message))
;; If the *Faces* buffer appears in a different frame,
;; copy all the face definitions from FRAME,
;; so that the display will reflect the frame that was selected.
(let ((doc (face-documentation face)))
(if doc
(princ doc)
- (princ "not documented as a face.")))))
+ (princ "not documented as a face.")))
+ (print-help-return-message)))
\f
;;; Setting a face based on a SPEC.
;; Put the geometry parameters at the end.
;; Copy default-frame-alist so that they go after it.
(setq parameters (append parameters default-frame-alist parsed)))))
+
+ (if default-enable-multibyte-characters
+ ;; If an ASCII font is specified in PARAMETERS, we try to create
+ ;; a fontset from it, and use it for the new frame.
+ (condition-case nil
+ (let ((font (cdr (assq 'font parameters))))
+ (if (and font
+ (not (query-fontset font)))
+ (setq parameters
+ (cons (cons 'font (create-fontset-from-ascii-font font))
+ parameters))))
+ (error nil)))
+
(let (frame)
(if (null global-face-data)
(progn
(defun frame-set-background-mode (frame)
"Set up the `background-mode' and `display-type' frame parameters for FRAME."
- (let ((bg-resource (x-get-resource ".backgroundMode"
- "BackgroundMode"))
- (params (frame-parameters frame))
- (bg-mode))
- (setq bg-mode
- (cond (frame-background-mode)
- (bg-resource (intern (downcase bg-resource)))
- ((< (apply '+ (x-color-values
- (cdr (assq 'background-color params))
- frame))
- ;; Just looking at the screen,
- ;; colors whose values add up to .6 of the white total
- ;; still look dark to me.
- (* (apply '+ (x-color-values "white" frame)) .6))
- 'dark)
- (t 'light)))
- (modify-frame-parameters frame
- (list (cons 'background-mode bg-mode)
- (cons 'display-type
- (cond ((x-display-color-p frame)
- 'color)
- ((x-display-grayscale-p frame)
- 'grayscale)
- (t 'mono)))))))
+ (unless (eq (framep frame) t)
+ (let ((bg-resource (x-get-resource ".backgroundMode"
+ "BackgroundMode"))
+ (params (frame-parameters frame))
+ (bg-mode))
+ (setq bg-mode
+ (cond (frame-background-mode)
+ (bg-resource (intern (downcase bg-resource)))
+ ((< (apply '+ (x-color-values
+ (cdr (assq 'background-color params))
+ frame))
+ ;; Just looking at the screen,
+ ;; colors whose values add up to .6 of the white total
+ ;; still look dark to me.
+ (* (apply '+ (x-color-values "white" frame)) .6))
+ 'dark)
+ (t 'light)))
+ (modify-frame-parameters frame
+ (list (cons 'background-mode bg-mode)
+ (cons 'display-type
+ (cond ((x-display-color-p frame)
+ 'color)
+ ((x-display-grayscale-p frame)
+ 'grayscale)
+ (t 'mono))))))))
;; Update a frame's faces when we change its default font.
(defun frame-update-faces (frame) nil)
(set-face-inverse-video-p face t frame)
(let (done)
(while (and colors (not done))
- (if (or (memq (car colors) '(t underline))
+ (if (or (memq (car colors) '(t underline nil))
(face-color-supported-p frame (car colors)
(eq function 'set-face-background)))
(if (cdr colors)