From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teng Wang Newsgroups: gmane.emacs.help Subject: Re: how to use "if" in lisp Date: Fri, 16 Nov 2007 22:56:55 -0600 Message-ID: <87ir41jwq0.fsf@supermath.math.umn> References: <878x4zfkwv.fsf@supermath.math.umn> <87y7czgy3r.fsf@W0053328.mgh.harvard.edu> <87lk8zgxrx.fsf@W0053328.mgh.harvard.edu> <874pfnfhwu.fsf@supermath.math.umn> <87d4u94qiq.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195278088 12814 80.91.229.12 (17 Nov 2007 05:41:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Nov 2007 05:41:28 +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 06: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 1ItGQo-0004f0-Ec for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Nov 2007 06:41:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItGQb-0003HO-IL for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Nov 2007 00:41:13 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Fri, 16 Nov 2007 22:57:04 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:/juvO1BAv2zLsHLaqUEINuekAhY= Original-Lines: 35 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 75.72.169.121 Original-X-Trace: sv3-ZOsoaMKVSNVOVlmb7FbFuPQcxpu1jdt1dRPJc/qcZ06Fb2y4jtDDgqdKOn4VACRSvuTXJggCxdVfNFi!cXtBLTzqH5SNBpOX4ae3DLjpJ/LR2Srk7xiGCTCnqheOt3xvdhm3gI1tkXgnLsK+27FvJE5LDBsy!wDbYKQuXuObHkB4= Original-X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.35 Original-Xref: shelby.stanford.edu gnu.emacs.help:153871 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:49300 Archived-At: Tim X writes: > 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. Yes, I just want to run some function to particular mode, for example: run abbrev-mode when entering LaTeX-mode. And yesterday I read the manual again and I found there is LaTeX-mode-hook variable. So now, I am happy. But Thank you all the same. > > Tim Best, ---- Teng