unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Harald Hanche-Olsen <hanche@math.ntnu.no>
Subject: Re: What's wrong with this lisp code in my init file?!
Date: Sun, 31 Dec 2006 23:16:44 +0100	[thread overview]
Message-ID: <pcolkknyalv.fsf@shuttle.math.ntnu.no> (raw)
In-Reply-To: mailman.2595.1167601997.2155.help-gnu-emacs@gnu.org

+ 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

  parent reply	other threads:[~2006-12-31 22:16 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
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 [this message]
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=pcolkknyalv.fsf@shuttle.math.ntnu.no \
    --to=hanche@math.ntnu.no \
    /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).