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

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

Re: how to use "if" in lisp


From: Joel J. Adamson
Subject: Re: how to use "if" in lisp
Date: Thu, 15 Nov 2007 13:30:48 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Teng Wang <twang.umn@gmail.com> writes:

> Hi there,
>
> I just began to learn lisp a couple of weeks ago. It is easy to use,
> but sometimes it is really hard to know what variables are in
> lisp. And today I want to write a code doing the function as below:
>
> (if (_the major mode is something_)
>     (some function)
>     (another funcion))
>
> But I don't know how to write down the condition. 

Since major-mode is local to a buffer, your function should be local to
the buffer.

(symbol-value 'major-mode)

gets the major mode, but there may be a simpler way (i.e. a function
specifically for that).  Read up on symbols and plists.

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109


reply via email to

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