aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinicius Jose Latorre2007-03-02 01:43:44 +0000
committerVinicius Jose Latorre2007-03-02 01:43:44 +0000
commit9e53076ea9d9f18f9fbdf28d79958691720b446f (patch)
tree7eebeb933f2acaa5a76c18c222b3d175ca65c097
parent77594249a73edc22f664bd0ab7271534909733d6 (diff)
downloademacs-9e53076ea9d9f18f9fbdf28d79958691720b446f.tar.gz
emacs-9e53076ea9d9f18f9fbdf28d79958691720b446f.zip
Some code fix.
-rw-r--r--lisp/ChangeLog.unicode15
-rw-r--r--lisp/ps-def.el28
-rw-r--r--lisp/ps-print.el107
-rw-r--r--lisp/ps-samp.el21
4 files changed, 88 insertions, 83 deletions
diff --git a/lisp/ChangeLog.unicode b/lisp/ChangeLog.unicode
index 3df1c1b8ad9..d75bfb8e59a 100644
--- a/lisp/ChangeLog.unicode
+++ b/lisp/ChangeLog.unicode
@@ -1,3 +1,18 @@
12007-03-01 Vinicius Jose Latorre <viniciusjl@ig.com.br>
2
3 * ps-print.el: Replace (defvar VAR nil) by (defvar VAR).
4 (ps-print-emacs-type): Var eliminated.
5 (ps-setup): Remove ps-print-emacs-type. Print which Emacsen is
6 running ps-print package.
7
8 * ps-def.el: Replace (defvar VAR nil) by (defvar VAR).
9 (ps-frame-parameter): Replace defun by defalias.
10 (mark-active): defvar eliminated.
11
12 * ps-samp.el (ps-prsc, ps-c-prsc, ps-s-prsc): Macros eliminated.
13 (ps-rmail-mode-hook, ps-vm-mode-hook, ps-gnus-summary-setup)
14 (ps-jts-ps-setup): Replace macros by vector key definition.
15
12007-02-16 Vinicius Jose Latorre <viniciusjl@ig.com.br> 162007-02-16 Vinicius Jose Latorre <viniciusjl@ig.com.br>
2 17
3 * progmodes/ebnf-abn.el (ebnf-abn-skip-comment): 18 * progmodes/ebnf-abn.el (ebnf-abn-skip-comment):
diff --git a/lisp/ps-def.el b/lisp/ps-def.el
index f11d716ea41..d2095352d8f 100644
--- a/lisp/ps-def.el
+++ b/lisp/ps-def.el
@@ -7,7 +7,7 @@
7;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters) 7;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters)
8;; Vinicius Jose Latorre <viniciusjl@ig.com.br> 8;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
9;; Keywords: wp, print, PostScript 9;; Keywords: wp, print, PostScript
10;; Version: 7.2 10;; Version: 7.2.2
11;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre 11;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
12 12
13;; This file is part of GNU Emacs. 13;; This file is part of GNU Emacs.
@@ -40,14 +40,14 @@
40 40
41 41
42(cond 42(cond
43 ((featurep 'xemacs) ; xemacs 43 ((featurep 'xemacs) ; XEmacs
44 44
45 45
46 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 46 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
47 ;; ps-bdf 47 ;; ps-bdf
48 48
49 (defvar installation-directory nil) 49 (defvar installation-directory)
50 (defvar coding-system-for-read nil) 50 (defvar coding-system-for-read)
51 51
52 52
53 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 53 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -165,8 +165,7 @@
165 (ps-xemacs-color-name (face-background face))) 165 (ps-xemacs-color-name (face-background face)))
166 166
167 167
168 (defun ps-frame-parameter (param) 168 (defalias 'ps-frame-parameter 'frame-property)
169 (frame-property nil param))
170 169
171 170
172 ;; Return t if the device (which can be changed during an emacs session) 171 ;; Return t if the device (which can be changed during an emacs session)
@@ -207,9 +206,9 @@
207 206
208 207
209 ;; to avoid XEmacs compilation gripes 208 ;; to avoid XEmacs compilation gripes
210 (defvar coding-system-for-write nil) 209 (defvar coding-system-for-write)
211 (defvar coding-system-for-read nil) 210 (defvar coding-system-for-read)
212 (defvar buffer-file-coding-system nil) 211 (defvar buffer-file-coding-system)
213 212
214 213
215 (and (fboundp 'find-coding-system) 214 (and (fboundp 'find-coding-system)
@@ -299,7 +298,7 @@
299 (ps-plot-with-face from to face))) 298 (ps-plot-with-face from to face)))
300 299
301 ) 300 )
302 (t ; emacs 301 (t ; Emacs
303 ;; Do nothing 302 ;; Do nothing
304 )) ; end cond featurep 303 )) ; end cond featurep
305 304
@@ -311,17 +310,15 @@
311 310
312 311
313(cond 312(cond
314 ((featurep 'xemacs) ; xemacs 313 ((featurep 'xemacs) ; XEmacs
315 ;; Do nothing 314 ;; Do nothing
316 ) 315 )
317 (t ; emacs 316 (t ; Emacs
318 317
319 318
320 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 319 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
321 ;; ps-print 320 ;; ps-print
322 321
323 (defvar mark-active nil)
324
325 322
326 (defun ps-mark-active-p () 323 (defun ps-mark-active-p ()
327 mark-active) 324 mark-active)
@@ -335,8 +332,7 @@
335 (face-background face nil t)) 332 (face-background face nil t))
336 333
337 334
338 (defun ps-frame-parameter (param) 335 (defalias 'ps-frame-parameter 'frame-parameter)
339 (frame-parameter nil param))
340 336
341 337
342 ;; Return t if the device (which can be changed during an emacs session) can 338 ;; Return t if the device (which can be changed during an emacs session) can
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index e39fa66d709..d0e3a46c4eb 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -1450,18 +1450,16 @@ Please send all bug fixes and enhancements to
1450 (error "`ps-print' requires floating point support")) 1450 (error "`ps-print' requires floating point support"))
1451 1451
1452 1452
1453(defvar ps-print-emacs-type 1453(let ((case-fold-search t))
1454 (let ((case-fold-search t)) 1454 (cond ((string-match "XEmacs" emacs-version))
1455 (cond ((string-match "XEmacs" emacs-version) 'xemacs) 1455 ((string-match "Lucid" emacs-version)
1456 ((string-match "Lucid" emacs-version) 1456 (error "`ps-print' doesn't support Lucid"))
1457 (error "`ps-print' doesn't support Lucid")) 1457 ((string-match "Epoch" emacs-version)
1458 ((string-match "Epoch" emacs-version) 1458 (error "`ps-print' doesn't support Epoch"))
1459 (error "`ps-print' doesn't support Epoch")) 1459 (t
1460 (t 1460 (unless (and (boundp 'emacs-major-version)
1461 (unless (and (boundp 'emacs-major-version) 1461 (>= emacs-major-version 22))
1462 (> emacs-major-version 22)) 1462 (error "`ps-print' only supports Emacs 22 and higher")))))
1463 (error "`ps-print' only supports Emacs 23 and higher"))
1464 'emacs))))
1465 1463
1466 1464
1467(defconst ps-windows-system 1465(defconst ps-windows-system
@@ -3276,13 +3274,13 @@ It's like the very first character of buffer (or region) is ^L (\\014)."
3276 3274
3277(defcustom ps-postscript-code-directory 3275(defcustom ps-postscript-code-directory
3278 (or (if (featurep 'xemacs) 3276 (or (if (featurep 'xemacs)
3279 (cond ((fboundp 'locate-data-directory) ; xemacs 3277 (cond ((fboundp 'locate-data-directory) ; XEmacs
3280 (funcall 'locate-data-directory "ps-print")) 3278 (funcall 'locate-data-directory "ps-print"))
3281 ((boundp 'data-directory) ; xemacs 3279 ((boundp 'data-directory) ; XEmacs
3282 (symbol-value 'data-directory)) 3280 (symbol-value 'data-directory))
3283 (t ; don't know what to do 3281 (t ; don't know what to do
3284 nil)) 3282 nil))
3285 data-directory) ; emacs 3283 data-directory) ; Emacs
3286 (error "`ps-postscript-code-directory' isn't set properly")) 3284 (error "`ps-postscript-code-directory' isn't set properly"))
3287 "*Directory where it's located the PostScript prologue file used by ps-print. 3285 "*Directory where it's located the PostScript prologue file used by ps-print.
3288By default, this directory is the same as in the variable `data-directory'." 3286By default, this directory is the same as in the variable `data-directory'."
@@ -3524,11 +3522,12 @@ The table depends on the current ps-print setup."
3524 (mapconcat 3522 (mapconcat
3525 #'ps-print-quote 3523 #'ps-print-quote
3526 (list 3524 (list
3527 (concat "\n;;; ps-print version " ps-print-version "\n") 3525 (concat "\n;;; (" (if (featurep 'xemacs) "XEmacs" "Emacs")
3526 ") ps-print version " ps-print-version "\n")
3528 ";; internal vars" 3527 ";; internal vars"
3529 (ps-comment-string "emacs-version " emacs-version) 3528 (ps-comment-string "emacs-version " emacs-version)
3530 (ps-comment-string "ps-windows-system " ps-windows-system) 3529 (ps-comment-string "ps-windows-system " ps-windows-system)
3531 (ps-comment-string "ps-lp-system " ps-lp-system) 3530 (ps-comment-string "ps-lp-system " ps-lp-system)
3532 nil 3531 nil
3533 '(25 . ps-print-color-p) 3532 '(25 . ps-print-color-p)
3534 '(25 . ps-lpr-command) 3533 '(25 . ps-lpr-command)
@@ -3801,7 +3800,7 @@ Note: No major/minor-mode is activated and no local variables are evaluated for
3801 filename)))) 3800 filename))))
3802 3801
3803 3802
3804(defvar ps-mark-code-directory nil) 3803(defvar ps-mark-code-directory)
3805 3804
3806(defvar ps-print-prologue-0 "" 3805(defvar ps-print-prologue-0 ""
3807 "ps-print PostScript error handler.") 3806 "ps-print PostScript error handler.")
@@ -3811,12 +3810,12 @@ Note: No major/minor-mode is activated and no local variables are evaluated for
3811 3810
3812;; Start Editing Here: 3811;; Start Editing Here:
3813 3812
3814(defvar ps-source-buffer nil) 3813(defvar ps-source-buffer)
3815(defvar ps-spool-buffer-name "*PostScript*") 3814(defvar ps-spool-buffer-name "*PostScript*")
3816(defvar ps-spool-buffer nil) 3815(defvar ps-spool-buffer)
3817 3816
3818(defvar ps-output-head nil) 3817(defvar ps-output-head)
3819(defvar ps-output-tail nil) 3818(defvar ps-output-tail)
3820 3819
3821(defvar ps-page-postscript 0) ; page number 3820(defvar ps-page-postscript 0) ; page number
3822(defvar ps-page-order 0) ; PostScript page counter 3821(defvar ps-page-order 0) ; PostScript page counter
@@ -3826,29 +3825,29 @@ Note: No major/minor-mode is activated and no local variables are evaluated for
3826(defvar ps-page-n-up 0) ; n-up counter 3825(defvar ps-page-n-up 0) ; n-up counter
3827(defvar ps-lines-printed 0) ; total lines printed 3826(defvar ps-lines-printed 0) ; total lines printed
3828(defvar ps-showline-count 1) ; line number counter 3827(defvar ps-showline-count 1) ; line number counter
3829(defvar ps-first-page nil) 3828(defvar ps-first-page)
3830(defvar ps-last-page nil) 3829(defvar ps-last-page)
3831(defvar ps-print-page-p t) 3830(defvar ps-print-page-p t)
3832 3831
3833(defvar ps-control-or-escape-regexp nil) 3832(defvar ps-control-or-escape-regexp)
3834(defvar ps-n-up-on nil) 3833(defvar ps-n-up-on)
3835 3834
3836(defvar ps-background-pages nil) 3835(defvar ps-background-pages)
3837(defvar ps-background-all-pages nil) 3836(defvar ps-background-all-pages)
3838(defvar ps-background-text-count 0) 3837(defvar ps-background-text-count 0)
3839(defvar ps-background-image-count 0) 3838(defvar ps-background-image-count 0)
3840 3839
3841(defvar ps-current-font 0) 3840(defvar ps-current-font 0)
3842(defvar ps-default-foreground nil) 3841(defvar ps-default-foreground)
3843(defvar ps-default-background nil) 3842(defvar ps-default-background)
3844(defvar ps-default-color nil) 3843(defvar ps-default-color)
3845(defvar ps-current-color nil) 3844(defvar ps-current-color)
3846(defvar ps-current-bg nil) 3845(defvar ps-current-bg)
3847 3846
3848(defvar ps-zebra-stripe-full-p nil) 3847(defvar ps-zebra-stripe-full-p)
3849(defvar ps-razchunk 0) 3848(defvar ps-razchunk 0)
3850 3849
3851(defvar ps-color-p nil) 3850(defvar ps-color-p)
3852 3851
3853;; These values determine how much print-height to deduct when headers/footers 3852;; These values determine how much print-height to deduct when headers/footers
3854;; are turned on. This is a pretty clumsy way of handling it, but it'll do for 3853;; are turned on. This is a pretty clumsy way of handling it, but it'll do for
@@ -3868,20 +3867,20 @@ This is in units of points (1/72 inch).")
3868(defmacro ps-page-dimensions-get-height (dims) `(nth 1 ,dims)) 3867(defmacro ps-page-dimensions-get-height (dims) `(nth 1 ,dims))
3869(defmacro ps-page-dimensions-get-media (dims) `(nth 2 ,dims)) 3868(defmacro ps-page-dimensions-get-media (dims) `(nth 2 ,dims))
3870 3869
3871(defvar ps-landscape-page-height nil) 3870(defvar ps-landscape-page-height)
3872 3871
3873(defvar ps-print-width nil) 3872(defvar ps-print-width)
3874(defvar ps-print-height nil) 3873(defvar ps-print-height)
3875 3874
3876(defvar ps-height-remaining nil) 3875(defvar ps-height-remaining)
3877(defvar ps-width-remaining nil) 3876(defvar ps-width-remaining)
3878 3877
3879(defvar ps-font-size-internal nil) 3878(defvar ps-font-size-internal)
3880(defvar ps-header-font-size-internal nil) 3879(defvar ps-header-font-size-internal)
3881(defvar ps-header-title-font-size-internal nil) 3880(defvar ps-header-title-font-size-internal)
3882(defvar ps-footer-font-size-internal nil) 3881(defvar ps-footer-font-size-internal)
3883(defvar ps-line-spacing-internal nil) 3882(defvar ps-line-spacing-internal)
3884(defvar ps-paragraph-spacing-internal nil) 3883(defvar ps-paragraph-spacing-internal)
3885 3884
3886 3885
3887;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3886;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -4078,10 +4077,10 @@ If EXTENSION is any other symbol, it is ignored."
4078 message-log-max)) 4077 message-log-max))
4079 4078
4080 4079
4081(defvar ps-print-hook nil) 4080(defvar ps-print-hook)
4082(defvar ps-print-begin-sheet-hook nil) 4081(defvar ps-print-begin-sheet-hook)
4083(defvar ps-print-begin-page-hook nil) 4082(defvar ps-print-begin-page-hook)
4084(defvar ps-print-begin-column-hook nil) 4083(defvar ps-print-begin-column-hook)
4085 4084
4086 4085
4087(defun ps-print-without-faces (from to &optional filename region-p) 4086(defun ps-print-without-faces (from to &optional filename region-p)
@@ -4636,7 +4635,7 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th
4636 4635
4637;; These functions insert the arrays that define the contents of the headers. 4636;; These functions insert the arrays that define the contents of the headers.
4638 4637
4639(defvar ps-encode-header-string-function nil) 4638(defvar ps-encode-header-string-function)
4640 4639
4641(defun ps-generate-header-line (fonttag &optional content) 4640(defun ps-generate-header-line (fonttag &optional content)
4642 (ps-output " [" fonttag " ") 4641 (ps-output " [" fonttag " ")
@@ -5909,7 +5908,7 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5909 (/ q-done (/ q-todo 100))) 5908 (/ q-done (/ q-todo 100)))
5910 )))))) 5909 ))))))
5911 5910
5912(defvar ps-last-font nil) 5911(defvar ps-last-font)
5913 5912
5914(defun ps-set-font (font) 5913(defun ps-set-font (font)
5915 (setq ps-last-font (format "f%d" (setq ps-current-font font))) 5914 (setq ps-last-font (format "f%d" (setq ps-current-font font)))
diff --git a/lisp/ps-samp.el b/lisp/ps-samp.el
index 67907e0a663..b42d8cb6a1a 100644
--- a/lisp/ps-samp.el
+++ b/lisp/ps-samp.el
@@ -9,7 +9,7 @@
9;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters) 9;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters)
10;; Vinicius Jose Latorre <viniciusjl@ig.com.br> 10;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
11;; Keywords: wp, print, PostScript 11;; Keywords: wp, print, PostScript
12;; Version: 7.2 12;; Version: 7.2.2
13;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre 13;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
14 14
15;; This file is part of GNU Emacs. 15;; This file is part of GNU Emacs.
@@ -49,17 +49,12 @@
49;; WARNING!!! The following code is *sample* code only. 49;; WARNING!!! The following code is *sample* code only.
50;; Don't use it unless you understand what it does! 50;; Don't use it unless you understand what it does!
51 51
52(defmacro ps-prsc () 52;; The key `f22' should probably be replaced by `print'. --Stef
53 `(if (featurep 'xemacs) 'f22 [f22]))
54(defmacro ps-c-prsc ()
55 `(if (featurep 'xemacs) '(control f22) [C-f22]))
56(defmacro ps-s-prsc ()
57 `(if (featurep 'xemacs) '(shift f22) [S-f22]))
58 53
59;; A hook to bind to `rmail-mode-hook' to locally bind prsc and set the 54;; A hook to bind to `rmail-mode-hook' to locally bind prsc and set the
60;; `ps-left-headers' specially for mail messages. 55;; `ps-left-headers' specially for mail messages.
61(defun ps-rmail-mode-hook () 56(defun ps-rmail-mode-hook ()
62 (local-set-key (ps-prsc) 'ps-rmail-print-message-from-summary) 57 (local-set-key [(f22)] 'ps-rmail-print-message-from-summary)
63 (setq ps-header-lines 3 58 (setq ps-header-lines 3
64 ps-left-header 59 ps-left-header
65 ;; The left headers will display the message's subject, its 60 ;; The left headers will display the message's subject, its
@@ -133,7 +128,7 @@
133;; A hook to bind to `vm-mode-hook' to locally bind prsc and set the 128;; A hook to bind to `vm-mode-hook' to locally bind prsc and set the
134;; `ps-left-headers' specially for mail messages. 129;; `ps-left-headers' specially for mail messages.
135(defun ps-vm-mode-hook () 130(defun ps-vm-mode-hook ()
136 (local-set-key (ps-prsc) 'ps-vm-print-message-from-summary) 131 (local-set-key [(f22)] 'ps-vm-print-message-from-summary)
137 (setq ps-header-lines 3 132 (setq ps-header-lines 3
138 ps-left-header 133 ps-left-header
139 ;; The left headers will display the message's subject, its 134 ;; The left headers will display the message's subject, its
@@ -159,7 +154,7 @@
159;; A hook to bind to bind to `gnus-summary-setup-buffer' to locally bind 154;; A hook to bind to bind to `gnus-summary-setup-buffer' to locally bind
160;; prsc. 155;; prsc.
161(defun ps-gnus-summary-setup () 156(defun ps-gnus-summary-setup ()
162 (local-set-key (ps-prsc) 'ps-gnus-print-article-from-summary)) 157 (local-set-key [(f22)] 'ps-gnus-print-article-from-summary))
163 158
164;; Look in an article or mail message for the Subject: line. To be 159;; Look in an article or mail message for the Subject: line. To be
165;; placed in `ps-left-headers'. 160;; placed in `ps-left-headers'.
@@ -191,9 +186,9 @@
191;; modification.) 186;; modification.)
192 187
193(defun ps-jts-ps-setup () 188(defun ps-jts-ps-setup ()
194 (global-set-key (ps-prsc) 'ps-spool-buffer-with-faces) ;f22 is prsc 189 (global-set-key [(f22)] 'ps-spool-buffer-with-faces) ;f22 is prsc
195 (global-set-key (ps-s-prsc) 'ps-spool-region-with-faces) 190 (global-set-key [(shift f22)] 'ps-spool-region-with-faces)
196 (global-set-key (ps-c-prsc) 'ps-despool) 191 (global-set-key [(control f22)] 'ps-despool)
197 (add-hook 'gnus-article-prepare-hook 'ps-gnus-article-prepare-hook) 192 (add-hook 'gnus-article-prepare-hook 'ps-gnus-article-prepare-hook)
198 (add-hook 'gnus-summary-mode-hook 'ps-gnus-summary-setup) 193 (add-hook 'gnus-summary-mode-hook 'ps-gnus-summary-setup)
199 (add-hook 'vm-mode-hook 'ps-vm-mode-hook) 194 (add-hook 'vm-mode-hook 'ps-vm-mode-hook)