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: Fri, 16 Nov 2007 09:35:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

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

> Thank you for your help.
>
> I think about it for a while. I think my design is sort of
> nonsense. Since .emacs only be loaded once when start up. When I
> change the buffer, it cannot run again.
>
> So now, I am wondering: is there any way to make it run on fly?

(defun this-be-a-function ()
  (interactive)
  (message "This be an interactive function"))

The "(interactive)" in the second line makes it callable by name,
i.e. "M-x this-be-a-function" prints "This be an interactive function"
in the minibuffer.

The Introduction to Emacs Lisp and Elisp manuals are really helpful, and
easy to read.

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]