From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harald Hanche-Olsen Newsgroups: gmane.emacs.help Subject: Re: the hand that feeds you Date: Fri, 28 Jul 2006 11:12:12 +0200 Organization: Norwegian university of science and technology Message-ID: References: <1154035859.849298@elch.in-berlin.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1154079668 28734 80.91.229.2 (28 Jul 2006 09:41:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Jul 2006 09:41:08 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 28 11:41:07 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G6Opu-0007hx-2r for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jul 2006 11:40:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G6Opt-0000aa-H1 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Jul 2006 05:40:49 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.swip.net!swipnet!newsfeed1.funet.fi!newsfeeds.funet.fi!uio.no!ntnu.no!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: fiinbeck.math.ntnu.no Original-X-Trace: orkan.itea.ntnu.no 1154077730 18822 129.241.15.140 (28 Jul 2006 09:08:50 GMT) Original-X-Complaints-To: usenet@itea.ntnu.no Original-NNTP-Posting-Date: Fri, 28 Jul 2006 09:08:50 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (berkeley-unix) Cancel-Lock: sha1:MbYEWi1qKWCbS1GEQvoAjDna/kA= Original-Xref: shelby.stanford.edu gnu.emacs.help:140698 Original-To: help-gnu-emacs@gnu.org 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:36327 Archived-At: + Kevin Rodgers : | Harald Hanche-Olsen wrote: |> (defun kill-myself () |> (insert "only once") |> (defun kill-myself ())) | | That is just as dependent on the implementation of defun as the original | is on the implementation of run-hooks and remove-hooks, isn't it? Er, no, it is only dependent on the specification of defun. Notably, that the inner defun does not define a local function, as it might in some lisp dialects (but not elisp). | BTW, this is truly suicidal: | | (defun kill-myself () | (insert "only once") | (unintern 'kill-myself)) Not suicidal at all. The uninterned symbol remains in the hook, and its function definition will get called. | But maybe (fmakunbound 'kill-myself) or | (fset 'kill-myself (symbol-function 'ignore)) is good enough. :-) That will cause run-hooks to fail on the second try. -- * Harald Hanche-Olsen - It is undesirable to believe a proposition when there is no ground whatsoever for supposing it is true. -- Bertrand Russell