From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Should `cancel-timer' use `delete' instead of `delq'? Date: Wed, 06 Sep 2006 08:38:02 +0200 Message-ID: <85d5a9ijp1.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1157526124 20972 80.91.229.2 (6 Sep 2006 07:02:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Sep 2006 07:02:04 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 06 09:02:02 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GKrQ4-0003te-ES for ged-emacs-devel@m.gmane.org; Wed, 06 Sep 2006 09:01:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKrQ3-0007dm-Ud for ged-emacs-devel@m.gmane.org; Wed, 06 Sep 2006 03:01:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GKrPs-0007bl-Dl for emacs-devel@gnu.org; Wed, 06 Sep 2006 03:01:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GKrPr-0007Zm-7F for emacs-devel@gnu.org; Wed, 06 Sep 2006 03:01:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GKrPq-0007ZU-8R for emacs-devel@gnu.org; Wed, 06 Sep 2006 03:01:42 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GKrPv-0001Cz-SB for emacs-devel@gnu.org; Wed, 06 Sep 2006 03:01:48 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1GKrPm-0007KY-E3; Wed, 06 Sep 2006 03:01:40 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 8F3401C4D3A4; Wed, 6 Sep 2006 08:38:02 +0200 (CEST) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Tue, 5 Sep 2006 19:09:11 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59413 Archived-At: "Drew Adams" writes: > > To repeat my question: Is it a good idea to either document > > the "traditional" `define-minor-mode' approach or define a new > > macro for this, or should we just let people discover this on > > their own? > > I think the macro is inappropriate; the problem generally > doesn't occur in typical "define" contexts (for instance your > defvar "protection" will never get executed, because of the way > defvar works). > > I was able to be bitten by it, using C-M-x on the defvar. And the > general point applies to setq as well. I don't think we need to worry about what damage a user might to manually. I really don't see this as a valid reason to stop multiple timers from working. > How many of them will be bit by this? Who knows? Why not help them > avoid it? We can't avoid people shooting themselves in the foot. We might add some command for killing timers in an emergency if really necessary. > we don't explicitly warn people about each of them because we > assume than programmers know how to handle this sort of thing in > general. > > You assume too much, I think. > > If I defvar or setq toto to (cons 1 2)), and I make no other > assignments or bindings to that cons cell, and then I setq toto to > (cons 3 4), should I assume that the first cons cell is still around > causing mischief? Maybe, for a while. A cons is not an active object. You'll not notice the difference of it being around or not if it is not referenced. An active timer _is_ referenced. > I think that one natural, if erroneous, expectation is that the > orphan timer will naturally go by the wayside at some point, and > need not be thought much about. I don't see any such expectation as natural. > There are other, just as natural, expectations that would be more > correct, but that expectation is a possible and reasonable one: > don't worry about that zombie timer; An active timer is not a zombie. Really. > it's history; it may be toast already. A timer stopping to work of his own volition is a bug. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum