diff options
Diffstat (limited to 'lisp/faces.el')
| -rw-r--r-- | lisp/faces.el | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 9e0ca962499..f8dc4783cbb 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -487,44 +487,44 @@ with the `default' face (which is always completely specified)." | |||
| 487 | (defalias 'face-background-pixmap 'face-stipple) | 487 | (defalias 'face-background-pixmap 'face-stipple) |
| 488 | 488 | ||
| 489 | 489 | ||
| 490 | ;; FIXME all of these -p functions ignore inheritance (cf face-stipple). | 490 | (defun face-underline-p (face &optional frame inherit) |
| 491 | ;; Ie, a face that inherits from an underlined face but does not | ||
| 492 | ;; specify :underline will return nil. | ||
| 493 | ;; So these functions don't actually tell you anything about how the | ||
| 494 | ;; face will _appear_. So not very useful IMO. | ||
| 495 | (defun face-underline-p (face &optional frame) | ||
| 496 | "Return non-nil if FACE specifies a non-nil underlining. | 491 | "Return non-nil if FACE specifies a non-nil underlining. |
| 497 | If the optional argument FRAME is given, report on face FACE in that frame. | 492 | If the optional argument FRAME is given, report on face FACE in that frame. |
| 498 | If FRAME is t, report on the defaults for face FACE (for new frames). | 493 | If FRAME is t, report on the defaults for face FACE (for new frames). |
| 499 | If FRAME is omitted or nil, use the selected frame." | 494 | If FRAME is omitted or nil, use the selected frame. |
| 500 | (face-attribute-specified-or (face-attribute face :underline frame) nil)) | 495 | Optional argument INHERIT is passed to `face-attribute'." |
| 496 | (face-attribute-specified-or | ||
| 497 | (face-attribute face :underline frame inherit) nil)) | ||
| 501 | 498 | ||
| 502 | 499 | ||
| 503 | (defun face-inverse-video-p (face &optional frame) | 500 | (defun face-inverse-video-p (face &optional frame inherit) |
| 504 | "Return non-nil if FACE specifies a non-nil inverse-video. | 501 | "Return non-nil if FACE specifies a non-nil inverse-video. |
| 505 | If the optional argument FRAME is given, report on face FACE in that frame. | 502 | If the optional argument FRAME is given, report on face FACE in that frame. |
| 506 | If FRAME is t, report on the defaults for face FACE (for new frames). | 503 | If FRAME is t, report on the defaults for face FACE (for new frames). |
| 507 | If FRAME is omitted or nil, use the selected frame." | 504 | If FRAME is omitted or nil, use the selected frame. |
| 508 | (eq (face-attribute face :inverse-video frame) t)) | 505 | Optional argument INHERIT is passed to `face-attribute'." |
| 506 | (eq (face-attribute face :inverse-video frame inherit) t)) | ||
| 509 | 507 | ||
| 510 | 508 | ||
| 511 | (defun face-bold-p (face &optional frame) | 509 | (defun face-bold-p (face &optional frame inherit) |
| 512 | "Return non-nil if the font of FACE is bold on FRAME. | 510 | "Return non-nil if the font of FACE is bold on FRAME. |
| 513 | If the optional argument FRAME is given, report on face FACE in that frame. | 511 | If the optional argument FRAME is given, report on face FACE in that frame. |
| 514 | If FRAME is t, report on the defaults for face FACE (for new frames). | 512 | If FRAME is t, report on the defaults for face FACE (for new frames). |
| 515 | If FRAME is omitted or nil, use the selected frame. | 513 | If FRAME is omitted or nil, use the selected frame. |
| 514 | Optional argument INHERIT is passed to `face-attribute'. | ||
| 516 | Use `face-attribute' for finer control." | 515 | Use `face-attribute' for finer control." |
| 517 | (let ((bold (face-attribute face :weight frame))) | 516 | (let ((bold (face-attribute face :weight frame inherit))) |
| 518 | (memq bold '(semi-bold bold extra-bold ultra-bold)))) | 517 | (memq bold '(semi-bold bold extra-bold ultra-bold)))) |
| 519 | 518 | ||
| 520 | 519 | ||
| 521 | (defun face-italic-p (face &optional frame) | 520 | (defun face-italic-p (face &optional frame inherit) |
| 522 | "Return non-nil if the font of FACE is italic on FRAME. | 521 | "Return non-nil if the font of FACE is italic on FRAME. |
| 523 | If the optional argument FRAME is given, report on face FACE in that frame. | 522 | If the optional argument FRAME is given, report on face FACE in that frame. |
| 524 | If FRAME is t, report on the defaults for face FACE (for new frames). | 523 | If FRAME is t, report on the defaults for face FACE (for new frames). |
| 525 | If FRAME is omitted or nil, use the selected frame. | 524 | If FRAME is omitted or nil, use the selected frame. |
| 525 | Optional argument INHERIT is passed to `face-attribute'. | ||
| 526 | Use `face-attribute' for finer control." | 526 | Use `face-attribute' for finer control." |
| 527 | (let ((italic (face-attribute face :slant frame))) | 527 | (let ((italic (face-attribute face :slant frame inherit))) |
| 528 | (memq italic '(italic oblique)))) | 528 | (memq italic '(italic oblique)))) |
| 529 | 529 | ||
| 530 | 530 | ||
| @@ -862,7 +862,7 @@ Use `set-face-attribute' to ``unspecify'' underlining." | |||
| 862 | 'set-face-underline "24.3") | 862 | 'set-face-underline "24.3") |
| 863 | 863 | ||
| 864 | 864 | ||
| 865 | (defun set-face-inverse-video-p (face inverse-video-p &optional frame) | 865 | (defun set-face-inverse-video (face inverse-video-p &optional frame) |
| 866 | "Specify whether face FACE is in inverse video. | 866 | "Specify whether face FACE is in inverse video. |
| 867 | INVERSE-VIDEO-P non-nil means FACE displays explicitly in inverse video. | 867 | INVERSE-VIDEO-P non-nil means FACE displays explicitly in inverse video. |
| 868 | INVERSE-VIDEO-P nil means FACE explicitly is not in inverse video. | 868 | INVERSE-VIDEO-P nil means FACE explicitly is not in inverse video. |
| @@ -870,14 +870,13 @@ FRAME nil or not specified means change face on all frames. | |||
| 870 | Use `set-face-attribute' to ``unspecify'' the inverse video attribute." | 870 | Use `set-face-attribute' to ``unspecify'' the inverse video attribute." |
| 871 | (interactive | 871 | (interactive |
| 872 | (let ((list (read-face-and-attribute :inverse-video))) | 872 | (let ((list (read-face-and-attribute :inverse-video))) |
| 873 | (list (car list) (eq (car (cdr list)) t)))) | 873 | (list (car list) (if (cadr list) t)))) |
| 874 | (set-face-attribute face frame :inverse-video inverse-video-p)) | 874 | (set-face-attribute face frame :inverse-video inverse-video-p)) |
| 875 | 875 | ||
| 876 | (define-obsolete-function-alias 'set-face-inverse-video-p | ||
| 877 | 'set-face-inverse-video "24.4") | ||
| 876 | 878 | ||
| 877 | ;; The -p suffix is a hostage to fortune. What if we want to extend | 879 | (defun set-face-bold (face bold-p &optional frame) |
| 878 | ;; this to allow more than boolean options? Exactly this happened | ||
| 879 | ;; to set-face-underline-p. | ||
| 880 | (defun set-face-bold-p (face bold-p &optional frame) | ||
| 881 | "Specify whether face FACE is bold. | 880 | "Specify whether face FACE is bold. |
| 882 | BOLD-P non-nil means FACE should explicitly display bold. | 881 | BOLD-P non-nil means FACE should explicitly display bold. |
| 883 | BOLD-P nil means FACE should explicitly display non-bold. | 882 | BOLD-P nil means FACE should explicitly display non-bold. |
| @@ -887,8 +886,10 @@ Use `set-face-attribute' or `modify-face' for finer control." | |||
| 887 | (make-face-unbold face frame) | 886 | (make-face-unbold face frame) |
| 888 | (make-face-bold face frame))) | 887 | (make-face-bold face frame))) |
| 889 | 888 | ||
| 889 | (define-obsolete-function-alias 'set-face-bold-p 'set-face-bold "24.4") | ||
| 890 | |||
| 890 | 891 | ||
| 891 | (defun set-face-italic-p (face italic-p &optional frame) | 892 | (defun set-face-italic (face italic-p &optional frame) |
| 892 | "Specify whether face FACE is italic. | 893 | "Specify whether face FACE is italic. |
| 893 | ITALIC-P non-nil means FACE should explicitly display italic. | 894 | ITALIC-P non-nil means FACE should explicitly display italic. |
| 894 | ITALIC-P nil means FACE should explicitly display non-italic. | 895 | ITALIC-P nil means FACE should explicitly display non-italic. |
| @@ -898,6 +899,8 @@ Use `set-face-attribute' or `modify-face' for finer control." | |||
| 898 | (make-face-unitalic face frame) | 899 | (make-face-unitalic face frame) |
| 899 | (make-face-italic face frame))) | 900 | (make-face-italic face frame))) |
| 900 | 901 | ||
| 902 | (define-obsolete-function-alias 'set-face-italic-p 'set-face-italic "24.4") | ||
| 903 | |||
| 901 | 904 | ||
| 902 | (defalias 'set-face-background-pixmap 'set-face-stipple) | 905 | (defalias 'set-face-background-pixmap 'set-face-stipple) |
| 903 | 906 | ||