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:37:54 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

jadamson@partners.org (Joel J. Adamson) writes:

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

Sorry, that isn't clear: you may need to specify the buffer with
(current-buffer) or otherwise make sure you are dealing with the current
buffer, and to ensure that your function does not affect other buffers.

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]