aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-03-04 23:00:28 +0000
committerStefan Monnier2002-03-04 23:00:28 +0000
commitb6b90dfc51453d0f9c2e594d6aa842c33df6b1ba (patch)
tree5d6e3f3e2d925ae5cf0987992981e6a867af6043
parent3881a186743fdde1716d4633d6098b51caf2a02e (diff)
downloademacs-b6b90dfc51453d0f9c2e594d6aa842c33df6b1ba.tar.gz
emacs-b6b90dfc51453d0f9c2e594d6aa842c33df6b1ba.zip
(face-spec-choose): Allow `t' to appear before the end.
(mode-line, tool-bar, minibuffer-prompt, region, fringe, bold, italic) (bold-italic, underline, highlight, secondary-selection, fixed-pitch) (variable-pitch, trailing-whitespace): Don't use the old-style entries. (mode-line-inactive, header-line): Move the `t' section to the beginning so the `:inherit' setting can be shared.
-rw-r--r--lisp/faces.el112
1 files changed, 53 insertions, 59 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index fda5cdb705f..932e0f3f6e4 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -384,7 +384,7 @@ completely specified)."
384 (when (and inherit 384 (when (and inherit
385 (not (eq inherit t)) 385 (not (eq inherit t))
386 (face-attribute-relative-p attribute value)) 386 (face-attribute-relative-p attribute value))
387 ;; We should merge with INHERIT as well 387 ;; We should merge with INHERIT as well
388 (setq value (face-attribute-merged-with attribute value inherit frame))) 388 (setq value (face-attribute-merged-with attribute value inherit frame)))
389 value)) 389 value))
390 390
@@ -1283,19 +1283,21 @@ If SPEC is nil, return nil."
1283 (unless frame 1283 (unless frame
1284 (setq frame (selected-frame))) 1284 (setq frame (selected-frame)))
1285 (let ((tail spec) 1285 (let ((tail spec)
1286 result) 1286 result all)
1287 (while tail 1287 (while tail
1288 (let* ((entry (pop tail)) 1288 (let* ((entry (pop tail))
1289 (display (car entry)) 1289 (display (car entry))
1290 (attrs (cdr entry))) 1290 (attrs (cdr entry)))
1291 (when (face-spec-set-match-display display frame) 1291 (when (face-spec-set-match-display display frame)
1292 (setq result (if (listp (car attrs)) 1292 (setq result (if (null (cdr attrs)) ;; was (listp (car attrs))
1293 ;; Old-style entry, the attribute list is the 1293 ;; Old-style entry, the attribute list is the
1294 ;; first element. 1294 ;; first element.
1295 (car attrs) 1295 (car attrs)
1296 attrs) 1296 attrs))
1297 tail nil)))) 1297 (if (eq display t)
1298 result)) 1298 (setq all result result nil)
1299 (setq tail nil)))))
1300 (if all (append result all) result)))
1299 1301
1300 1302
1301(defun face-spec-reset-face (face &optional frame) 1303(defun face-spec-reset-face (face &optional frame)
@@ -1704,29 +1706,26 @@ created."
1704 1706
1705(defface mode-line 1707(defface mode-line
1706 '((((type x w32 mac) (class color)) 1708 '((((type x w32 mac) (class color))
1707 (:box (:line-width -1 :style released-button) 1709 :box (:line-width -1 :style released-button)
1708 :background "grey75" :foreground "black")) 1710 :background "grey75" :foreground "black")
1709 (t 1711 (t
1710 (:inverse-video t))) 1712 :inverse-video t))
1711 "Basic mode line face for selected window." 1713 "Basic mode line face for selected window."
1712 :version "21.1" 1714 :version "21.1"
1713 :group 'modeline 1715 :group 'modeline
1714 :group 'basic-faces) 1716 :group 'basic-faces)
1715 1717
1716(defface mode-line-inactive 1718(defface mode-line-inactive
1717 '((((type x w32 mac) (background light) (class color)) 1719 '((t
1718 :inherit mode-line 1720 :inherit mode-line)
1721 (((type x w32 mac) (background light) (class color))
1719 :weight light 1722 :weight light
1720 :box (:line-width -1 :color "grey75" :style nil) 1723 :box (:line-width -1 :color "grey75" :style nil)
1721 :foreground "grey20" :background "grey90") 1724 :foreground "grey20" :background "grey90")
1722 (((type x w32 mac) (background dark) (class color)) 1725 (((type x w32 mac) (background dark) (class color))
1723 :inherit mode-line
1724 :weight light 1726 :weight light
1725 :box (:line-width -1 :color "grey40" :style nil) 1727 :box (:line-width -1 :color "grey40" :style nil)
1726 :foreground "grey80" :background "grey30") 1728 :foreground "grey80" :background "grey30"))
1727 (t
1728 :inherit mode-line
1729 :inverse-video t))
1730 "Basic mode line face for non-selected windows." 1729 "Basic mode line face for non-selected windows."
1731 :version "21.2" 1730 :version "21.2"
1732 :group 'modeline 1731 :group 'modeline
@@ -1737,7 +1736,9 @@ created."
1737(put 'modeline-inactive 'face-alias 'mode-line-inactive) 1736(put 'modeline-inactive 'face-alias 'mode-line-inactive)
1738 1737
1739(defface header-line 1738(defface header-line
1740 '((((type tty)) 1739 '((t
1740 :inherit mode-line)
1741 (((type tty))
1741 ;; This used to be `:inverse-video t', but that doesn't look very 1742 ;; This used to be `:inverse-video t', but that doesn't look very
1742 ;; good when combined with inverse-video mode-lines and multiple 1743 ;; good when combined with inverse-video mode-lines and multiple
1743 ;; windows. Underlining looks better, and is more consistent with 1744 ;; windows. Underlining looks better, and is more consistent with
@@ -1747,30 +1748,23 @@ created."
1747 ;; highlighting; this may be too confusing in general, although it 1748 ;; highlighting; this may be too confusing in general, although it
1748 ;; happens to look good with the only current use of header-lines, 1749 ;; happens to look good with the only current use of header-lines,
1749 ;; the info browser. XXX 1750 ;; the info browser. XXX
1750 :inherit mode-line
1751 :underline t) 1751 :underline t)
1752 (((class color grayscale) (background light)) 1752 (((class color grayscale) (background light))
1753 :inherit mode-line
1754 :background "grey90" :foreground "grey20" 1753 :background "grey90" :foreground "grey20"
1755 :box nil) 1754 :box nil)
1756 (((class color grayscale) (background dark)) 1755 (((class color grayscale) (background dark))
1757 :inherit mode-line
1758 :background "grey20" :foreground "grey90" 1756 :background "grey20" :foreground "grey90"
1759 :box nil) 1757 :box nil)
1760 (((class mono) (background light)) 1758 (((class mono) (background light))
1761 :inherit mode-line
1762 :background "white" :foreground "black" 1759 :background "white" :foreground "black"
1763 :inverse-video nil 1760 :inverse-video nil
1764 :box nil 1761 :box nil
1765 :underline t) 1762 :underline t)
1766 (((class mono) (background dark)) 1763 (((class mono) (background dark))
1767 :inherit mode-line
1768 :background "black" :foreground "white" 1764 :background "black" :foreground "white"
1769 :inverse-video nil 1765 :inverse-video nil
1770 :box nil 1766 :box nil
1771 :underline t) 1767 :underline t))
1772 (t
1773 :inverse-video t))
1774 "Basic header-line face." 1768 "Basic header-line face."
1775 :version "21.1" 1769 :version "21.1"
1776 :group 'basic-faces) 1770 :group 'basic-faces)
@@ -1778,11 +1772,11 @@ created."
1778 1772
1779(defface tool-bar 1773(defface tool-bar
1780 '((((type x w32 mac) (class color)) 1774 '((((type x w32 mac) (class color))
1781 (:box (:line-width 1 :style released-button) 1775 :box (:line-width 1 :style released-button)
1782 :background "grey75" :foreground "black")) 1776 :background "grey75" :foreground "black")
1783 (((type x) (class mono)) 1777 (((type x) (class mono))
1784 (:box (:line-width 1 :style released-button) 1778 :box (:line-width 1 :style released-button)
1785 :background "grey" :foreground "black")) 1779 :background "grey" :foreground "black")
1786 (t 1780 (t
1787 ())) 1781 ()))
1788 "Basic tool-bar face." 1782 "Basic tool-bar face."
@@ -1790,9 +1784,9 @@ created."
1790 :group 'basic-faces) 1784 :group 'basic-faces)
1791 1785
1792 1786
1793(defface minibuffer-prompt '((((background dark)) (:foreground "cyan")) 1787(defface minibuffer-prompt '((((background dark)) :foreground "cyan")
1794 (((type pc)) (:foreground "magenta")) 1788 (((type pc)) :foreground "magenta")
1795 (t (:foreground "dark blue"))) 1789 (t :foreground "dark blue"))
1796 "Face for minibuffer prompts." 1790 "Face for minibuffer prompts."
1797 :version "21.3" 1791 :version "21.3"
1798 :group 'basic-faces) 1792 :group 'basic-faces)
@@ -1802,14 +1796,14 @@ created."
1802 1796
1803(defface region 1797(defface region
1804 '((((type tty) (class color)) 1798 '((((type tty) (class color))
1805 (:background "blue" :foreground "white")) 1799 :background "blue" :foreground "white")
1806 (((type tty) (class mono)) 1800 (((type tty) (class mono))
1807 (:inverse-video t)) 1801 :inverse-video t)
1808 (((class color) (background dark)) 1802 (((class color) (background dark))
1809 (:background "blue3")) 1803 :background "blue3")
1810 (((class color) (background light)) 1804 (((class color) (background light))
1811 (:background "lightgoldenrod2")) 1805 :background "lightgoldenrod2")
1812 (t (:background "gray"))) 1806 (t :background "gray"))
1813 "Basic face for highlighting the region." 1807 "Basic face for highlighting the region."
1814 :version "21.1" 1808 :version "21.1"
1815 :group 'basic-faces) 1809 :group 'basic-faces)
@@ -1817,11 +1811,11 @@ created."
1817 1811
1818(defface fringe 1812(defface fringe
1819 '((((class color) (background light)) 1813 '((((class color) (background light))
1820 (:background "grey95")) 1814 :background "grey95")
1821 (((class color) (background dark)) 1815 (((class color) (background dark))
1822 (:background "grey10")) 1816 :background "grey10")
1823 (t 1817 (t
1824 (:background "gray"))) 1818 :background "gray"))
1825 "Basic face for the fringes to the left and right of windows under X." 1819 "Basic face for the fringes to the left and right of windows under X."
1826 :version "21.1" 1820 :version "21.1"
1827 :group 'frames 1821 :group 'frames
@@ -1869,66 +1863,66 @@ created."
1869 :group 'basic-faces) 1863 :group 'basic-faces)
1870 1864
1871 1865
1872(defface bold '((t (:weight bold))) 1866(defface bold '((t :weight bold))
1873 "Basic bold face." 1867 "Basic bold face."
1874 :group 'basic-faces) 1868 :group 'basic-faces)
1875 1869
1876 1870
1877(defface italic '((t (:slant italic))) 1871(defface italic '((t :slant italic))
1878 "Basic italic font." 1872 "Basic italic font."
1879 :group 'basic-faces) 1873 :group 'basic-faces)
1880 1874
1881 1875
1882(defface bold-italic '((t (:weight bold :slant italic))) 1876(defface bold-italic '((t :weight bold :slant italic))
1883 "Basic bold-italic face." 1877 "Basic bold-italic face."
1884 :group 'basic-faces) 1878 :group 'basic-faces)
1885 1879
1886 1880
1887(defface underline '((t (:underline t))) 1881(defface underline '((t :underline t))
1888 "Basic underlined face." 1882 "Basic underlined face."
1889 :group 'basic-faces) 1883 :group 'basic-faces)
1890 1884
1891 1885
1892(defface highlight 1886(defface highlight
1893 '((((type tty) (class color)) 1887 '((((type tty) (class color))
1894 (:background "green")) 1888 :background "green")
1895 (((class color) (background light)) 1889 (((class color) (background light))
1896 (:background "darkseagreen2")) 1890 :background "darkseagreen2")
1897 (((class color) (background dark)) 1891 (((class color) (background dark))
1898 (:background "darkolivegreen")) 1892 :background "darkolivegreen")
1899 (t (:inverse-video t))) 1893 (t :inverse-video t))
1900 "Basic face for highlighting." 1894 "Basic face for highlighting."
1901 :group 'basic-faces) 1895 :group 'basic-faces)
1902 1896
1903 1897
1904(defface secondary-selection 1898(defface secondary-selection
1905 '((((type tty) (class color)) 1899 '((((type tty) (class color))
1906 (:background "cyan" :foreground "black")) 1900 :background "cyan" :foreground "black")
1907 (((class color) (background light)) 1901 (((class color) (background light))
1908 (:background "yellow")) 1902 :background "yellow")
1909 (((class color) (background dark)) 1903 (((class color) (background dark))
1910 (:background "SkyBlue4")) 1904 :background "SkyBlue4")
1911 (t (:inverse-video t))) 1905 (t :inverse-video t))
1912 "Basic face for displaying the secondary selection." 1906 "Basic face for displaying the secondary selection."
1913 :group 'basic-faces) 1907 :group 'basic-faces)
1914 1908
1915 1909
1916(defface fixed-pitch '((t (:family "courier"))) 1910(defface fixed-pitch '((t :family "courier"))
1917 "The basic fixed-pitch face." 1911 "The basic fixed-pitch face."
1918 :group 'basic-faces) 1912 :group 'basic-faces)
1919 1913
1920 1914
1921(defface variable-pitch '((t (:family "helv"))) 1915(defface variable-pitch '((t :family "helv"))
1922 "The basic variable-pitch face." 1916 "The basic variable-pitch face."
1923 :group 'basic-faces) 1917 :group 'basic-faces)
1924 1918
1925 1919
1926(defface trailing-whitespace 1920(defface trailing-whitespace
1927 '((((class color) (background light)) 1921 '((((class color) (background light))
1928 (:background "red")) 1922 :background "red")
1929 (((class color) (background dark)) 1923 (((class color) (background dark))
1930 (:background "red")) 1924 :background "red")
1931 (t (:inverse-video t))) 1925 (t :inverse-video t))
1932 "Basic face for highlighting trailing whitespace." 1926 "Basic face for highlighting trailing whitespace."
1933 :version "21.1" 1927 :version "21.1"
1934 :group 'font-lock ; like `show-trailing-whitespace' 1928 :group 'font-lock ; like `show-trailing-whitespace'