----- Original Message -----
Sent: Monday, September 16, 2002 8:06
Subject: RE: [h-e-w] Adding to
From: Jeff Rancier
Sent: Monday, September 16, 2002 4:52
To: address@hidden; David
Vanderschel; Peter Davis
Subject: Re: [h-e-w] Adding to ps-print-hook
I changed the fourth argument to non-nil, so the value
returned wasn't a
string, but a lisp object, and that worked:
"N-up number of pages: " "1" nil t nil
I'm assuming that based on the following
operation (the setq), the
interpreter cast the *generic* object type to the
correct type? Integer
You might consider using
'read-no-blanks-input' since no
spaces should be allowed in the number, and
(defun jbr-ps-print-n-up-hook ()
(read-no-blanks-input "N-up number of pages: "
According to ps-print.el:
;; The variable
`ps-n-up-printing' specifies the number of pages per
paper. The value specified must be between 1 and 100. The
;; NOTE: some PostScript printer may crash printing
;; set to a high value (for example, 23).
If this happens, set a lower
So, a more robust version
of the function would check to verify that
the value is greater than 0 and
less than 101. Or, it might be
to constrain the value
to be between 1 and 10, inclusive.
(read-no-blanks-input "N-up number of
pages: " "1")))
(if (integerp number-of-pages)
(if (and (>
number-of-pages 0) (< number-of-pages 11))
(print "Outside of valid range: 1 to 10"
(print "Not an integer"