aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-02-16 16:11:05 +0000
committerStefan Monnier2007-02-16 16:11:05 +0000
commitcf04718a317cbe9b06b96767735f1384bbb010b8 (patch)
tree3eb73d9046e07fbc6f5dd4e56093cd3fdd34caf3
parent52b2c096e47f418f90151c389fc48e7eba0d44fd (diff)
downloademacs-cf04718a317cbe9b06b96767735f1384bbb010b8.tar.gz
emacs-cf04718a317cbe9b06b96767735f1384bbb010b8.zip
Use (defvar <foo>) where applicable.
(ps-print-emacs-type): Remove. (ps-x-frame-property, ps-e-frame-parameter): Remove. (ps-frame-parameter): Align its call-convention with frame-parameter. (ps-begin-job): Adjust calls to it appropriately. (ps-setup): Don't print ps-print-emacs-type. (ps-e-find-composition, ps-mark-active-p, ps-color-device): Define in such a way that it's obvious that it's defined. (ps-prsc, ps-c-prsc, ps-s-prsc): Remove. (ps-rmail-mode-hook, ps-vm-mode-hook, ps-gnus-summary-setup) (ps-jts-ps-setup): Use flavor-neutral syntax instead.
-rw-r--r--lisp/ChangeLog17
-rw-r--r--lisp/ps-print.el119
2 files changed, 69 insertions, 67 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 140df492ea0..281cdd624a9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12007-02-16 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * ps-print.el: Use (defvar <foo>) where applicable.
4 (ps-print-emacs-type): Remove.
5 (ps-x-frame-property, ps-e-frame-parameter): Remove.
6 (ps-frame-parameter): Align its call-convention with frame-parameter.
7 (ps-begin-job): Adjust calls to it appropriately.
8 (ps-setup): Don't print ps-print-emacs-type.
9 (ps-e-find-composition, ps-mark-active-p, ps-color-device):
10 Define in such a way that it's obvious that it's defined.
11 (ps-prsc, ps-c-prsc, ps-s-prsc): Remove.
12 (ps-rmail-mode-hook, ps-vm-mode-hook, ps-gnus-summary-setup)
13 (ps-jts-ps-setup): Use flavor-neutral syntax instead.
14
12007-02-15 Alan Mackenzie <acm@muc.de> 152007-02-15 Alan Mackenzie <acm@muc.de>
2 16
3 * progmodes/cc-cmds.el (c-indent-new-comment-line): When splitting 17 * progmodes/cc-cmds.el (c-indent-new-comment-line): When splitting
@@ -9,8 +23,7 @@
9 (isearch-lazy-highlight-new-loop): Bind it. 23 (isearch-lazy-highlight-new-loop): Bind it.
10 (isearch-lazy-highlight-search): Use it. 24 (isearch-lazy-highlight-search): Use it.
11 25
12 * replace.el (replace-highlight): Bind search-whitespace-regexp to 26 * replace.el (replace-highlight): Bind search-whitespace-regexp to nil.
13 nil.
14 27
152007-02-15 Stefan Monnier <monnier@iro.umontreal.ca> 282007-02-15 Stefan Monnier <monnier@iro.umontreal.ca>
16 29
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 7a9263b0ea8..751dd0fd9df 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -1448,19 +1448,16 @@ Please send all bug fixes and enhancements to
1448(or (featurep 'lisp-float-type) 1448(or (featurep 'lisp-float-type)
1449 (error "`ps-print' requires floating point support")) 1449 (error "`ps-print' requires floating point support"))
1450 1450
1451 1451(let ((case-fold-search t))
1452(defvar ps-print-emacs-type 1452 (cond ((string-match "XEmacs" emacs-version))
1453 (let ((case-fold-search t)) 1453 ((string-match "Lucid" emacs-version)
1454 (cond ((string-match "XEmacs" emacs-version) 'xemacs) 1454 (error "`ps-print' doesn't support Lucid"))
1455 ((string-match "Lucid" emacs-version) 1455 ((string-match "Epoch" emacs-version)
1456 (error "`ps-print' doesn't support Lucid")) 1456 (error "`ps-print' doesn't support Epoch"))
1457 ((string-match "Epoch" emacs-version) 1457 (t
1458 (error "`ps-print' doesn't support Epoch")) 1458 (unless (and (boundp 'emacs-major-version)
1459 (t 1459 (>= emacs-major-version 22))
1460 (unless (and (boundp 'emacs-major-version) 1460 (error "`ps-print' only supports Emacs 22 and higher")))))
1461 (>= emacs-major-version 22))
1462 (error "`ps-print' only supports Emacs 22 and higher"))
1463 'emacs))))
1464 1461
1465 1462
1466;; GNU Emacs 1463;; GNU Emacs
@@ -1490,7 +1487,6 @@ Please send all bug fixes and enhancements to
1490(defalias 'ps-x-font-instance-properties 'font-instance-properties) 1487(defalias 'ps-x-font-instance-properties 'font-instance-properties)
1491(defalias 'ps-x-make-color-instance 'make-color-instance) 1488(defalias 'ps-x-make-color-instance 'make-color-instance)
1492(defalias 'ps-x-map-extents 'map-extents) 1489(defalias 'ps-x-map-extents 'map-extents)
1493(defalias 'ps-x-frame-property 'frame-property)
1494 1490
1495;; GNU Emacs 1491;; GNU Emacs
1496(defalias 'ps-e-face-bold-p 'face-bold-p) 1492(defalias 'ps-e-face-bold-p 'face-bold-p)
@@ -1501,10 +1497,9 @@ Please send all bug fixes and enhancements to
1501(defalias 'ps-e-overlay-end 'overlay-end) 1497(defalias 'ps-e-overlay-end 'overlay-end)
1502(defalias 'ps-e-x-color-values 'x-color-values) 1498(defalias 'ps-e-x-color-values 'x-color-values)
1503(defalias 'ps-e-color-values 'color-values) 1499(defalias 'ps-e-color-values 'color-values)
1504(defalias 'ps-e-frame-parameter 'frame-parameter) 1500(defalias 'ps-e-find-composition (if (fboundp 'find-composition)
1505(if (fboundp 'find-composition) 1501 'find-composition
1506 (defalias 'ps-e-find-composition 'find-composition) 1502 'ignore))
1507 (defalias 'ps-e-find-composition 'ignore))
1508 1503
1509 1504
1510(defconst ps-windows-system 1505(defconst ps-windows-system
@@ -1518,26 +1513,25 @@ Please send all bug fixes and enhancements to
1518 (ps-x-color-name color) 1513 (ps-x-color-name color)
1519 color)) 1514 color))
1520 1515
1516(defalias 'ps-frame-parameter
1517 (if (fboundp 'frame-parameter) 'frame-parameter 'frame-property))
1518(defalias 'ps-mark-active-p
1519 (if (fboundp 'region-active-p)
1520 'region-active-p ; XEmacs
1521 (defvar mark-active) ; To shup up XEmacs's byte compiler.
1522 (lambda () mark-active))) ; Emacs
1521 1523
1522(cond ((featurep 'xemacs) ; xemacs 1524(cond ((featurep 'xemacs) ; XEmacs
1523 (defalias 'ps-mark-active-p 'region-active-p)
1524 (defun ps-face-foreground-name (face) 1525 (defun ps-face-foreground-name (face)
1525 (ps-xemacs-color-name (face-foreground face))) 1526 (ps-xemacs-color-name (face-foreground face)))
1526 (defun ps-face-background-name (face) 1527 (defun ps-face-background-name (face)
1527 (ps-xemacs-color-name (face-background face))) 1528 (ps-xemacs-color-name (face-background face)))
1528 (defun ps-frame-parameter (param)
1529 (ps-x-frame-property nil param))
1530 ) 1529 )
1531 (t ; emacs 22 or higher 1530 (t ; Emacs 22 or higher
1532 (defvar mark-active nil)
1533 (defun ps-mark-active-p ()
1534 mark-active)
1535 (defun ps-face-foreground-name (face) 1531 (defun ps-face-foreground-name (face)
1536 (face-foreground face nil t)) 1532 (face-foreground face nil t))
1537 (defun ps-face-background-name (face) 1533 (defun ps-face-background-name (face)
1538 (face-background face nil t)) 1534 (face-background face nil t))
1539 (defun ps-frame-parameter (param)
1540 (ps-e-frame-parameter nil param))
1541 )) 1535 ))
1542 1536
1543 1537
@@ -3594,7 +3588,6 @@ The table depends on the current ps-print setup."
3594 (concat "\n;;; ps-print version " ps-print-version "\n") 3588 (concat "\n;;; ps-print version " ps-print-version "\n")
3595 ";; internal vars" 3589 ";; internal vars"
3596 (ps-comment-string "emacs-version " emacs-version) 3590 (ps-comment-string "emacs-version " emacs-version)
3597 (ps-comment-string "ps-print-emacs-type" ps-print-emacs-type)
3598 (ps-comment-string "ps-windows-system " ps-windows-system) 3591 (ps-comment-string "ps-windows-system " ps-windows-system)
3599 (ps-comment-string "ps-lp-system " ps-lp-system) 3592 (ps-comment-string "ps-lp-system " ps-lp-system)
3600 nil 3593 nil
@@ -3848,19 +3841,20 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'."
3848;; Return t if the device (which can be changed during an emacs session) 3841;; Return t if the device (which can be changed during an emacs session)
3849;; can handle colors. 3842;; can handle colors.
3850;; This function is not yet implemented for GNU emacs. 3843;; This function is not yet implemented for GNU emacs.
3851(cond ((and (featurep 'xemacs) 3844(defalias 'ps-color-device
3852 ;; XEmacs change: Need to check for emacs-major-version too. 3845 (cond ((and (featurep 'xemacs)
3853 (or (> emacs-major-version 19) 3846 ;; XEmacs change: Need to check for emacs-major-version too.
3854 (and (= emacs-major-version 19) 3847 (or (> emacs-major-version 19)
3855 (>= emacs-minor-version 12)))) ; xemacs >= 19.12 3848 (and (= emacs-major-version 19)
3856 (defun ps-color-device () 3849 (>= emacs-minor-version 12)))) ; XEmacs >= 19.12
3857 (eq (ps-x-device-class) 'color))) 3850 (lambda ()
3858 3851 (eq (ps-x-device-class) 'color)))
3859 (t ; emacs 3852
3860 (defun ps-color-device () 3853 (t ; Emacs
3861 (if (fboundp 'color-values) 3854 (lambda ()
3862 (ps-e-color-values "Green") 3855 (if (fboundp 'color-values)
3863 t)))) 3856 (ps-e-color-values "Green")
3857 t)))))
3864 3858
3865 3859
3866(defun ps-mapper (extent list) 3860(defun ps-mapper (extent list)
@@ -3883,12 +3877,12 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'."
3883 (case-fold-search t)) 3877 (case-fold-search t))
3884 (and kind-spec (string-match kind-regex kind-spec)))) 3878 (and kind-spec (string-match kind-regex kind-spec))))
3885 3879
3886(cond ((featurep 'xemacs) ; xemacs 3880(cond ((featurep 'xemacs) ; XEmacs
3887 3881
3888 ;; to avoid XEmacs compilation gripes 3882 ;; to avoid XEmacs compilation gripes
3889 (defvar coding-system-for-write nil) 3883 (defvar coding-system-for-write)
3890 (defvar coding-system-for-read nil) 3884 (defvar coding-system-for-read)
3891 (defvar buffer-file-coding-system nil) 3885 (defvar buffer-file-coding-system)
3892 3886
3893 (and (fboundp 'find-coding-system) 3887 (and (fboundp 'find-coding-system)
3894 (or (ps-x-find-coding-system 'raw-text-unix) 3888 (or (ps-x-find-coding-system 'raw-text-unix)
@@ -3918,7 +3912,7 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'."
3918 (memq face ps-italic-faces))) ; Kludge-compatible 3912 (memq face ps-italic-faces))) ; Kludge-compatible
3919 ) 3913 )
3920 3914
3921 (t ; emacs 3915 (t ; Emacs
3922 3916
3923 (defun ps-color-values (x-color) 3917 (defun ps-color-values (x-color)
3924 (cond 3918 (cond
@@ -4941,8 +4935,8 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th
4941;; XEmacs will have to make do with %s (princ) for floats. 4935;; XEmacs will have to make do with %s (princ) for floats.
4942 4936
4943(defvar ps-float-format (if (featurep 'xemacs) 4937(defvar ps-float-format (if (featurep 'xemacs)
4944 "%s " ; xemacs 4938 "%s " ; XEmacs
4945 "%0.3f ")) ; emacs 4939 "%0.3f ")) ; Emacs
4946 4940
4947 4941
4948(defun ps-float-format (value &optional default) 4942(defun ps-float-format (value &optional default)
@@ -5912,7 +5906,7 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5912 ((eq genfunc 'ps-generate-postscript) 5906 ((eq genfunc 'ps-generate-postscript)
5913 nil) 5907 nil)
5914 ((eq ps-default-bg 'frame-parameter) 5908 ((eq ps-default-bg 'frame-parameter)
5915 (ps-frame-parameter 'background-color)) 5909 (ps-frame-parameter nil 'background-color))
5916 ((eq ps-default-bg t) 5910 ((eq ps-default-bg t)
5917 (ps-face-background-name 'default)) 5911 (ps-face-background-name 'default))
5918 (t 5912 (t
@@ -5923,7 +5917,7 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5923 ((eq genfunc 'ps-generate-postscript) 5917 ((eq genfunc 'ps-generate-postscript)
5924 nil) 5918 nil)
5925 ((eq ps-default-fg 'frame-parameter) 5919 ((eq ps-default-fg 'frame-parameter)
5926 (ps-frame-parameter 'foreground-color)) 5920 (ps-frame-parameter nil 'foreground-color))
5927 ((eq ps-default-fg t) 5921 ((eq ps-default-fg t)
5928 (ps-face-foreground-name 'default)) 5922 (ps-face-foreground-name 'default))
5929 (t 5923 (t
@@ -6517,7 +6511,7 @@ If FACE is not a valid face name, use default face."
6517 (let ((face 'default) 6511 (let ((face 'default)
6518 (position to)) 6512 (position to))
6519 (cond 6513 (cond
6520 ((featurep 'xemacs) ; xemacs 6514 ((featurep 'xemacs) ; XEmacs
6521 ;; Build the list of extents... 6515 ;; Build the list of extents...
6522 (let ((a (cons 'dummy nil)) 6516 (let ((a (cons 'dummy nil))
6523 record type extent extent-list) 6517 record type extent extent-list)
@@ -6561,7 +6555,7 @@ If FACE is not a valid face name, use default face."
6561 from position 6555 from position
6562 a (cdr a))))) 6556 a (cdr a)))))
6563 6557
6564 (t ; emacs 6558 (t ; Emacs
6565 (let ((property-change from) 6559 (let ((property-change from)
6566 (overlay-change from) 6560 (overlay-change from)
6567 (save-buffer-invisibility-spec buffer-invisibility-spec) 6561 (save-buffer-invisibility-spec buffer-invisibility-spec)
@@ -6837,17 +6831,12 @@ If FACE is not a valid face name, use default face."
6837;; WARNING!!! The following code is *sample* code only. 6831;; WARNING!!! The following code is *sample* code only.
6838;; Don't use it unless you understand what it does! 6832;; Don't use it unless you understand what it does!
6839 6833
6840(defmacro ps-prsc () 6834;; The key `f22' should probably be replaced by `print'. --Stef
6841 `(if (featurep 'xemacs) 'f22 [f22]))
6842(defmacro ps-c-prsc ()
6843 `(if (featurep 'xemacs) '(control f22) [C-f22]))
6844(defmacro ps-s-prsc ()
6845 `(if (featurep 'xemacs) '(shift f22) [S-f22]))
6846 6835
6847;; A hook to bind to `rmail-mode-hook' to locally bind prsc and set the 6836;; A hook to bind to `rmail-mode-hook' to locally bind prsc and set the
6848;; `ps-left-headers' specially for mail messages. 6837;; `ps-left-headers' specially for mail messages.
6849(defun ps-rmail-mode-hook () 6838(defun ps-rmail-mode-hook ()
6850 (local-set-key (ps-prsc) 'ps-rmail-print-message-from-summary) 6839 (local-set-key [(f22)] 'ps-rmail-print-message-from-summary)
6851 (setq ps-header-lines 3 6840 (setq ps-header-lines 3
6852 ps-left-header 6841 ps-left-header
6853 ;; The left headers will display the message's subject, its 6842 ;; The left headers will display the message's subject, its
@@ -6921,7 +6910,7 @@ If FACE is not a valid face name, use default face."
6921;; A hook to bind to `vm-mode-hook' to locally bind prsc and set the 6910;; A hook to bind to `vm-mode-hook' to locally bind prsc and set the
6922;; `ps-left-headers' specially for mail messages. 6911;; `ps-left-headers' specially for mail messages.
6923(defun ps-vm-mode-hook () 6912(defun ps-vm-mode-hook ()
6924 (local-set-key (ps-prsc) 'ps-vm-print-message-from-summary) 6913 (local-set-key [(f22)] 'ps-vm-print-message-from-summary)
6925 (setq ps-header-lines 3 6914 (setq ps-header-lines 3
6926 ps-left-header 6915 ps-left-header
6927 ;; The left headers will display the message's subject, its 6916 ;; The left headers will display the message's subject, its
@@ -6947,7 +6936,7 @@ If FACE is not a valid face name, use default face."
6947;; A hook to bind to bind to `gnus-summary-setup-buffer' to locally bind 6936;; A hook to bind to bind to `gnus-summary-setup-buffer' to locally bind
6948;; prsc. 6937;; prsc.
6949(defun ps-gnus-summary-setup () 6938(defun ps-gnus-summary-setup ()
6950 (local-set-key (ps-prsc) 'ps-gnus-print-article-from-summary)) 6939 (local-set-key [(f22)] 'ps-gnus-print-article-from-summary))
6951 6940
6952;; Look in an article or mail message for the Subject: line. To be 6941;; Look in an article or mail message for the Subject: line. To be
6953;; placed in `ps-left-headers'. 6942;; placed in `ps-left-headers'.
@@ -6979,9 +6968,9 @@ If FACE is not a valid face name, use default face."
6979;; modification.) 6968;; modification.)
6980 6969
6981(defun ps-jts-ps-setup () 6970(defun ps-jts-ps-setup ()
6982 (global-set-key (ps-prsc) 'ps-spool-buffer-with-faces) ;f22 is prsc 6971 (global-set-key [(f22)] 'ps-spool-buffer-with-faces) ;f22 is prsc
6983 (global-set-key (ps-s-prsc) 'ps-spool-region-with-faces) 6972 (global-set-key [(shift f22)] 'ps-spool-region-with-faces)
6984 (global-set-key (ps-c-prsc) 'ps-despool) 6973 (global-set-key [(control f22)] 'ps-despool)
6985 (add-hook 'gnus-article-prepare-hook 'ps-gnus-article-prepare-hook) 6974 (add-hook 'gnus-article-prepare-hook 'ps-gnus-article-prepare-hook)
6986 (add-hook 'gnus-summary-mode-hook 'ps-gnus-summary-setup) 6975 (add-hook 'gnus-summary-mode-hook 'ps-gnus-summary-setup)
6987 (add-hook 'vm-mode-hook 'ps-vm-mode-hook) 6976 (add-hook 'vm-mode-hook 'ps-vm-mode-hook)