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: Harald Hanche-Olsen
Subject: Re: What's wrong with this lisp code in my init file?!
Date: Sun, 31 Dec 2006 23:16:44 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (berkeley-unix)

+ Eric Hanchrow <offby1@blarg.net>:

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

And of course, there is cond:

(cond
 ((eq window-system 'w32)
  (setq ps-printer-name t)
  (setq ps-lpr-command "c:/Program Files/Ghostgum/gsview/gsprint.exe"))
 ((eq window-system nil)
  (setq ps-printer-name t)
  (setq ps-lpr-command "/cygdrive/c/Program 
Files/Ghostgum/gsview/gsprint.exe")))

And then there are when and unless in the cl package:

(require 'cl)
(when (eq window-system 'w32)
  (setq ps-printer-name t)
  (setq ps-lpr-command "c:/Program Files/Ghostgum/gsview/gsprint.exe"))

(unless window-system
  (setq ps-printer-name t)
  (setq ps-lpr-command "/cygdrive/c/Program Files/Ghostgum/gsview/gsprint.exe"))

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


reply via email to

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