comparison lisp/faces.el @ 90195:a1b34dec1104

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-63 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 358-423) - Update from CVS - Remove "-face" suffix from widget faces - Remove "-face" suffix from custom faces - Remove "-face" suffix from change-log faces - Remove "-face" suffix from compilation faces - Remove "-face" suffix from diff-mode faces - lisp/longlines.el (longlines-visible-face): Face removed - Remove "-face" suffix from woman faces - Remove "-face" suffix from whitespace-highlight face - Remove "-face" suffix from ruler-mode faces - Remove "-face" suffix from show-paren faces - Remove "-face" suffix from log-view faces - Remove "-face" suffix from smerge faces - Remove "-face" suffix from show-tabs faces - Remove "-face" suffix from highlight-changes faces - Remove "-face" suffix from and downcase info faces - Remove "-face" suffix from pcvs faces - Update uses of renamed pcvs faces - Tweak ChangeLog - Remove "-face" suffix from strokes-char face - Remove "-face" suffix from compare-windows face - Remove "-face" suffix from calendar faces - Remove "-face" suffix from diary-button face - Remove "-face" suffix from testcover faces - Remove "-face" suffix from viper faces - Remove "-face" suffix from org faces - Remove "-face" suffix from sgml-namespace face - Remove "-face" suffix from table-cell face - Remove "-face" suffix from tex-mode faces - Remove "-face" suffix from texinfo-heading face - Remove "-face" suffix from flyspell faces - Remove "-face" suffix from gomoku faces - Remove "-face" suffix from mpuz faces - Merge from gnus--rel--5.10 - Remove "-face" suffix from Buffer-menu-buffer face - Remove "-face" suffix from antlr-mode faces - Remove "-face" suffix from ebrowse faces - Remove "-face" suffix from flymake faces - Remove "-face" suffix from idlwave faces - Remove "-face" suffix from sh-script faces - Remove "-face" suffix from vhdl-mode faces - Remove "-face" suffix from which-func face - Remove "-face" suffix from cperl-mode faces - Remove "-face" suffix from ld-script faces - Fix cperl-mode font-lock problem - Tweak which-func face * gnus--rel--5.10 (patch 80-82) - Merge from emacs--cvs-trunk--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 15 Jun 2005 23:32:15 +0000
parents 173dee4e2611 9cbfa983c1cf
children b7da78284d4c
comparison
equal deleted inserted replaced
90194:d940db5a66b9 90195:a1b34dec1104
1 ;;; faces.el --- Lisp faces 1 ;;; faces.el --- Lisp faces
2 2
3 ;; Copyright (C) 1992,1993,1994,1995,1996,1998,1999,2000,2001,2002,2004 3 ;; Copyright (C) 1992,1993,1994,1995,1996,1998,1999,2000,2001,2002,2004,2005
4 ;; Free Software Foundation, Inc. 4 ;; Free Software Foundation, Inc.
5 5
6 ;; Maintainer: FSF 6 ;; Maintainer: FSF
7 ;; Keywords: internal 7 ;; Keywords: internal
8 8
852 if this function returns nil. 852 if this function returns nil.
853 If MULTIPLE is non-nil, return a list of faces (possibly only one). 853 If MULTIPLE is non-nil, return a list of faces (possibly only one).
854 Otherwise, return a single face." 854 Otherwise, return a single face."
855 (let ((faceprop (or (get-char-property (point) 'read-face-name) 855 (let ((faceprop (or (get-char-property (point) 'read-face-name)
856 (get-char-property (point) 'face))) 856 (get-char-property (point) 'face)))
857 (aliasfaces nil)
858 (nonaliasfaces nil)
857 faces) 859 faces)
858 ;; Make a list of the named faces that the `face' property uses. 860 ;; Make a list of the named faces that the `face' property uses.
859 (if (and (listp faceprop) 861 (if (and (listp faceprop)
860 ;; Don't treat an attribute spec as a list of faces. 862 ;; Don't treat an attribute spec as a list of faces.
861 (not (keywordp (car faceprop))) 863 (not (keywordp (car faceprop)))
868 ;; If there are none, try to get a face name from the buffer. 870 ;; If there are none, try to get a face name from the buffer.
869 (if (and (null faces) 871 (if (and (null faces)
870 (memq (intern-soft (thing-at-point 'symbol)) (face-list))) 872 (memq (intern-soft (thing-at-point 'symbol)) (face-list)))
871 (setq faces (list (intern-soft (thing-at-point 'symbol))))) 873 (setq faces (list (intern-soft (thing-at-point 'symbol)))))
872 874
875 ;; Build up the completion tables.
876 (mapatoms (lambda (s)
877 (if (custom-facep s)
878 (if (get s 'face-alias)
879 (push (symbol-name s) aliasfaces)
880 (push (symbol-name s) nonaliasfaces)))))
881
873 ;; If we only want one, and the default is more than one, 882 ;; If we only want one, and the default is more than one,
874 ;; discard the unwanted ones now. 883 ;; discard the unwanted ones now.
875 (unless multiple 884 (unless multiple
876 (if faces 885 (if faces
877 (setq faces (list (car faces))))) 886 (setq faces (list (car faces)))))
881 (if (or faces string-describing-default) 890 (if (or faces string-describing-default)
882 (format "%s (default %s): " prompt 891 (format "%s (default %s): " prompt
883 (if faces (mapconcat 'symbol-name faces ", ") 892 (if faces (mapconcat 'symbol-name faces ", ")
884 string-describing-default)) 893 string-describing-default))
885 (format "%s: " prompt)) 894 (format "%s: " prompt))
886 obarray 'custom-facep t)) 895 (complete-in-turn nonaliasfaces aliasfaces) nil t))
887 ;; Canonicalize the output. 896 ;; Canonicalize the output.
888 (output 897 (output
889 (if (equal input "") 898 (if (equal input "")
890 faces 899 faces
891 (if (stringp input) 900 (if (stringp input)
1862 :group 'basic-faces) 1871 :group 'basic-faces)
1863 1872
1864 ;; Make `modeline' an alias for `mode-line', for compatibility. 1873 ;; Make `modeline' an alias for `mode-line', for compatibility.
1865 (put 'modeline 'face-alias 'mode-line) 1874 (put 'modeline 'face-alias 'mode-line)
1866 (put 'modeline-inactive 'face-alias 'mode-line-inactive) 1875 (put 'modeline-inactive 'face-alias 'mode-line-inactive)
1867 (put 'modeline-higilight 'face-alias 'mode-line-highlight) 1876 (put 'modeline-highlight 'face-alias 'mode-line-highlight)
1868 1877
1869 (defface header-line 1878 (defface header-line
1870 '((default 1879 '((default
1871 :inherit mode-line) 1880 :inherit mode-line)
1872 (((type tty)) 1881 (((type tty))
2288 (internal-frob-font-slant font "i"))) 2297 (internal-frob-font-slant font "i")))
2289 (make-obsolete 'x-make-font-bold-italic 'make-face-bold-italic "21.1") 2298 (make-obsolete 'x-make-font-bold-italic 'make-face-bold-italic "21.1")
2290 2299
2291 (provide 'faces) 2300 (provide 'faces)
2292 2301
2293 ;;; arch-tag: 19a4759f-2963-445f-b004-425b9aadd7d6 2302 ;; arch-tag: 19a4759f-2963-445f-b004-425b9aadd7d6
2294 ;;; faces.el ends here 2303 ;;; faces.el ends here