Michael Harnois <mdharnois(a)home.com> writes:
It appears here that there is another problem, ps-mule.el uses a
function "chars-in-region" which is not found:
(let ((run-width (* (chars-in-region from to) char-width))
I think Nick mentiond that it should be just (- to from).
Here's my version slightly differs from Nick's. I didn't
give very close look so I would be grateful if it could be
merged to Nick's version.
diff -ur tmp/lisp/ps-print/ps-mule.el
/home/penny/.xemacs/xemacs-packages/lisp/ps-print/ps-mule.el
--- tmp/lisp/ps-print/ps-mule.el Tue Aug 1 23:17:28 2000
+++ /home/penny/.xemacs/xemacs-packages/lisp/ps-print/ps-mule.el Thu Nov 30 21:54:31 2000
@@ -143,8 +143,9 @@
;; For Emacs 20.2 and the earlier version.
(eval-and-compile
- (if (and (boundp 'mule-version) ; only if mule package is loaded
- (not (string< mule-version "4.0")))
+ (if (or (and (boundp 'mule-version) ; only if mule package is loaded
+ (not (string< mule-version "4.0")))
+ (featurep 'xemacs))
(progn
(defalias 'ps-mule-next-point '1+)
(defalias 'ps-mule-chars-in-string 'length)
@@ -687,7 +688,9 @@
(cons (ps-mule-next-point from) run-width)))
;; We assume that all characters in this range have the same width.
(setq char-width (* char-width (charset-width ps-mule-current-charset)))
- (let ((run-width (* (chars-in-region from to) char-width)))
+ (let ((run-width (* (if (fboundp 'chars-in-region)
+ (chars-in-region from to)
+ (abs (- to from)) char-width))))
(if (> run-width ps-width-remaining)
(cons (min to
(save-excursion
@@ -1143,8 +1146,9 @@
ps-mule-font-info-database-ps-bdf)
(t
ps-mule-font-info-database-default)))
- (and (boundp 'enable-multibyte-characters)
- enable-multibyte-characters
+
+ (and (or (featurep 'xemacs) (and (boundp 'enable-multibyte-characters)
+ enable-multibyte-characters))
;; Initialize `ps-mule-charset-list'. If some characters aren't
;; printable, warn it.
(let ((charsets (find-charset-region from to)))
@@ -1206,10 +1210,16 @@
(cond ((eq ps-print-control-characters '8-bit)
"[^\040-\176]")
((eq ps-print-control-characters 'control-8-bit)
- (string-as-multibyte "[^\040-\176\240-\377]"))
+ (if (featurep 'xemacs)
+ "[^\040-\176\240-\377]"
+ (string-as-multibyte "[^\040-\176\240-\377]")))
((eq ps-print-control-characters 'control)
- (string-as-multibyte "[^\040-\176\200-\377]"))
- (t (string-as-multibyte "[^\000-\011\013\015-\377"))))))
+ (if (featurep 'xemacs)
+ "[^\040-\176\200-\377]"
+ (string-as-multibyte "[^\040-\176\200-\377]")))
+ (t (if (featurep 'xemacs)
+ "[^\000-\011\013\015-\377]"
+ (string-as-multibyte "[^\000-\011\013\015-\377]")))))))
;;;###autoload
(defun ps-mule-begin-page ()
Only in /home/penny/.xemacs/xemacs-packages/lisp/ps-print/: ps-mule.el~
diff -ur tmp/lisp/ps-print/ps-print.el
/home/penny/.xemacs/xemacs-packages/lisp/ps-print/ps-print.el
--- tmp/lisp/ps-print/ps-print.el Thu Nov 30 04:36:32 2000
+++ /home/penny/.xemacs/xemacs-packages/lisp/ps-print/ps-print.el Thu Nov 30 21:59:09
2000
@@ -1333,13 +1333,16 @@
;; For Emacs 20.2 and the earlier version.
(or (fboundp 'set-buffer-multibyte)
+ (featurep 'xemacs)
(defun set-buffer-multibyte (arg)
(setq enable-multibyte-characters arg)))
(or (fboundp 'string-as-unibyte)
+ (featurep 'xemacs)
(defun string-as-unibyte (arg) arg))
(or (fboundp 'string-as-multibyte)
+ (featurep 'xemacs)
(defun string-as-multibyte (arg) arg))
(or (fboundp 'char-charset)
@@ -3793,7 +3796,9 @@
(defun ps-output-string-prim (string)
(insert "(") ;insert start-string delimiter
(save-excursion ;insert string
- (insert (string-as-unibyte string)))
+ (insert (if (featurep 'xemacs)
+ (decode-coding-string string 'binary)
+ (string-as-unibyte string))))
;; Find and quote special characters as necessary for PS
;; This skips everything except control chars, non-ASCII chars, (, ) and \.
(while (progn (skip-chars-forward " -'*-[]-~") (not (eobp)))
@@ -5464,7 +5469,8 @@
(unwind-protect
(progn
(set-buffer ps-spool-buffer)
- (set-buffer-multibyte nil)
+ (or (featurep 'xemacs)
+ (set-buffer-multibyte nil))
;; Get a marker and make it point to the current end of the
;; buffer, If an error occurs, we'll delete everything from
Only in /home/penny/.xemacs/xemacs-packages/lisp/ps-print/: ps-print.el~
--
Yoshiki Hayashi