From xemacs-m  Tue Feb  4 11:54:39 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id LAA06688
	for <xemacs-beta@xemacs.org>; Tue, 4 Feb 1997 11:54:38 -0600 (CST)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id KAA13981;
	Tue, 4 Feb 1997 10:05:48 -0800
To: xemacs-beta@xemacs.org
Subject: Re: Updates to print menu under Options
References: <9702041732.AA00572@dtas0b.cegelec-red.fr>
X-Url: http://www.miranova.com/%7Esteve/
Mail-Copies-To: never
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
In-Reply-To: duthen@cegelec-red.fr's message of Tue, 4 Feb 97 18:32:43 +0100
Mime-Version: 1.0 (generated by tm-edit 7.101)
Content-Type: text/plain; charset=US-ASCII
Date: 04 Feb 1997 10:05:48 -0800
Message-ID: <m2enew1m6b.fsf@altair.xemacs.org>
Lines: 50
X-Mailer: Gnus v5.4.11/XEmacs 20.0

Jacques Duthen Prestataire writes:

heiko> I've already such a menu, which is build from an
heiko> alist. I've added the code at the end of this mail. Note:
heiko> This is a part of a file which I'm using to install a
heiko> menu with other usefull entries. Therefore I'm not sure,
heiko> if this part is working without the rest of the file. But
heiko> I'll send the whole file if there's any interest. I'm
heiko> also able to develope a patch, if Steven want's to
heiko> integrate it in the Options menu.

heiko> Any interest?

You're better off using dynamic evaluation of ps-lpr-switches as
Jacques describes.

heiko> [code snipped]

> Well.  I'm really sorry if you wasted your time!  The last
> version of ps-print.el (should be 3.05 for XEmacs) now evaluates
> dynamically the ps-lpr-switches.  This is a patch from Steven L
> Baur <steve@miranova.com> from whom you can get it.  

> So now you just need to do something like this:

> (setq hm-current-ps-printer "schiller") ; default printer

> (setq ps-lpr-switches '("-P " hm-current-ps-printer))
                             ^

The extra blank might be bad, this probably should be "-P".

> and only change the contents of `hm-current-ps-printer' from the
> menu:

> (defun hm-select-new-ps-printer (printer)
>   "Selects and sets a new ps printer."
>   (interactive (list (completing-read "Name of the printer: "
> 				      hm-ps-printer-alist
> 				      nil
> 				      nil
> 				      hm-current-ps-printer)))
>   (setq hm-current-ps-printer printer))

> Ok?							[jack]

Yup.  The same technique works in lpr.el for lpr-switches.
-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

