aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2001-05-29 16:12:03 +0000
committerSam Steingold2001-05-29 16:12:03 +0000
commit00f5189042c641aecca28ff797aeefd67cd0ff2e (patch)
treeb7525ca33f72bbb8681822733cff909dc099989b
parentb781e739bfe13f50f98e2616e5c6a9bb8f7da5f4 (diff)
downloademacs-00f5189042c641aecca28ff797aeefd67cd0ff2e.tar.gz
emacs-00f5189042c641aecca28ff797aeefd67cd0ff2e.zip
minor optimization
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/faces.el99
2 files changed, 51 insertions, 51 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cad0cd77755..59f13a59b00 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12001-05-29 Sam Steingold <sds@gnu.org> 12001-05-29 Sam Steingold <sds@gnu.org>
2 2
3 * faces.el (face-valid-attribute-values): Bind `valid' directly
4 instead of using `setq'.
5
3 * textmodes/tex-mode.el (tex-feed-input, tex-display-shell): 6 * textmodes/tex-mode.el (tex-feed-input, tex-display-shell):
4 Use `tex-shell-buf'. 7 Use `tex-shell-buf'.
5 (tex-shell-proc): Use `tex-shell-running'. 8 (tex-shell-proc): Use `tex-shell-running'.
diff --git a/lisp/faces.el b/lisp/faces.el
index 789528c7dfd..ce97ed1ace0 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -327,8 +327,8 @@ specifies an invalid attribute."
327 (dolist (entry (cdr definition)) 327 (dolist (entry (cdr definition))
328 (set-face-attribute-from-resource face attribute (car entry) 328 (set-face-attribute-from-resource face attribute (car entry)
329 (cdr entry) frame)))))) 329 (cdr entry) frame))))))
330 330
331 331
332(defun make-face-x-resource-internal (face &optional frame) 332(defun make-face-x-resource-internal (face &optional frame)
333 "Fill frame-local FACE on FRAME from X resources. 333 "Fill frame-local FACE on FRAME from X resources.
334FRAME nil or not specified means do it for all frames." 334FRAME nil or not specified means do it for all frames."
@@ -363,7 +363,7 @@ If FRAME is t, report on the defaults for face FACE (for new frames).
363If FRAME is omitted or nil, use the selected frame." 363If FRAME is omitted or nil, use the selected frame."
364 (let ((value (internal-get-lisp-face-attribute face :foreground frame))) 364 (let ((value (internal-get-lisp-face-attribute face :foreground frame)))
365 (if (eq value 'unspecified) 365 (if (eq value 'unspecified)
366 nil 366 nil
367 value))) 367 value)))
368 368
369 369
@@ -426,7 +426,7 @@ If FRAME is omitted or nil, use the selected frame.
426Use `face-attribute' for finer control." 426Use `face-attribute' for finer control."
427 (let ((italic (face-attribute face :slant frame))) 427 (let ((italic (face-attribute face :slant frame)))
428 (memq italic '(italic oblique)))) 428 (memq italic '(italic oblique))))
429 429
430 430
431 431
432;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 432;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -603,7 +603,7 @@ Argument NOERROR is ignored and retained for compatibility."
603 (interactive (list (read-face-name "Make which face non-bold "))) 603 (interactive (list (read-face-name "Make which face non-bold ")))
604 (set-face-attribute face frame :weight 'normal)) 604 (set-face-attribute face frame :weight 'normal))
605 605
606 606
607(defun make-face-italic (face &optional frame noerror) 607(defun make-face-italic (face &optional frame noerror)
608 "Make the font of FACE be italic, if possible. 608 "Make the font of FACE be italic, if possible.
609FRAME nil or not specified means change face on all frames. 609FRAME nil or not specified means change face on all frames.
@@ -620,7 +620,7 @@ Argument NOERROR is ignored and retained for compatibility."
620 (interactive (list (read-face-name "Make which face non-italic "))) 620 (interactive (list (read-face-name "Make which face non-italic ")))
621 (set-face-attribute face frame :slant 'normal)) 621 (set-face-attribute face frame :slant 'normal))
622 622
623 623
624(defun make-face-bold-italic (face &optional frame noerror) 624(defun make-face-bold-italic (face &optional frame noerror)
625 "Make the font of FACE be bold and italic, if possible. 625 "Make the font of FACE be bold and italic, if possible.
626FRAME nil or not specified means change face on all frames. 626FRAME nil or not specified means change face on all frames.
@@ -781,50 +781,48 @@ and colors. If it is nil or not specified, the selected frame is
781used. Value is an alist of (NAME . VALUE) if ATTRIBUTE expects a value 781used. Value is an alist of (NAME . VALUE) if ATTRIBUTE expects a value
782out of a set of discrete values. Value is `integerp' if ATTRIBUTE expects 782out of a set of discrete values. Value is `integerp' if ATTRIBUTE expects
783an integer value." 783an integer value."
784 (let (valid) 784 (let ((valid
785 (setq valid 785 (case attribute
786 (case attribute 786 (:family
787 (:family 787 (if window-system
788 (if window-system 788 (mapcar #'(lambda (x) (cons (car x) (car x)))
789 (mapcar #'(lambda (x) (cons (car x) (car x))) 789 (x-font-family-list))
790 (x-font-family-list)) 790 ;; Only one font on TTYs.
791 ;; Only one font on TTYs. 791 (list (cons "default" "default"))))
792 (list (cons "default" "default")))) 792 ((:width :weight :slant :inverse-video)
793 ((:width :weight :slant :inverse-video) 793 (mapcar #'(lambda (x) (cons (symbol-name x) x))
794 (mapcar #'(lambda (x) (cons (symbol-name x) x)) 794 (internal-lisp-face-attribute-values attribute)))
795 (internal-lisp-face-attribute-values attribute))) 795 ((:underline :overline :strike-through :box)
796 ((:underline :overline :strike-through :box) 796 (if window-system
797 (if window-system 797 (nconc (mapcar #'(lambda (x) (cons (symbol-name x) x))
798 (nconc (mapcar #'(lambda (x) (cons (symbol-name x) x)) 798 (internal-lisp-face-attribute-values attribute))
799 (internal-lisp-face-attribute-values attribute)) 799 (mapcar #'(lambda (c) (cons c c))
800 (mapcar #'(lambda (c) (cons c c)) 800 (x-defined-colors frame)))
801 (x-defined-colors frame))) 801 (mapcar #'(lambda (x) (cons (symbol-name x) x))
802 (mapcar #'(lambda (x) (cons (symbol-name x) x)) 802 (internal-lisp-face-attribute-values attribute))))
803 (internal-lisp-face-attribute-values attribute)))) 803 ((:foreground :background)
804 ((:foreground :background) 804 (mapcar #'(lambda (c) (cons c c))
805 (mapcar #'(lambda (c) (cons c c)) 805 (defined-colors frame)))
806 (defined-colors frame))) 806 ((:height)
807 ((:height) 807 'integerp)
808 'integerp) 808 (:stipple
809 (:stipple 809 (and (memq window-system '(x w32 mac))
810 (and (memq window-system '(x w32 mac)) 810 (mapcar #'list
811 (mapcar #'list 811 (apply #'nconc
812 (apply #'nconc 812 (mapcar (lambda (dir)
813 (mapcar (lambda (dir) 813 (and (file-readable-p dir)
814 (and (file-readable-p dir) 814 (file-directory-p dir)
815 (file-directory-p dir) 815 (directory-files dir)))
816 (directory-files dir))) 816 x-bitmap-file-path)))))
817 x-bitmap-file-path))))) 817 (:inherit
818 (:inherit 818 (cons '("none" . nil)
819 (cons '("none" . nil) 819 (mapcar #'(lambda (c) (cons (symbol-name c) c))
820 (mapcar #'(lambda (c) (cons (symbol-name c) c)) 820 (face-list))))
821 (face-list)))) 821 (t
822 (t 822 (error "Internal error")))))
823 (error "Internal error"))))
824 (if (and (listp valid) (not (memq attribute '(:inherit)))) 823 (if (and (listp valid) (not (memq attribute '(:inherit))))
825 (nconc (list (cons "unspecified" 'unspecified)) valid) 824 (nconc (list (cons "unspecified" 'unspecified)) valid)
826 valid))) 825 valid)))
827
828 826
829 827
830(defvar face-attribute-name-alist 828(defvar face-attribute-name-alist
@@ -965,7 +963,6 @@ Value is a property list of attribute names and new values."
965 (cons (read-face-attribute face (car attribute) frame) 963 (cons (read-face-attribute face (car attribute) frame)
966 result)))))) 964 result))))))
967 965
968
969(defun modify-face (&optional face foreground background stipple 966(defun modify-face (&optional face foreground background stipple
970 bold-p italic-p underline-p inverse-p frame) 967 bold-p italic-p underline-p inverse-p frame)
971 "Modify attributes of faces interactively. 968 "Modify attributes of faces interactively.
@@ -1154,7 +1151,7 @@ VALUE is the specified value of that attribute."
1154 (value (face-attribute face attribute))) 1151 (value (face-attribute face attribute)))
1155 (unless (eq value 'unspecified) 1152 (unless (eq value 'unspecified)
1156 (setq result (nconc (list attribute value) result))))))) 1153 (setq result (nconc (list attribute value) result)))))))
1157 1154
1158 1155
1159(defun face-spec-set-match-display (display frame) 1156(defun face-spec-set-match-display (display frame)
1160 "Non-nil if DISPLAY matches FRAME. 1157 "Non-nil if DISPLAY matches FRAME.
@@ -1245,7 +1242,7 @@ If SPEC is nil, do nothing."
1245 (:bold (setq attribute :weight value (if value 'bold 'normal))) 1242 (:bold (setq attribute :weight value (if value 'bold 'normal)))
1246 (:italic (setq attribute :slant value (if value 'italic 'normal))) 1243 (:italic (setq attribute :slant value (if value 'italic 'normal)))
1247 ((:foreground :background) 1244 ((:foreground :background)
1248 ;; Compatibility with 20.x. Some bogus face specs seem to 1245 ;; Compatibility with 20.x. Some bogus face specs seem to
1249 ;; exist containing things like `:foreground nil'. 1246 ;; exist containing things like `:foreground nil'.
1250 (if (null value) (setq value 'unspecified))) 1247 (if (null value) (setq value 'unspecified)))
1251 (t (unless (assq attribute face-x-resources) 1248 (t (unless (assq attribute face-x-resources)
@@ -1588,7 +1585,7 @@ created."
1588 (let ((frame (selected-frame))) 1585 (let ((frame (selected-frame)))
1589 (frame-set-background-mode frame) 1586 (frame-set-background-mode frame)
1590 (face-set-after-frame-default frame))) 1587 (face-set-after-frame-default frame)))
1591 1588
1592 1589
1593 1590
1594 1591