[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h-e-w] Adding to ps-print-hook problems

From: Jeff Rancier
Subject: Re: [h-e-w] Adding to ps-print-hook problems
Date: Mon, 16 Sep 2002 16:40:01 -0400

Sure.  Here's what I have so far:
(defun jbr-ps-print-n-up-hook ()
  (let ((number-of-pages
   "N-up number of pages: " "1" nil nil nil nil nil)))
    (if number-of-pages
 (setq ps-n-up-printing number-of-pages))))
(add-hook 'ps-print-hook 'jbr-ps-print-n-up-hook)
My only problem (or should I say question) is that I'm still searching for someway to do the data type conversion from a string to an integer or number.
----- Original Message -----
Sent: Monday, September 16, 2002 4:17 PM
Subject: Re: [h-e-w] Adding to ps-print-hook problems

When you get this working, will you share it with us?  I could use something like this also.



At 03:30 PM 9/16/2002, Jeff Rancier wrote:
Agreed.  I was calling ps-print-buffer-with-faces() interactively, and naively expecting somehow to have the hook called interactively.  Kevin Rodgers pointed out that a piece of advised code, here would be the correct way to implement this.
----- Original Message -----
From: David Vanderschel
To: address@hidden
Sent: Monday, September 16, 2002 3:20 PM
Subject: Re: [h-e-w] Adding to ps-print-hook problems

On Monday, September 16, "Jeff Rancier" <address@hidden> wrote:
>Hi all.  I wanted to create a simple function to prompt me for the n-up
>number of pages to print when I run the function,
>ps-print-buffer-with-faces.  Here's what I came up with:

>(defun jbr-ps-print-n-up-hook (number-of-pages)
>  (interactive "nN-up number of pages: ")
>  (setq ps-n-up-printing number-of-pages))

>(add-hook 'ps-print-hook 'jbr-ps-print-n-up-hook)

I think the problem is that you are _not_ invoking it
interactively, so the interaction does not work right.
I'd suggest dropping the call to "interactive", using
the "message" function for the prompt, and explicitly
reading input.  You could also write your own function
to substitute for (whichever) ps-print and it could be

  David V.

                             Peter Davis
               Funny stuff at
               "The artwork formerly shown as prints."
           Resources for children's writers & illustrators:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]