• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/progmodes/

Lines Matching +defs:face +defs:background

62 (define-widget 'cpp-face 'lazy
63 "Either a face or the special symbol 'invisible'."
64 :type '(choice (const invisible) (face)))
66 (defcustom cpp-known-face 'invisible
68 :type 'cpp-face
71 (defcustom cpp-unknown-face 'highlight
73 :type 'cpp-face
76 (defcustom cpp-face-type 'light
77 "*Indicate what background face type you prefer.
103 (cpp-face :tag "True")
104 (cpp-face :tag "False")
117 (defconst cpp-face-type-list
118 '(("light color background" . light)
119 ("dark color background" . dark)
122 "Alist of strings and names of the defined face collections.")
142 (defcustom cpp-face-default-list nil
146 and FACE is either a face (a symbol)
147 or a cons cell (background-color . COLOR)."
148 :type '(repeat (cons string (choice face (cons (const background-color) string))))
151 (defcustom cpp-face-light-name-list
159 (defcustom cpp-face-dark-name-list
167 (defcustom cpp-face-light-list nil
169 :type '(repeat (cons string (choice face
170 (cons (const background-color) string))))
173 (defcustom cpp-face-dark-list nil
175 :type '(repeat (cons string (choice face
176 (cons (const background-color) string))))
179 (defcustom cpp-face-mono-list
185 :type '(repeat (cons string face))
188 (defcustom cpp-face-none-list
192 :type '(repeat (cons string cpp-face))
195 (defvar cpp-face-all-list
196 (append cpp-face-light-list
197 cpp-face-dark-list
198 cpp-face-mono-list
199 cpp-face-none-list)
263 (let (cpp-known-face cpp-unknown-face)
318 (let ((face (nth (if branch 1 2) entry))
325 (cond ((eq face 'invisible)
327 ((eq face 'default))
329 (overlay-put overlay 'face face)))
363 (if (eq cpp-known-face 'invisible)
365 (or (eq cpp-known-face 'default)
366 (overlay-put overlay 'face cpp-known-face))
376 (cond ((eq cpp-unknown-face 'invisible)
378 ((eq cpp-unknown-face 'default))
380 (overlay-put overlay 'face cpp-unknown-face)))
444 (define-key cpp-edit-map "b" 'cpp-edit-background)
445 (define-key cpp-edit-map "B" 'cpp-edit-background)
513 (cpp-make-button (car (rassq cpp-face-type cpp-face-type-list))
514 'cpp-edit-background)
516 (cpp-make-button (cpp-face-name cpp-known-face)
522 (cpp-make-button (cpp-face-name cpp-unknown-face)
550 (cpp-make-button (cpp-face-name true)
553 (cpp-make-button (cpp-face-name false)
585 (pp (list 'setq 'cpp-known-face
586 (list 'quote cpp-known-face)) buffer)
587 (pp (list 'setq 'cpp-unknown-face
588 (list 'quote cpp-unknown-face)) buffer)
589 (pp (list 'setq 'cpp-face-type
590 (list 'quote cpp-face-type)) buffer)
606 (defun cpp-edit-background ()
607 "Change default face collection."
609 (call-interactively 'cpp-choose-default-face)
615 (setq cpp-known-face (cpp-choose-face "Known face" cpp-known-face))
621 (setq cpp-unknown-face (cpp-choose-face "Unknown face" cpp-unknown-face))
644 (defun cpp-edit-true (symbol face)
649 (cpp-choose-face "True face"
651 (setcar (nthcdr 1 (cpp-edit-list-entry-get-or-create symbol)) face)
654 (defun cpp-edit-false (symbol face)
659 (cpp-choose-face "False face"
661 (setcar (nthcdr 2 (cpp-edit-list-entry-get-or-create symbol)) face)
696 (defun cpp-choose-face (prompt default)
697 ;; Choose a face from cpp-face-default-list.
699 ;; DEFAULT is the default face.
702 (list prompt (cons prompt cpp-face-default-list)))
703 (let ((name (car (rassq default cpp-face-default-list))))
708 cpp-face-default-list nil t)
709 cpp-face-all-list))))
712 (defun cpp-choose-default-face (type)
713 ;; Choose default face list for screen of TYPE.
714 ;; Type must be one of the types defined in `cpp-face-type-list'.
719 cpp-face-type-list)))
721 cpp-face-type-list
723 cpp-face-type-list)))))
726 (if cpp-face-light-list
728 (setq cpp-face-light-list
729 (mapcar 'cpp-create-bg-face cpp-face-light-name-list))
730 (setq cpp-face-all-list
731 (append cpp-face-all-list cpp-face-light-list)))
732 (setq cpp-face-type 'light)
733 (setq cpp-face-default-list
734 (append cpp-face-light-list cpp-face-none-list)))
736 (if cpp-face-dark-list
738 (setq cpp-face-dark-list
739 (mapcar 'cpp-create-bg-face cpp-face-dark-name-list))
740 (setq cpp-face-all-list
741 (append cpp-face-all-list cpp-face-dark-list)))
742 (setq cpp-face-type 'dark)
743 (setq cpp-face-default-list
744 (append cpp-face-dark-list cpp-face-none-list)))
746 (setq cpp-face-type 'mono)
747 (setq cpp-face-default-list
748 (append cpp-face-mono-list cpp-face-none-list)))
750 (setq cpp-face-type 'none)
751 (setq cpp-face-default-list cpp-face-none-list))))
755 (defun cpp-make-button (name callback &optional data face padding)
761 ;; FACE means that NAME is the name of a face in `cpp-face-all-list'.
776 (setq face
777 (if face
778 (let ((check (cdr (assoc name cpp-face-all-list))))
784 (append (list 'face face)
785 '(mouse-face highlight)
805 (defun cpp-create-bg-face (color)
806 ;; Create entry for face with background COLOR.
807 (cons color (cons 'background-color color)))
809 (cpp-choose-default-face
810 (if (or window-system (display-color-p)) cpp-face-type 'none))
812 (defun cpp-face-name (face)
813 ;; Return the name of FACE from `cpp-face-all-list'.
814 (let ((entry (rassq (if face face 'default) cpp-face-all-list)))
817 (format "<%s>" face))))