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

Lines Matching +defs:find +defs:face

54 ;; ps-print uses the same face attributes defined through font-lock or hilit to
58 ;; ps-print allows a remap of face to another one that it is better to print,
59 ;; for example, the face font-lock-comment-face (if you are using font-lock)
96 ;; on banner pages, and to make it easier to find your output at the printer
97 ;; (it's easier to pick up one 50-page printout than to find 50 single-page
945 ;; - open this file and find the line:
990 ;; (w3-table-hack-x-face . "LineDrawNormal"))
999 ;; Note that on above example the `w3-table-hack-x-face' entry refers to a face
1000 ;; symbol, so when printing this face it'll be used the font `LineDrawNormal'.
1001 ;; If the face `w3-table-hack-x-face' is remapped to use bold and/or italic
1003 ;; used instead of `w3-table-hack-x-face' entry.
1009 ;; (fonts (w3-table-hack-x-face . "LineDrawNormal")
1049 ;; (setq ps-bold-faces '(my-blue-face))
1050 ;; (setq ps-italic-faces '(my-red-face))
1051 ;; (setq ps-underlined-faces '(my-green-face))
1062 ;; of sync, if a face changes, or if new faces are added. To get the lists
1063 ;; back in sync, you can set the variable `ps-build-face-reference' to t, and
1066 ;; `ps-always-build-face-reference' to t.
1068 ;; If you need to print without worrying about face background color, set the
1069 ;; variable `ps-use-face-background' which specifies if face background should
1072 ;; t always use face background color.
1073 ;; nil never use face background color.
1074 ;; (face...) list of faces whose background color will be used.
1106 ;; See the documentation for `ps-extend-face'.
1108 ;; Let's, for example, remap `font-lock-keyword-face' to another foreground
1111 ;; (ps-extend-face '(font-lock-keyword-face "RoyalBlue" nil bold) 'MERGE)
1113 ;; If you want to use a new face, define it first with `defface', and then call
1114 ;; `ps-extend-face' to specify how to print it.
1247 ;; `ps-zebra-stripe-follow' and `ps-use-face-background'.
1297 ;; New face attributes.
1319 ;; hilit19 and older versions of get-create-face. Users having problems with
1358 ;; Thanks to Adam Doppelt <adoppelt@avogadro.com> for face mapping suggestion
1482 (defalias 'ps-x-extent-face 'extent-face)
1485 (defalias 'ps-x-face-font-instance 'face-font-instance)
1486 (defalias 'ps-x-find-coding-system 'find-coding-system)
1492 (defalias 'ps-e-face-bold-p 'face-bold-p)
1493 (defalias 'ps-e-face-italic-p 'face-italic-p)
1500 (defalias 'ps-e-find-composition (if (fboundp 'find-composition)
1501 'find-composition
1526 (defun ps-face-foreground-name (face)
1527 (ps-xemacs-color-name (face-foreground face)))
1528 (defun ps-face-background-name (face)
1529 (ps-xemacs-color-name (face-background face)))
1532 (defun ps-face-foreground-name (face)
1533 (face-foreground face nil t))
1534 (defun ps-face-background-name (face)
1535 (face-background face nil t))
1594 (defgroup ps-print-face nil
2994 ps-print, that is, if there is a face in a text that doesn't have a foreground
3037 ps-print, that is, if there is a face in a text that doesn't have a background
3064 See also `ps-use-face-background'."
3079 "*Non-nil means automatically detect bold/italic/underline face attributes.
3087 '((font-lock-builtin-face "black" nil bold )
3088 (font-lock-comment-face "gray20" nil italic)
3089 (font-lock-constant-face "black" nil bold )
3090 (font-lock-function-name-face "black" nil bold )
3091 (font-lock-keyword-face "black" nil bold )
3092 (font-lock-string-face "black" nil italic)
3093 (font-lock-type-face "black" nil italic)
3094 (font-lock-variable-name-face "black" nil bold italic)
3095 (font-lock-warning-face "black" nil bold italic))
3096 "*Specify list of face attributes to print colors on black/white printers.
3098 The list elements are the same as defined on `ps-extend-face' (which see).
3104 (face :tag "Face Symbol")
3124 :group 'ps-print-face)
3128 '(font-lock-function-name-face
3129 font-lock-builtin-face
3130 font-lock-variable-name-face
3131 font-lock-keyword-face
3132 font-lock-warning-face))
3135 :type '(repeat face)
3137 :group 'ps-print-face)
3141 '(font-lock-variable-name-face
3142 font-lock-type-face
3143 font-lock-string-face
3144 font-lock-comment-face
3145 font-lock-warning-face))
3148 :type '(repeat face)
3150 :group 'ps-print-face)
3154 '(font-lock-function-name-face
3155 font-lock-constant-face
3156 font-lock-warning-face))
3159 :type '(repeat face)
3161 :group 'ps-print-face)
3163 (defcustom ps-use-face-background nil
3164 "*Specify if face background should be used.
3168 t always use face background color.
3169 nil never use face background color.
3170 (face...) list of faces whose background color will be used.
3179 face))
3181 :group 'ps-print-face)
3307 (defcustom ps-build-face-reference t
3308 "*Non-nil means build the reference face lists.
3316 face, or create new faces. Most users shouldn't have to worry about its
3320 :group 'ps-print-face)
3322 (defcustom ps-always-build-face-reference nil
3323 "*Non-nil means always rebuild the reference face lists.
3330 :group 'ps-print-face)
3623 '(23 . ps-use-face-background)
3692 '(31 . ps-build-face-reference)
3693 '(31 . ps-always-build-face-reference)
3871 (defun ps-xemacs-face-kind-p (face kind kind-regex)
3872 (let* ((frame-font (or (ps-x-face-font-instance face)
3873 (ps-x-face-font-instance 'default)))
3889 (and (fboundp 'find-coding-system)
3890 (or (ps-x-find-coding-system 'raw-text-unix)
3907 (defun ps-face-bold-p (face)
3908 (or (ps-xemacs-face-kind-p face 'WEIGHT_NAME "bold\\|demibold")
3909 (memq face ps-bold-faces))) ; Kludge-compatible
3911 (defun ps-face-italic-p (face)
3912 (or (ps-xemacs-face-kind-p face 'ANGLE_NAME "i\\|o")
3913 (ps-xemacs-face-kind-p face 'SLANT "i\\|o")
3914 (memq face ps-italic-faces))) ; Kludge-compatible
3928 (defun ps-face-bold-p (face)
3929 (or (ps-e-face-bold-p face)
3930 (memq face ps-bold-faces)))
3932 (defun ps-face-italic-p (face)
3933 (or (ps-e-face-italic-p face)
3934 (memq face ps-italic-faces)))
3946 (defun ps-face-underlined-p (face)
3947 (or (face-underline-p face)
3948 (memq face ps-underlined-faces)))
4068 An element of this list has the same form as `ps-print-face-extension-alist'
4072 use `ps-extend-face' and `ps-extend-face-list'.
4073 See documentation for `ps-extend-face' for valid extension symbol.
4077 (defvar ps-print-face-extension-alist nil
4083 FACE is a symbol denoting a face name
4086 (see documentation for `ps-print-face-map-alist')
4091 use `ps-extend-face' and `ps-extend-face-list'.
4092 See documentation for `ps-extend-face' for valid extension symbol.")
4095 (defvar ps-print-face-alist nil
4099 `ps-print-face-extension-alist'.
4101 Don't change this list directly; this list is used by `ps-face-attributes',
4102 `ps-map-face' and `ps-build-reference-face-lists'.")
4105 (defconst ps-print-face-map-alist
4124 (defun ps-extend-face-list (face-extension-list &optional merge-p alist-sym)
4125 "Extend face in ALIST-SYM.
4128 with face extension in ALIST-SYM; otherwise, overrides.
4130 If optional ALIST-SYM is nil, `ps-print-face-extension-alist' is used;
4133 The elements in FACE-EXTENSION-LIST are like those for `ps-extend-face'.
4135 See `ps-extend-face' for documentation."
4136 (while face-extension-list
4137 (ps-extend-face (car face-extension-list) merge-p alist-sym)
4138 (setq face-extension-list (cdr face-extension-list))))
4142 (defun ps-extend-face (face-extension &optional merge-p alist-sym)
4143 "Extend face in ALIST-SYM.
4146 with face extensions in ALIST-SYM; otherwise, overrides.
4148 If optional ALIST-SYM is nil, `ps-print-face-extension-alist' is used;
4155 FACE-NAME is a face name symbol.
4172 (setq alist-sym 'ps-print-face-extension-alist))
4173 (let* ((background (nth 2 face-extension))
4174 (foreground (nth 1 face-extension))
4175 (face-name (nth 0 face-extension))
4176 (ps-face (cdr (assq face-name (symbol-value alist-sym))))
4177 (face-vector (or ps-face (vector 0 nil nil)))
4178 (face-bit (ps-extension-bit face-extension)))
4179 ;; extend face
4180 (aset face-vector 0 (if merge-p
4181 (logior (aref face-vector 0) face-bit)
4182 face-bit))
4184 (aset face-vector 1 foreground))
4186 (aset face-vector 2 background))
4187 ;; if face does not exist, insert it
4188 (or ps-face
4189 (set alist-sym (cons (cons face-name face-vector)
4193 (defun ps-extension-bit (face-extension)
4194 (let ((face-bit 0))
4196 (setq face-extension (cdr (cdr face-extension)))
4197 (while (setq face-extension (cdr face-extension))
4198 (setq face-bit (logior face-bit
4199 (or (cdr (assq (car face-extension)
4200 ps-print-face-map-alist))
4202 face-bit))
4208 ;; Originally face attributes were specified via `font-lock-face-attributes'.
4209 ;; Users then changed the default face attributes by setting that variable.
4211 ;; for faces where M-x customize has been used to save changes for the face.
4214 (defun ps-font-lock-face-attributes ()
4216 (boundp 'font-lock-face-attributes)
4217 (let ((face-attributes (symbol-value 'font-lock-face-attributes)))
4218 (while face-attributes
4219 (let* ((face-attribute
4220 (car (prog1 face-attributes
4221 (setq face-attributes (cdr face-attributes)))))
4222 (face (car face-attribute)))
4224 ;; `font-lock-face-attributes' entry.
4225 (unless (get face 'saved-face)
4226 (let ((foreground (nth 1 face-attribute))
4227 (background (nth 2 face-attribute))
4228 (bold-p (nth 3 face-attribute))
4229 (italic-p (nth 4 face-attribute))
4230 (underline-p (nth 5 face-attribute))
4231 face-spec)
4233 (setq face-spec (cons ':foreground
4234 (cons foreground face-spec))))
4236 (setq face-spec (cons ':background
4237 (cons background face-spec))))
4239 (setq face-spec (append '(:weight bold) face-spec)))
4241 (setq face-spec (append '(:slant italic) face-spec)))
4243 (setq face-spec (append '(:underline t) face-spec)))
4244 (custom-declare-face face (list (list t face-spec)) nil)
5377 ;; find suitable page matrix for a given `ps-paper-type'.
5872 ;; face background
5873 (or (listp ps-use-face-background)
5874 (setq ps-use-face-background t))
5924 (ps-face-background-name 'default))
5936 (ps-face-foreground-name 'default))
6087 (defun ps-find-wrappoint (from to char-width)
6095 (let* ((wrappoint (ps-find-wrappoint from to
6105 (let* ((wrappoint (ps-find-wrappoint from to
6115 (let* ((wrappoint (ps-find-wrappoint from to
6227 (composition (ps-e-find-composition from (1+ match-point))))
6276 (composition (ps-e-find-composition match-point to))
6321 (wrappoint (ps-find-wrappoint from to char-width)))
6330 (defun ps-face-attributes (face)
6331 "Return face attribute vector.
6333 If FACE is not in `ps-print-face-extension-alist' or in
6334 `ps-print-face-alist', insert it on `ps-print-face-alist' and
6337 If FACE is not a valid face name, use default face."
6340 (or (and (symbolp face)
6341 (cdr (assq face ps-black-white-faces-alist)))
6343 ((symbolp face)
6344 (cdr (or (assq face ps-print-face-extension-alist)
6345 (assq face ps-print-face-alist)
6346 (let* ((the-face (if (facep face) face 'default))
6347 (new-face (ps-screen-to-bit-face the-face)))
6348 (or (and (eq the-face 'default)
6349 (assq the-face ps-print-face-alist))
6350 (setq ps-print-face-alist
6351 (cons new-face ps-print-face-alist)))
6352 new-face))))
6353 ((eq (car face) 'foreground-color)
6354 (vector 0 (cdr face) nil))
6355 ((eq (car face) 'background-color)
6356 (vector 0 nil (cdr face)))
6361 (defun ps-face-background (face background)
6362 (and (cond ((eq ps-use-face-background t)) ; always
6363 ((null ps-use-face-background) nil) ; never
6364 ;; ps-user-face-background is a symbol face list
6365 ((symbolp face)
6366 (memq face ps-use-face-background))
6367 ((listp face)
6368 (or (memq (car face) '(foreground-color background-color))
6370 (while face
6371 (if (or (memq (car face) ps-use-face-background)
6372 (memq (car face)
6374 (setq face nil
6376 (setq face (cdr face))))
6384 (defun ps-face-attribute-list (face-or-list)
6386 ;; simple face
6387 ((not (listp face-or-list))
6388 (ps-face-attributes face-or-list))
6389 ;; only foreground color, not a `real' face
6390 ((eq (car face-or-list) 'foreground-color)
6391 (vector 0 (cdr face-or-list) nil))
6392 ;; only background color, not a `real' face
6393 ((eq (car face-or-list) 'background-color)
6394 (vector 0 nil (cdr face-or-list)))
6398 foreground background face-attr face)
6399 (while face-or-list
6400 (setq face (car face-or-list)
6401 face-or-list (cdr face-or-list)
6402 face-attr (ps-face-attributes face)
6403 effects (logior effects (aref face-attr 0)))
6404 (or foreground (setq foreground (aref face-attr 1)))
6406 (setq background (ps-face-background face (aref face-attr 2)))))
6413 (defun ps-plot-with-face (from to face)
6415 ((null face) ; print text with null face
6417 ((eq face 'emacs--invisible--face)) ; skip invisible text!!!
6418 (t ; otherwise, text has a valid face
6419 (let* ((face-bit (ps-face-attribute-list face))
6420 (effect (aref face-bit 0))
6421 (foreground (aref face-bit 1))
6422 (background (ps-face-background face (aref face-bit 2)))
6432 face))
6437 ;; Ensure that face-list is fbound.
6438 (or (fboundp 'face-list) (defalias 'face-list 'list-faces))
6441 (defun ps-build-reference-face-lists ()
6442 ;; Ensure that face database is updated with faces on
6443 ;; `font-lock-face-attributes' (obsolete stuff)
6444 (ps-font-lock-face-attributes)
6445 ;; Now, rebuild reference face lists
6446 (setq ps-print-face-alist nil)
6448 (mapcar 'ps-map-face (face-list))
6449 (mapcar 'ps-set-face-bold ps-bold-faces)
6450 (mapcar 'ps-set-face-italic ps-italic-faces)
6451 (mapcar 'ps-set-face-underline ps-underlined-faces))
6452 (setq ps-build-face-reference nil))
6455 (defun ps-set-face-bold (face)
6456 (ps-set-face-attribute face 1))
6458 (defun ps-set-face-italic (face)
6459 (ps-set-face-attribute face 2))
6461 (defun ps-set-face-underline (face)
6462 (ps-set-face-attribute face 4))
6465 (defun ps-set-face-attribute (face effect)
6466 (let ((face-bit (cdr (ps-map-face face))))
6467 (aset face-bit 0 (logior (aref face-bit 0) effect))))
6470 (defun ps-map-face (face)
6471 (let* ((face-map (ps-screen-to-bit-face face))
6472 (ps-face-bit (cdr (assq (car face-map) ps-print-face-alist))))
6473 (if ps-face-bit
6474 ;; if face exists, merge both
6475 (let ((face-bit (cdr face-map)))
6476 (aset ps-face-bit 0 (logior (aref ps-face-bit 0) (aref face-bit 0)))
6477 (or (aref ps-face-bit 1) (aset ps-face-bit 1 (aref face-bit 1)))
6478 (or (aref ps-face-bit 2) (aset ps-face-bit 2 (aref face-bit 2))))
6479 ;; if face does not exist, insert it
6480 (setq ps-print-face-alist (cons face-map ps-print-face-alist)))
6481 face-map))
6484 (defun ps-screen-to-bit-face (face)
6485 (cons face
6486 (vector (logior (if (ps-face-bold-p face) 1 0) ; bold
6487 (if (ps-face-italic-p face) 2 0) ; italic
6488 (if (ps-face-underlined-p face) 4 0)) ; underline
6489 (ps-face-foreground-name face)
6490 (ps-face-background-name face))))
6511 (when (or ps-always-build-face-reference
6512 ps-build-face-reference)
6513 (message "Collecting face information...")
6514 (ps-build-reference-face-lists))
6519 (ps-extend-face-list ps-black-white-faces nil
6526 (let ((face 'default)
6553 ;; but don't call ps-plot-with-face unless from > point-min.
6555 (ps-plot-with-face from (min position (point-max)) face))
6559 (and (ps-x-extent-face extent)
6567 (setq face (if extent-list
6568 (ps-x-extent-face (car extent-list))
6594 ;; a face text property.
6595 (setq face
6603 'emacs--invisible--face)
6604 ((get-text-property from 'face))
6607 (face-priority -1)) ; text-property
6609 (not (eq face 'emacs--invisible--face)))
6615 (and (> overlay-priority face-priority)
6623 face-priority overlay-priority
6624 face
6632 'emacs--invisible--face)
6633 ((ps-e-overlay-get overlay 'face))
6634 (t face)
6640 (ps-plot-with-face from position face)
6644 (ps-plot-with-face from to face))))
6909 ;; Couldn't find a real name -- show the address instead.