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: Sebastian Tennant
Subject: Re: how to use "if" in lisp
Date: Thu, 15 Nov 2007 21:32:52 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

>>> (if (_the major mode is something_)
>>>     (some function)
>>>     (another funcion))
>>>
>>> But I don't know how to write down the condition. 

This works when evaluated in the scratch buffer:

  (if (equal major-mode 'lisp-interaction-mode)
      (message "yup")
    (message "nope"))

And you could wrap it in a:

 (with-current-buffer STRING-OR-FUNCTION-THAT-RETURNS-A-BUFFER-OR-BUFFER-NAME)

form if you like?

Sebastian





reply via email to

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