From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Hanchrow Newsgroups: gmane.emacs.help Subject: Re: What's wrong with this lisp code in my init file?! Date: Sun, 31 Dec 2006 13:51:25 -0800 Message-ID: <87r6ufwx7m.fsf@offby1.atm01.sea.blarg.net> References: <1167581737.951769.216970@k21g2000cwa.googlegroups.com> <1167595028.481477.63360@42g2000cwt.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1167602015 29733 80.91.229.12 (31 Dec 2006 21:53:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 31 Dec 2006 21:53:35 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 31 22:53:34 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H18cS-0001YZ-2y for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Dec 2006 22:53:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H18cR-0003dx-K6 for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Dec 2006 16:53:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H18cG-0003dW-LL for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 16:53:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H18cG-0003dI-4C for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 16:53:16 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H18cG-0003dC-0N for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 16:53:16 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H18cF-0007iL-HH for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 16:53:15 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1H18c9-0003vf-71 for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 22:53:09 +0100 Original-Received: from q-static-138-125.avvanta.com ([206.124.138.125]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Dec 2006 22:53:09 +0100 Original-Received: from offby1 by q-static-138-125.avvanta.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Dec 2006 22:53:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 48 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: q-static-138-125.avvanta.com User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) Cancel-Lock: sha1:Unc3UhSdJ67WEOL6kbF/e/Jft6Y= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40057 Archived-At: >>>>> "Endless" == Endless Story writes: Endless> So I've been trying to figure out how to package the two Endless> commands together within the if clause. Well, that's easy enough: (setq printer-name "//BREATH-000/Randy's HP 1200") ;; must set printer name before issuing print command! (if (eq window-system 'w32) (setq ps-printer-name t ps-lpr-command "c:/Program Files/Ghostgum/gsview/gsprint.exe") (setq ps-printer-name t ps-lpr-command "/cygdrive/c/Program Files/Ghostgum/gsview/gsprint.exe")) That's because "setq" lets you set any number of variables at once. But there's an even more general way to do more than one thing inside an "if": the "progn" form. It simply does a bunch of things one after the other: (if (furryp critter) ;; yup, furry (progn (pet critter) (comb-fur critter)) ;; no fur (progn (apply 'sunscreen critter) (search-for-tattoos critter))) :: And by the way -- I haven't checked to see if this is the case, but I suspect you can use "c:/Program Files/Ghostgum/gsview/gsprint.exe" for both Cygwin _and_ non-cygwin versions. Cygwin programs in general do the right thing with file names that start with a drive letter and colon. -- 'The energy capacity of batteries is increasing 5 percent to 8 percent annually, but demand is increasing exponentially,' Mr. Cooper said. -- New York Times