diff options
| author | Miles Bader | 2004-06-04 02:50:11 +0000 |
|---|---|---|
| committer | Miles Bader | 2004-06-04 02:50:11 +0000 |
| commit | 421c91e527cb39fc60480394f3c069914feb3d34 (patch) | |
| tree | e7253c59c8f365c410ef32ea89fd8e91f1db72d9 | |
| parent | 3dfbc6d87705c9a8cf93420e09269a7a65a372c6 (diff) | |
| download | emacs-421c91e527cb39fc60480394f3c069914feb3d34.tar.gz emacs-421c91e527cb39fc60480394f3c069914feb3d34.zip | |
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-368
Improve display-supports-face-attributes-p on non-ttys
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/faces.el | 24 |
2 files changed, 24 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a25bda7392f..c4f861626fd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2004-06-04 Miles Bader <miles@gnu.org> | ||
| 2 | |||
| 3 | * faces.el (display-supports-face-attributes-p): Implement a | ||
| 4 | `different from default' check for non-tty displays. | ||
| 5 | |||
| 1 | 2004-06-03 David Kastrup <dak@gnu.org> | 6 | 2004-06-03 David Kastrup <dak@gnu.org> |
| 2 | 7 | ||
| 3 | * woman.el (woman-mapcan): More concise code. | 8 | * woman.el (woman-mapcan): More concise code. |
diff --git a/lisp/faces.el b/lisp/faces.el index 05a4fd7e82c..03e2ee699e7 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1510,11 +1510,25 @@ face for italic." | |||
| 1510 | (if (framep display) | 1510 | (if (framep display) |
| 1511 | display | 1511 | display |
| 1512 | (car (frames-on-display-list display))))) | 1512 | (car (frames-on-display-list display))))) |
| 1513 | ;; For now, we assume that non-tty displays can support everything. | 1513 | (if (not (memq (framep frame) '(x w32 mac))) |
| 1514 | ;; Later, we should add the ability to query about specific fonts, | 1514 | ;; On ttys, `tty-supports-face-attributes-p' does all the work we need. |
| 1515 | ;; colors, etc. | 1515 | (tty-supports-face-attributes-p attributes frame) |
| 1516 | (or (memq (framep frame) '(x w32 mac)) | 1516 | ;; For now, we assume that non-tty displays can support everything, |
| 1517 | (tty-supports-face-attributes-p attributes frame)))) | 1517 | ;; and so we just check to see if any of the specified attributes is |
| 1518 | ;; different from the default -- though this probably isn't always | ||
| 1519 | ;; accurate for font-related attributes. Later, we should add the | ||
| 1520 | ;; ability to query about specific fonts, colors, etc. | ||
| 1521 | (while (and attributes | ||
| 1522 | (let* ((attr (car attributes)) | ||
| 1523 | (val (cadr attributes)) | ||
| 1524 | (default-val (face-attribute 'default attr frame))) | ||
| 1525 | (if (and (stringp val) (stringp default-val)) | ||
| 1526 | ;; compare string attributes case-insensitively | ||
| 1527 | (eq (compare-strings val nil nil default-val nil nil t) | ||
| 1528 | t) | ||
| 1529 | (equal val default-val)))) | ||
| 1530 | (setq attributes (cddr attributes))) | ||
| 1531 | (not (null attributes))))) | ||
| 1518 | 1532 | ||
| 1519 | 1533 | ||
| 1520 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1534 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |