diff options
| author | Richard M. Stallman | 1997-08-20 23:15:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-20 23:15:22 +0000 |
| commit | 6c8f27539f12e407dde137653659873f801bf388 (patch) | |
| tree | 6a7556a090c56b92862857198ceaaefd98c044fb | |
| parent | 87a16a065d3d52bfb34c62329ad57728b93a2a32 (diff) | |
| download | emacs-6c8f27539f12e407dde137653659873f801bf388.tar.gz emacs-6c8f27539f12e407dde137653659873f801bf388.zip | |
(ps-print-face-extension-alist): Doc fix.
(ps-new-faces): Function deleted.
| -rw-r--r-- | lisp/ps-print.el | 70 |
1 files changed, 6 insertions, 64 deletions
diff --git a/lisp/ps-print.el b/lisp/ps-print.el index ffb430dbdf7..f176d9d07b6 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el | |||
| @@ -541,11 +541,7 @@ Please send all bug fixes and enhancements to | |||
| 541 | ;; box - text will be surrounded by a box. | 541 | ;; box - text will be surrounded by a box. |
| 542 | ;; outline - only the text border font will be printed. | 542 | ;; outline - only the text border font will be printed. |
| 543 | ;; | 543 | ;; |
| 544 | ;; See documentation for `ps-extend-face' and `ps-extend-face-list'. | 544 | ;; See the documentation for `ps-extend-face' and `ps-extend-face-list'. |
| 545 | ;; | ||
| 546 | ;; Besides remapping existing faces it is also possible to create new faces | ||
| 547 | ;; using `ps-new-faces' (see the documentation) for both the screen and | ||
| 548 | ;; printing presentation. | ||
| 549 | ;; | 545 | ;; |
| 550 | ;; Let's, for example, remap font-lock-keyword-face to another foreground color | 546 | ;; Let's, for example, remap font-lock-keyword-face to another foreground color |
| 551 | ;; and bold attribute: | 547 | ;; and bold attribute: |
| @@ -560,25 +556,12 @@ Please send all bug fixes and enhancements to | |||
| 560 | ;; (font-lock-keyword-face "RoyalBlue" nil underline)) | 556 | ;; (font-lock-keyword-face "RoyalBlue" nil underline)) |
| 561 | ;; 'MERGE) | 557 | ;; 'MERGE) |
| 562 | ;; | 558 | ;; |
| 563 | ;; And if we wish to create new faces and extend: | ||
| 564 | ;; | ||
| 565 | ;; (ps-new-faces | ||
| 566 | ;; ;; new faces for screen | ||
| 567 | ;; '((my-obsolete-face "White" "FireBrick" italic underline bold) | ||
| 568 | ;; (my-keyword-face "Blue") | ||
| 569 | ;; (my-comment-face "FireBrick" nil italic) | ||
| 570 | ;; (my-string-face "Grey40" nil italic)) | ||
| 571 | ;; ;; face extension for printing | ||
| 572 | ;; '((my-keyword-face nil nil bold) | ||
| 573 | ;; (my-comment-face nil nil bold) | ||
| 574 | ;; (font-lock-function-name-face "Blue" nil bold) | ||
| 575 | ;; (font-lock-variable-name-face "Sienna" nil bold italic) | ||
| 576 | ;; (font-lock-keyword-face "RoyalBlue" nil underline)) | ||
| 577 | ;; 'OVERRIDE 'MERGE) | ||
| 578 | ;; | ||
| 579 | ;; Note: the only attributes that have effect on screen are: bold, italic and | 559 | ;; Note: the only attributes that have effect on screen are: bold, italic and |
| 580 | ;; underline. All other screen effect is ignored. | 560 | ;; underline. All other screen effect is ignored. |
| 581 | ;; | 561 | ;; |
| 562 | ;; If you want to use a new face, define it first with `defface', | ||
| 563 | ;; and then call `ps-extend-face' to specify how to print it. | ||
| 564 | ;; | ||
| 582 | ;; | 565 | ;; |
| 583 | ;; How Ps-Print Has A Text And/Or Image On Background | 566 | ;; How Ps-Print Has A Text And/Or Image On Background |
| 584 | ;; -------------------------------------------------- | 567 | ;; -------------------------------------------------- |
| @@ -2237,8 +2220,8 @@ An element of this list has the following form: | |||
| 2237 | FG foreground color (string or nil) | 2220 | FG foreground color (string or nil) |
| 2238 | BG background color (string or nil) | 2221 | BG background color (string or nil) |
| 2239 | 2222 | ||
| 2240 | This list should not be handled directly, but through `ps-new-faces', | 2223 | Don't change this list directly; instead, use |
| 2241 | `ps-extend-face' and `ps-extend-face-list'. | 2224 | `ps-extend-face' and `ps-extend-face-list' to change it. |
| 2242 | See documentation for `ps-extend-face' for valid extension symbol. | 2225 | See documentation for `ps-extend-face' for valid extension symbol. |
| 2243 | See also `font-lock-face-attributes'.") | 2226 | See also `font-lock-face-attributes'.") |
| 2244 | 2227 | ||
| @@ -2269,47 +2252,6 @@ Each symbol correspond to one bit in a bit vector.") | |||
| 2269 | (defvar font-lock-face-attributes nil) | 2252 | (defvar font-lock-face-attributes nil) |
| 2270 | 2253 | ||
| 2271 | 2254 | ||
| 2272 | ;;;###autoload | ||
| 2273 | (defun ps-new-faces (face-screen &optional face-extension override-p merge-p) | ||
| 2274 | "Create new faces from FACE-SCREEN. | ||
| 2275 | |||
| 2276 | The FACE-SCREEN elements are added to `font-lock-face-attributes'. | ||
| 2277 | If optional OVERRIDE-P is non-nil, faces that already exist in | ||
| 2278 | `font-lock-face-attributes' are overrided. | ||
| 2279 | |||
| 2280 | If optional MERGE-p is non-nil, extensions in FACE-EXTENSION are merged with | ||
| 2281 | face extension in `ps-print-face-extension-alist'; otherwise, overrides. | ||
| 2282 | |||
| 2283 | The arguments FACE-SCREEN and FACE-EXTENSION are lists whose elements are: | ||
| 2284 | |||
| 2285 | (FACE-NAME FOREGROUND BACKGROUND EXTENSION...) | ||
| 2286 | |||
| 2287 | FACE-NAME is a face name. | ||
| 2288 | |||
| 2289 | FOREGROUND and BACKGROUND may be nil or a string that denotes the | ||
| 2290 | foreground and background colors respectively. | ||
| 2291 | |||
| 2292 | EXTENSION is some valid extension symbol (see `ps-extend-face')." | ||
| 2293 | (let ((mapfun (if override-p | ||
| 2294 | '(lambda (face) | ||
| 2295 | (let ((face-attributes (ps-extension-to-screen-face face))) | ||
| 2296 | (font-lock-make-face face-attributes) | ||
| 2297 | (ps-override-list 'font-lock-face-attributes | ||
| 2298 | face-attributes) | ||
| 2299 | (ps-override-list 'ps-print-face-extension-alist | ||
| 2300 | (ps-extension-to-bit-face face)))) | ||
| 2301 | '(lambda (face) | ||
| 2302 | (let ((face-attributes (ps-extension-to-screen-face face))) | ||
| 2303 | (font-lock-make-face face-attributes) | ||
| 2304 | (add-to-list 'font-lock-face-attributes | ||
| 2305 | face-attributes) | ||
| 2306 | (add-to-list 'ps-print-face-extension-alist | ||
| 2307 | (ps-extension-to-bit-face face)))) | ||
| 2308 | )) | ||
| 2309 | maplist) | ||
| 2310 | (mapcar mapfun face-screen) | ||
| 2311 | (ps-extend-face-list face-extension merge-p))) | ||
| 2312 | |||
| 2313 | 2255 | ||
| 2314 | (defun ps-override-list (sym-list element) | 2256 | (defun ps-override-list (sym-list element) |
| 2315 | (let ((maplist (assq (car element) (symbol-value sym-list)))) | 2257 | (let ((maplist (assq (car element) (symbol-value sym-list)))) |