all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter S Galbraith <p.galbraith@globetrotter.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: multi-line conditionals in elisp
Date: Sun, 22 Dec 2002 14:21:15 -0500	[thread overview]
Message-ID: <20021222192115.A5245429E2@mixed.dyndns.org> (raw)
In-Reply-To: Message from Michael Powe <michael+gnus@trollope.org>  of "Sun, 22 Dec 2002 19:00:43 GMT." <ulm2hc1zw.fsf@trollope.org>

Michael Powe <michael+gnus@trollope.org> wrote:

> this is trivial in other languages, but not, it seems, in elisp.  (i
> think it's just a case of, i don't really understand the language.)

The latter.

> (if (locate-library "python-mode")
>     (cond((autoload 'python-mode "python-mode" "Python editing mode" t)
> 	  (setq auto-mode-alist
> 		(cons '("\\.py$" . python-mode) auto-mode-alist))))
>   (message "python library not found"))

(if (locate-library "python-mode")
    (progn
      (autoload 'python-mode "python-mode" "Python editing mode" t)
      (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)))
  (message "python library not found"))

or

(if (not (locate-library "python-mode"))
    (message "python library not found")
  (autoload 'python-mode "python-mode" "Python editing mode" t)
  (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)))

or forget the message:

(when (locate-library "python-mode")
  (autoload 'python-mode "python-mode" "Python editing mode" t)
  (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)))

Peter

  parent reply	other threads:[~2002-12-22 19:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-22 19:00 multi-line conditionals in elisp Michael Powe
2002-12-22 19:12 ` David Kastrup
2002-12-22 22:48   ` Michael Powe
2002-12-22 23:05     ` David Kastrup
2002-12-24  3:17       ` Jesper Harder
     [not found] ` <michael+gnus@trollope.org>
2002-12-22 19:21   ` Peter S Galbraith [this message]
     [not found] ` <mailman.524.1040584903.19936.help-gnu-emacs@gnu.org>
2002-12-22 22:40   ` Michael Powe

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021222192115.A5245429E2@mixed.dyndns.org \
    --to=p.galbraith@globetrotter.net \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.