Mercurial > hg > xemacs-beta
comparison lisp/faces.el @ 1137:c6facab13185
[xemacs-hg @ 2002-12-03 10:35:06 by didierv]
new function `set-face-background-pixmap-file'
author | didierv |
---|---|
date | Tue, 03 Dec 2002 10:35:17 +0000 |
parents | 79c6ff3eef26 |
children | c2550fff5469 |
comparison
equal
deleted
inserted
replaced
1136:14f3ffacd8be | 1137:c6facab13185 |
---|---|
232 (let ((value (get face property))) | 232 (let ((value (get face property))) |
233 (if (specifierp value) | 233 (if (specifierp value) |
234 (setq value (if (or (charsetp matchspec) | 234 (setq value (if (or (charsetp matchspec) |
235 (and (symbolp matchspec) | 235 (and (symbolp matchspec) |
236 (find-charset matchspec))) | 236 (find-charset matchspec))) |
237 (or | 237 (or |
238 (specifier-matching-instance | 238 (specifier-matching-instance |
239 value (cons matchspec nil) domain default | 239 value (cons matchspec nil) domain default |
240 no-fallback) | 240 no-fallback) |
241 (specifier-matching-instance | 241 (specifier-matching-instance |
242 value (cons matchspec t) domain default | 242 value (cons matchspec t) domain default |
622 will be added, and defaults to 'global. | 622 will be added, and defaults to 'global. |
623 | 623 |
624 See `set-face-property' for more information." | 624 See `set-face-property' for more information." |
625 (interactive (face-interactive "background-pixmap")) | 625 (interactive (face-interactive "background-pixmap")) |
626 (set-face-property face 'background-pixmap pixmap locale tag-set how-to-add)) | 626 (set-face-property face 'background-pixmap pixmap locale tag-set how-to-add)) |
627 | |
628 (defvar background-pixmap-file-history nil | |
629 ;; History for `set-face-background-pixmap-file' | |
630 ) | |
631 | |
632 (defun set-face-background-pixmap-file (face file) | |
633 "Read (and set) the background pixmap of FACE from FILE. | |
634 This function is a simplified version of `set-face-background-pixmap', | |
635 designed for interactive use." | |
636 (interactive | |
637 (let* ((face (read-face-name "Set background pixmap of face: ")) | |
638 (file (read-file-name | |
639 (format "Set background pixmap of face %s to: " | |
640 (symbol-name face)) | |
641 nil (image-instance-file-name | |
642 (face-background-pixmap-instance face)) t nil | |
643 'background-pixmap-file-history))) | |
644 (list face (if (equal file "") nil file)))) | |
645 (set-face-property face 'background-pixmap file)) | |
627 | 646 |
628 (defun face-display-table (face &optional locale tag-set exact-p) | 647 (defun face-display-table (face &optional locale tag-set exact-p) |
629 "Return the display table of FACE in LOCALE. | 648 "Return the display table of FACE in LOCALE. |
630 | 649 |
631 A vector (as returned by `make-display-table') will be returned. | 650 A vector (as returned by `make-display-table') will be returned. |
1134 stage 1. This ensures that there is an actual setting for | 1153 stage 1. This ensures that there is an actual setting for |
1135 the locale, so you will get the expected buffer-local/frame-local | 1154 the locale, so you will get the expected buffer-local/frame-local |
1136 behavior -- changes to the global value, to other locales, won't | 1155 behavior -- changes to the global value, to other locales, won't |
1137 affect this locale, (b) the face will actually look bold in | 1156 affect this locale, (b) the face will actually look bold in |
1138 the locale. | 1157 the locale. |
1139 STAGE 3: (if called for) | 1158 STAGE 3: (if called for) |
1140 | 1159 |
1141 The way the frobbing works depends on the device type -- first on whether | 1160 The way the frobbing works depends on the device type -- first on whether |
1142 or not it's TTY, and second, if it's a window-system device type, on which | 1161 or not it's TTY, and second, if it's a window-system device type, on which |
1143 particular window-system device type. For locales with a specific device | 1162 particular window-system device type. For locales with a specific device |
1144 type, we do the frobbing in the context of that device type -- this means | 1163 type, we do the frobbing in the context of that device type -- this means |
1293 ([bold-italic] . [bold])))) | 1312 ([bold-italic] . [bold])))) |
1294 | 1313 |
1295 | 1314 |
1296 ;; Size frobbing | 1315 ;; Size frobbing |
1297 ;; Thx Jan Vroonhof, Ref xemacs-beta <87oflypbum.fsf@petteflet.ntlworld.com> | 1316 ;; Thx Jan Vroonhof, Ref xemacs-beta <87oflypbum.fsf@petteflet.ntlworld.com> |
1298 ;; Jan had a separate helper function | 1317 ;; Jan had a separate helper function |
1299 (defun make-face-size (face size &optional locale tags exact-p) | 1318 (defun make-face-size (face size &optional locale tags exact-p) |
1300 "Adjust FACE to SIZE in LOCALE, if possible." | 1319 "Adjust FACE to SIZE in LOCALE, if possible." |
1301 (interactive (list (read-face-name "Set size of which face: ") | 1320 (interactive (list (read-face-name "Set size of which face: ") |
1302 (read-number "Size to set: " t 10))) | 1321 (read-number "Size to set: " t 10))) |
1303 (Face-frob-property face locale tags exact-p | 1322 (Face-frob-property face locale tags exact-p |