From: Eric Hanchrow <offby1@blarg.net>
Subject: Re: What's wrong with this lisp code in my init file?!
Date: Sun, 31 Dec 2006 13:51:25 -0800 [thread overview]
Message-ID: <87r6ufwx7m.fsf@offby1.atm01.sea.blarg.net> (raw)
In-Reply-To: 1167595028.481477.63360@42g2000cwt.googlegroups.com
>>>>> "Endless" == Endless Story <usable.thought@gmail.com> 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
next prev parent reply other threads:[~2006-12-31 21:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-31 16:15 What's wrong with this lisp code in my init file?! Endless Story
2006-12-31 18:48 ` Eric Hanchrow
[not found] ` <mailman.2592.1167591202.2155.help-gnu-emacs@gnu.org>
2006-12-31 19:57 ` Endless Story
2006-12-31 21:51 ` Eric Hanchrow [this message]
2006-12-31 22:29 ` Drew Adams
[not found] ` <mailman.2595.1167601997.2155.help-gnu-emacs@gnu.org>
2006-12-31 22:16 ` Harald Hanche-Olsen
2006-12-31 22:50 ` Drew Adams
[not found] ` <mailman.2599.1167605423.2155.help-gnu-emacs@gnu.org>
2007-01-01 1:48 ` Endless Story
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r6ufwx7m.fsf@offby1.atm01.sea.blarg.net \
--to=offby1@blarg.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).