help-emacs-windows
[Top][All Lists]
Advanced

[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:52:13 -0400

I changed the fourth argument to non-nil, so the value returned wasn't a string, but a lisp object, and that worked:
 
(defun jbr-ps-print-n-up-hook ()
  (let ((number-of-pages
  (read-from-minibuffer
   "N-up number of pages: " "1" nil t 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)
I'm assuming that based on the following operation (the setq), the interpreter cast the *generic* object type to the correct type?  Integer or numeric?

Jeff
 
----- 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.

Thanks,

-pd



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.
 
Thanks,
Jeff
----- 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
interactive.

Regard,
  David V.

--------
                             Peter Davis
               Funny stuff at http://www.pfdstudio.com
               "The artwork formerly shown as prints."
           Resources for children's writers & illustrators:
                  http://www.pfdstudio.com/cwrl.html










reply via email to

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