From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: how to use "if" in lisp Date: Sat, 17 Nov 2007 12:19:57 +1100 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87d4u94qiq.fsf@lion.rapttech.com.au> 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 1195263686 18415 80.91.229.12 (17 Nov 2007 01:41:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Nov 2007 01:41:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 17 02:41:30 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 1ItCga-0003h2-Ao for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Nov 2007 02:41:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItCgN-0003nf-97 for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Nov 2007 20:41:15 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!news.glorb.com!sn-xt-sjc-04!sn-xt-sjc-06!sn-xt-sjc-01!sn-post-sjc-02!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:SMm6AMZVXCGUKEtIbv+bPcTwSaA= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 22 Original-Xref: shelby.stanford.edu gnu.emacs.help:153869 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:49298 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? > Can I suggest you let us know what it is you want to do as then we can possibly give you better alternative solutions. I'm guessing that what you are really looking for is how to make some elisp run when you enter a particular mode. If this is the case, what you are looking for is known in emacs as a 'hook'. Many modes provide various hooks that are run a certain times, such as wehn a mode is first loaded. Using hooks is one of the standard ways to customize a mode. Tim -- tcross (at) rapttech dot com dot au