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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's wrong with this lisp code in my init file?!


From: Eric Hanchrow
Subject: Re: What's wrong with this lisp code in my init file?!
Date: Sun, 31 Dec 2006 13:51:25 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

>>>>> "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





reply via email to

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