unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Drew Adams <drew.adams@oracle.com>, Emacs-Devel <emacs-devel@gnu.org>
Subject: Re: Should `cancel-timer' use `delete' instead of `delq'?
Date: Tue, 05 Sep 2006 11:38:50 -0400	[thread overview]
Message-ID: <jwvk64imimt.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87zmdfytmw.fsf@catnip.gol.com> (Miles Bader's message of "Tue, 05 Sep 2006 10:44:23 +0900")

> It's almost certainly intentional that it uses delq.  A timer is a
> unique entity.

> If application code can create multiple timers and doesn't save all the
> corresponding cookies for deletion, it's obviously a bug in that
> application code.

While I somewhat agree with Miles, I also agree with Drew that it can lead
to undesirable situations where it's very difficult to return to a "normal"
session, other than by restarting Emacs.

I've been tempted to change timer-idle-list and timer-list so that they use
weak-pointers.  I.e. if you don't hold on to your timer by storing it in
a global var or somesuch, then it'll get cancelled/destroyed at the next GC.
I think this could work if we only do it for timers that use `repeat'.


        Stefan

  reply	other threads:[~2006-09-05 15:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-05  0:14 Should `cancel-timer' use `delete' instead of `delq'? Drew Adams
2006-09-05  1:44 ` Miles Bader
2006-09-05 15:38   ` Stefan Monnier [this message]
2006-09-05 16:20     ` Drew Adams
2006-09-05 17:22       ` Stefan Monnier
2006-09-05 17:36         ` Drew Adams
2006-09-05 20:46           ` Kevin Rodgers
2006-09-05 21:24             ` Drew Adams
2006-09-06  1:11               ` Miles Bader
2006-09-06  2:09                 ` Drew Adams
2006-09-06  2:38                   ` Miles Bader
2006-09-06  6:31                     ` Drew Adams
2006-09-06  6:48                       ` Miles Bader
2006-09-06  7:29                       ` David Kastrup
2006-09-06 14:00                       ` Stefan Monnier
2006-09-06 15:27                         ` Drew Adams
2006-09-06  6:38                   ` David Kastrup
2006-09-05 21:56     ` David Kastrup
2006-09-06  0:59       ` Stefan Monnier
2006-09-06 19:05     ` Richard Stallman
2006-09-05 19:13 ` Stuart D. Herring
2006-09-05 19:22   ` Drew Adams
2006-09-06  8:49 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvk64imimt.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).