annotate lisp/ps-def.el @ 100608:1635579d2a88

*** empty log message ***
author Carsten Dominik <dominik@science.uva.nl>
date Sat, 20 Dec 2008 14:39:23 +0000
parents ee5932bf781d
children a9dc0e7c3f2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
1 ;;; ps-def.el --- XEmacs and Emacs definitions for ps-print
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
2
91332
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
3 ;; Copyright (C) 2007, 2008 Free Software Foundation, Inc.
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
4
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
5 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
6 ;; Kenichi Handa <handa@m17n.org> (multi-byte characters)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
7 ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
8 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
9 ;; Keywords: wp, print, PostScript
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
10 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
11
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
13
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
16 ;; the Free Software Foundation, either version 3 of the License, or
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
17 ;; (at your option) any later version.
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
18
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
22 ;; GNU General Public License for more details.
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
23
94678
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
24 ;; You should have received a copy of the GNU General Public License
ee5932bf781d Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94276
diff changeset
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
26
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
27 ;;; Commentary:
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
28
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
29 ;; See ps-print.el for documentation.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
30
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
31 ;;; Code:
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
32
91430
85b224f48b52 (declare-function): Add compatibility definition.
Glenn Morris <rgm@gnu.org>
parents: 91332
diff changeset
33 (eval-and-compile
85b224f48b52 (declare-function): Add compatibility definition.
Glenn Morris <rgm@gnu.org>
parents: 91332
diff changeset
34 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
85b224f48b52 (declare-function): Add compatibility definition.
Glenn Morris <rgm@gnu.org>
parents: 91332
diff changeset
35
85b224f48b52 (declare-function): Add compatibility definition.
Glenn Morris <rgm@gnu.org>
parents: 91332
diff changeset
36 (declare-function ps-plot-with-face "ps-print" (from to face))
85b224f48b52 (declare-function): Add compatibility definition.
Glenn Morris <rgm@gnu.org>
parents: 91332
diff changeset
37 (declare-function ps-plot-string "ps-print" (string))
85b224f48b52 (declare-function): Add compatibility definition.
Glenn Morris <rgm@gnu.org>
parents: 91332
diff changeset
38
85b224f48b52 (declare-function): Add compatibility definition.
Glenn Morris <rgm@gnu.org>
parents: 91332
diff changeset
39 (defvar ps-bold-faces) ; in ps-print.el
85b224f48b52 (declare-function): Add compatibility definition.
Glenn Morris <rgm@gnu.org>
parents: 91332
diff changeset
40 (defvar ps-italic-faces)
85b224f48b52 (declare-function): Add compatibility definition.
Glenn Morris <rgm@gnu.org>
parents: 91332
diff changeset
41
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
42
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
43
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
44 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
45 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
46 ;; XEmacs Definitions
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
47
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
48
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
49 (cond
90779
6ea6d3d1508d Some code fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90738
diff changeset
50 ((featurep 'xemacs) ; XEmacs
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
51
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
52
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
53 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
54 ;; ps-bdf
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
55
90784
5d47178d1a18 Tiny definition change.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90779
diff changeset
56 (defvar installation-directory nil)
90779
6ea6d3d1508d Some code fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90738
diff changeset
57 (defvar coding-system-for-read)
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
58
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
59
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
60 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
61 ;; ps-mule
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
62
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
63 (defvar leading-code-private-22 157)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
64
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
65 (or (fboundp 'charset-bytes)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
66 (defun charset-bytes (charset) 1)) ; ascii
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
67
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
68 (or (fboundp 'charset-dimension)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
69 (defun charset-dimension (charset) 1)) ; ascii
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
70
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
71 (or (fboundp 'charset-id)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
72 (defun charset-id (charset) 0)) ; ascii
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
73
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
74 (or (fboundp 'charset-width)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
75 (defun charset-width (charset) 1)) ; ascii
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
76
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
77 (or (fboundp 'find-charset-region)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
78 (defun find-charset-region (beg end &optional table)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
79 (list 'ascii)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
80
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
81 (or (fboundp 'char-width)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
82 (defun char-width (char) 1)) ; ascii
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
83
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
84 (or (fboundp 'chars-in-region)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
85 (defun chars-in-region (beg end)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
86 (- (max beg end) (min beg end))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
87
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
88 (or (fboundp 'forward-point)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
89 (defun forward-point (arg)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
90 (save-excursion
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
91 (let ((count (abs arg))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
92 (step (if (zerop arg)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
93 0
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
94 (/ arg arg))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
95 (while (and (> count 0)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
96 (< (point-min) (point)) (< (point) (point-max)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
97 (forward-char step)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
98 (setq count (1- count)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
99 (+ (point) (* count step))))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
100
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
101 (or (fboundp 'decompose-composite-char)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
102 (defun decompose-composite-char (char &optional type
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
103 with-composition-rule)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
104 nil))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
105
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
106 (or (fboundp 'encode-coding-string)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
107 (defun encode-coding-string (string coding-system &optional nocopy)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
108 (if nocopy
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
109 string
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
110 (copy-sequence string))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
111
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
112 (or (fboundp 'coding-system-p)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
113 (defun coding-system-p (obj) nil))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
114
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
115 (or (fboundp 'ccl-execute-on-string)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
116 (defun ccl-execute-on-string (ccl-prog status str
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
117 &optional contin unibyte-p)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
118 str))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
119
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
120 (or (fboundp 'define-ccl-program)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
121 (defmacro define-ccl-program (name ccl-program &optional doc)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
122 `(defconst ,name nil ,doc)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
123
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
124 (or (fboundp 'multibyte-string-p)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
125 (defun multibyte-string-p (str)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
126 (let ((len (length str))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
127 (i 0)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
128 multibyte)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
129 (while (and (< i len) (not (setq multibyte (> (aref str i) 255))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
130 (setq i (1+ i)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
131 multibyte)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
132
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
133 (or (fboundp 'string-make-multibyte)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
134 (defalias 'string-make-multibyte 'copy-sequence))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
135
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
136 (or (fboundp 'encode-char)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
137 (defun encode-char (ch ccs)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
138 ch))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
139
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
140
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
141 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
142 ;; ps-print
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
143
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
144 ;; GNU Emacs
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
145 (or (fboundp 'line-beginning-position)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
146 (defun line-beginning-position (&optional n)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
147 (save-excursion
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
148 (and n (/= n 1) (forward-line (1- n)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
149 (beginning-of-line)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
150 (point))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
151
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
152
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
153 ;; GNU Emacs
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
154 (or (fboundp 'find-composition)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
155 (defalias 'find-composition 'ignore))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
156
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
157
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
158 (defun ps-xemacs-color-name (color)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
159 (if (color-specifier-p color)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
160 (color-name color)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
161 color))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
162
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
163
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
164 (defalias 'ps-mark-active-p 'region-active-p)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
165
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
166
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
167 (defun ps-face-foreground-name (face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
168 (ps-xemacs-color-name (face-foreground face)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
169
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
170
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
171 (defun ps-face-background-name (face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
172 (ps-xemacs-color-name (face-background face)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
173
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
174
90779
6ea6d3d1508d Some code fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90738
diff changeset
175 (defalias 'ps-frame-parameter 'frame-property)
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
176
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
177
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
178 ;; Return t if the device (which can be changed during an emacs session)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
179 ;; can handle colors.
94276
46345beb0bac (ps-color-device): Drop support for XEmacs < 19.12.
Glenn Morris <rgm@gnu.org>
parents: 91430
diff changeset
180 (defun ps-color-device ()
46345beb0bac (ps-color-device): Drop support for XEmacs < 19.12.
Glenn Morris <rgm@gnu.org>
parents: 91430
diff changeset
181 (eq (device-class) 'color))
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
182
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
183 (defun ps-mapper (extent list)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
184 (nconc list
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
185 (list (list (extent-start-position extent) 'push extent)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
186 (list (extent-end-position extent) 'pull extent)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
187 nil)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
188
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
189
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
190 (defun ps-extent-sorter (a b)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
191 (< (extent-priority a) (extent-priority b)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
192
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
193
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
194 (defun ps-xemacs-face-kind-p (face kind kind-regex)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
195 (let* ((frame-font (or (face-font-instance face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
196 (face-font-instance 'default)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
197 (kind-cons
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
198 (and frame-font
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
199 (assq kind
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
200 (font-instance-properties frame-font))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
201 (kind-spec (cdr-safe kind-cons))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
202 (case-fold-search t))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
203 (and kind-spec (string-match kind-regex kind-spec))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
204
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
205
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
206 ;; to avoid XEmacs compilation gripes
90779
6ea6d3d1508d Some code fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90738
diff changeset
207 (defvar coding-system-for-write)
6ea6d3d1508d Some code fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90738
diff changeset
208 (defvar buffer-file-coding-system)
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
209
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
210
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
211 (and (fboundp 'find-coding-system)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
212 (or (funcall 'find-coding-system 'raw-text-unix)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
213 (funcall 'copy-coding-system 'no-conversion-unix 'raw-text-unix)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
214
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
215
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
216 (defun ps-color-values (x-color)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
217 (let ((color (ps-xemacs-color-name x-color)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
218 (cond
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
219 ((fboundp 'x-color-values)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
220 (funcall 'x-color-values color))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
221 ((and (fboundp 'color-instance-rgb-components)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
222 (ps-color-device))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
223 (funcall 'color-instance-rgb-components
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
224 (if (color-instance-p x-color)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
225 x-color
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
226 (make-color-instance color))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
227 (t
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
228 (error "No available function to determine X color values")))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
229
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
230
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
231 (defun ps-face-bold-p (face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
232 (or (ps-xemacs-face-kind-p face 'WEIGHT_NAME "bold\\|demibold")
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
233 (memq face ps-bold-faces))) ; Kludge-compatible
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
234
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
235
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
236 (defun ps-face-italic-p (face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
237 (or (ps-xemacs-face-kind-p face 'ANGLE_NAME "i\\|o")
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
238 (ps-xemacs-face-kind-p face 'SLANT "i\\|o")
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
239 (memq face ps-italic-faces))) ; Kludge-compatible
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
240
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
241
91332
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
242 (defalias 'ps-face-strikeout-p 'ignore)
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
243
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
244
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
245 (defalias 'ps-face-overline-p 'ignore)
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
246
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
247
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
248 (defalias 'ps-face-box-p 'ignore)
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
249
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
250
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
251 ;; XEmacs will have to make do with %s (princ) for floats.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
252 (defvar ps-color-format "%s %s %s")
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
253 (defvar ps-float-format "%s ")
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
254
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
255
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
256 (defun ps-generate-postscript-with-faces1 (from to)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
257 ;; Generate some PostScript.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
258 (let ((face 'default)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
259 (position to)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
260 ;; XEmacs
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
261 ;; Build the list of extents...
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
262 (a (cons 'dummy nil))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
263 record type extent extent-list)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
264 (map-extents 'ps-mapper nil from to a)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
265 (setq a (sort (cdr a) 'car-less-than-car)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
266 extent-list nil)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
267
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
268 ;; Loop through the extents...
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
269 (while a
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
270 (setq record (car a)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
271 position (car record)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
272
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
273 record (cdr record)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
274 type (car record)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
275
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
276 record (cdr record)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
277 extent (car record))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
278
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
279 ;; Plot up to this record.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
280 ;; XEmacs 19.12: for some reason, we're getting into a
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
281 ;; situation in which some of the records have
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
282 ;; positions less than 'from'. Since we've narrowed
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
283 ;; the buffer, this'll generate errors. This is a hack,
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
284 ;; but don't call ps-plot-with-face unless from > point-min.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
285 (and (>= from (point-min))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
286 (ps-plot-with-face from (min position (point-max)) face))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
287
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
288 (cond
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
289 ((eq type 'push)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
290 (and (extent-face extent)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
291 (setq extent-list (sort (cons extent extent-list)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
292 'ps-extent-sorter))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
293
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
294 ((eq type 'pull)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
295 (setq extent-list (sort (delq extent extent-list)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
296 'ps-extent-sorter))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
297
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
298 (setq face (if extent-list
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
299 (extent-face (car extent-list))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
300 'default)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
301 from position
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
302 a (cdr a)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
303
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
304 (ps-plot-with-face from to face)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
305
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
306 )
90779
6ea6d3d1508d Some code fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90738
diff changeset
307 (t ; Emacs
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
308 ;; Do nothing
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
309 )) ; end cond featurep
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
310
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
311
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
312
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
313 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
314 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
315 ;; Emacs Definitions
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
316
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
317
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
318 (cond
90779
6ea6d3d1508d Some code fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90738
diff changeset
319 ((featurep 'xemacs) ; XEmacs
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
320 ;; Do nothing
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
321 )
90779
6ea6d3d1508d Some code fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90738
diff changeset
322 (t ; Emacs
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
323
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
324
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
325 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
326 ;; ps-print
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
327
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
328
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
329 (defun ps-mark-active-p ()
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
330 mark-active)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
331
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
332
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
333 (defun ps-face-foreground-name (face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
334 (face-foreground face nil t))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
335
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
336
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
337 (defun ps-face-background-name (face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
338 (face-background face nil t))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
339
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
340
90779
6ea6d3d1508d Some code fix.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 90738
diff changeset
341 (defalias 'ps-frame-parameter 'frame-parameter)
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
342
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
343
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
344 ;; Return t if the device (which can be changed during an emacs session) can
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
345 ;; handle colors. This function is not yet implemented for GNU emacs.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
346 (defun ps-color-device ()
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
347 (if (fboundp 'color-values)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
348 (funcall 'color-values "Green")
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
349 t))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
350
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
351
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
352 (defun ps-color-values (x-color)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
353 (cond
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
354 ((fboundp 'color-values)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
355 (funcall 'color-values x-color))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
356 ((fboundp 'x-color-values)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
357 (funcall 'x-color-values x-color))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
358 (t
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
359 (error "No available function to determine X color values"))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
360
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
361
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
362 (defun ps-face-bold-p (face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
363 (or (face-bold-p face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
364 (memq face ps-bold-faces)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
365
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
366
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
367 (defun ps-face-italic-p (face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
368 (or (face-italic-p face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
369 (memq face ps-italic-faces)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
370
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
371
91332
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
372 (defun ps-face-strikeout-p (face)
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
373 (eq (face-attribute face :strike-through) t))
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
374
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
375
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
376 (defun ps-face-overline-p (face)
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
377 (eq (face-attribute face :overline) t))
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
378
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
379
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
380 (defun ps-face-box-p (face)
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
381 (not (memq (face-attribute face :box) '(nil unspecified))))
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
382
6b6e684740e5 Fix face attributes recognition
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 91074
diff changeset
383
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
384 ;; Emacs understands the %f format; we'll use it to limit color RGB values
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
385 ;; to three decimals to cut down some on the size of the PostScript output.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
386 (defvar ps-color-format "%0.3f %0.3f %0.3f")
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
387 (defvar ps-float-format "%0.3f ")
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
388
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
389
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
390 (defun ps-generate-postscript-with-faces1 (from to)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
391 ;; Generate some PostScript.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
392 (let ((face 'default)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
393 (position to)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
394 ;; Emacs
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
395 (property-change from)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
396 (overlay-change from)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
397 (save-buffer-invisibility-spec buffer-invisibility-spec)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
398 (buffer-invisibility-spec nil)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
399 before-string after-string)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
400 (while (< from to)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
401 (and (< property-change to) ; Don't search for property change
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
402 ; unless previous search succeeded.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
403 (setq property-change (next-property-change from nil to)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
404 (and (< overlay-change to) ; Don't search for overlay change
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
405 ; unless previous search succeeded.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
406 (setq overlay-change (min (next-overlay-change from)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
407 to)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
408 (setq position (min property-change overlay-change)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
409 before-string nil
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
410 after-string nil)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
411 ;; The code below is not quite correct,
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
412 ;; because a non-nil overlay invisible property
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
413 ;; which is inactive according to the current value
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
414 ;; of buffer-invisibility-spec nonetheless overrides
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
415 ;; a face text property.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
416 (setq face
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
417 (cond ((let ((prop (get-text-property from 'invisible)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
418 ;; Decide whether this invisible property
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
419 ;; really makes the text invisible.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
420 (if (eq save-buffer-invisibility-spec t)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
421 (not (null prop))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
422 (or (memq prop save-buffer-invisibility-spec)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
423 (assq prop save-buffer-invisibility-spec))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
424 'emacs--invisible--face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
425 ((get-text-property from 'face))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
426 (t 'default)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
427 (let ((overlays (overlays-at from))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
428 (face-priority -1)) ; text-property
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
429 (while (and overlays
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
430 (not (eq face 'emacs--invisible--face)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
431 (let* ((overlay (car overlays))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
432 (overlay-invisible
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
433 (overlay-get overlay 'invisible))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
434 (overlay-priority
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
435 (or (overlay-get overlay 'priority) 0)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
436 (and (> overlay-priority face-priority)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
437 (setq before-string
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
438 (or (overlay-get overlay 'before-string)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
439 before-string)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
440 after-string
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
441 (or (and (<= (overlay-end overlay) position)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
442 (overlay-get overlay 'after-string))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
443 after-string)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
444 face-priority overlay-priority
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
445 face
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
446 (cond
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
447 ((if (eq save-buffer-invisibility-spec t)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
448 (not (null overlay-invisible))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
449 (or (memq overlay-invisible
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
450 save-buffer-invisibility-spec)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
451 (assq overlay-invisible
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
452 save-buffer-invisibility-spec)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
453 'emacs--invisible--face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
454 ((overlay-get overlay 'face))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
455 (t face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
456 ))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
457 (setq overlays (cdr overlays))))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
458 ;; Plot up to this record.
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
459 (and before-string
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
460 (ps-plot-string before-string))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
461 (ps-plot-with-face from position face)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
462 (and after-string
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
463 (ps-plot-string after-string))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
464 (setq from position))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
465 (ps-plot-with-face from to face)))
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
466
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
467 )) ; end cond featurep
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
468
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
469
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
470 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
471
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
472 (provide 'ps-def)
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
473
90738
a77c806ee80a Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 90736
diff changeset
474 ;; arch-tag: 4edde45b-af10-4685-b8ee-7cd0f951095a
90736
ef1369583937 Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
diff changeset
475 ;;; ps-def.el ends here