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 10:48:48 -0800 Message-ID: <87vejrx5nz.fsf@offby1.atm01.sea.blarg.net> References: <1167581737.951769.216970@k21g2000cwa.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1167591226 29940 80.91.229.12 (31 Dec 2006 18:53:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 31 Dec 2006 18:53:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 31 19:53:45 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 1H15oO-0005t4-LE for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Dec 2006 19:53:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H15oO-0001by-7m for geh-help-gnu-emacs@m.gmane.org; Sun, 31 Dec 2006 13:53:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H15o9-0001bp-2n for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 13:53:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H15o5-0001ab-JV for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 13:53:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H15o5-0001aW-Fm for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 13:53:17 -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 1H15o4-0000j1-Ty for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 13:53:17 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1H15nw-0002Qn-Pz for help-gnu-emacs@gnu.org; Sun, 31 Dec 2006 19:53:08 +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 19:53:08 +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 19:53:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 27 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:TOvvs4poNHZackcgDepaOK4/6u8= 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:40051 Archived-At: Try this instead: (setq printer-name "//BREATH-000/Randy's HP 1200") (setq ps-printer-name t) ;; must set printer name before issuing print command! (setq ps-lpr-command (if (eq window-system 'w32) "c:/Program Files/Ghostgum/gsview/gsprint.exe" "/cygdrive/c/Program Files/Ghostgum/gsview/gsprint.exe")) If that works, as I expect it will, your problem was that you've got two clauses in your second "if" statement. Clearly you're expecting them to both get evaluated when window-system is nil. But because of the way "if" works, only the first gets evaluated; the second gets evaluated only when window-system is _not_ nil. If you had used Emacs' lisp indentation on your code, you might have noticed this yourself, since it will show the two clauses indented different amounts. -- ハ ハ ミ^・^ミ `~~~´