From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jadamson@partners.org (Joel J. Adamson) Newsgroups: gmane.emacs.help Subject: Re: how to use "if" in lisp Date: Fri, 16 Nov 2007 09:35:41 -0500 Organization: I need to put my ORGANIZATION here. Message-ID: <87k5oigsw2.fsf@W0053328.mgh.harvard.edu> References: <878x4zfkwv.fsf@supermath.math.umn> <87y7czgy3r.fsf@W0053328.mgh.harvard.edu> <87lk8zgxrx.fsf@W0053328.mgh.harvard.edu> <874pfnfhwu.fsf@supermath.math.umn> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195224082 19260 80.91.229.12 (16 Nov 2007 14:41:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Nov 2007 14:41:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 16 15:41:23 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1It2NM-0005NR-6z for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Nov 2007 15:40:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1It2N9-0004GU-4n for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Nov 2007 09:40:43 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elk.ncren.net!news.purdue.edu!purdue!news.harvard.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: w0053328.mgh.harvard.edu Original-X-Trace: plato.harvard.edu 1195223741 9716 132.183.29.121 (16 Nov 2007 14:35:41 GMT) Original-X-Complaints-To: news@plato.harvard.edu Original-NNTP-Posting-Date: Fri, 16 Nov 2007 14:35:41 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:ZiM+SYGTOovhXA67H8EWhtD+4iY= Original-Xref: shelby.stanford.edu gnu.emacs.help:153857 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49284 Archived-At: Teng Wang 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