unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Killing timers and buffer local variables
@ 2008-04-26 13:21 Lennart Borgman (gmail)
  2008-04-28  1:26 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2008-04-26 13:21 UTC (permalink / raw)
  To: Emacs Devel

If a timer is referenced with a buffer local variable and the 
corresponing buffer goes away it is quite cumbersome to kill the timer 
if it is a periodic timer.

How about adding a self referencing functions for timers to make this 
easier, something like (this-timer)?




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Killing timers and buffer local variables
  2008-04-26 13:21 Killing timers and buffer local variables Lennart Borgman (gmail)
@ 2008-04-28  1:26 ` Stefan Monnier
  2008-04-28 15:08   ` Johan Bockgård
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2008-04-28  1:26 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Emacs Devel

> If a timer is referenced with a buffer local variable and the corresponing
> buffer goes away it is quite cumbersome to kill the timer if it is
> a periodic timer.

> How about adding a self referencing functions for timers to make this
> easier, something like (this-timer)?

That's a good idea.  Patch welcome,


        Stefan


PS: It'd be better to use the `timer-' prefix.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Killing timers and buffer local variables
  2008-04-28  1:26 ` Stefan Monnier
@ 2008-04-28 15:08   ` Johan Bockgård
  2008-04-28 15:17     ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Bockgård @ 2008-04-28 15:08 UTC (permalink / raw)
  To: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> If a timer is referenced with a buffer local variable and the corresponing
>> buffer goes away it is quite cumbersome to kill the timer if it is
>> a periodic timer.
>
>> How about adding a self referencing functions for timers to make this
>> easier, something like (this-timer)?
>
> That's a good idea.  Patch welcome,

(defun timer-this-timer () timer-event-last)

-- 
Johan Bockgård





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Killing timers and buffer local variables
  2008-04-28 15:08   ` Johan Bockgård
@ 2008-04-28 15:17     ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2008-04-28 15:17 UTC (permalink / raw)
  To: emacs-devel

Johan Bockgård wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
>>> If a timer is referenced with a buffer local variable and the corresponing
>>> buffer goes away it is quite cumbersome to kill the timer if it is
>>> a periodic timer.
>>> How about adding a self referencing functions for timers to make this
>>> easier, something like (this-timer)?
>> That's a good idea.  Patch welcome,
> 
> (defun timer-this-timer () timer-event-last)

That was a fast one ;-)

Maybe it is sufficient to document this in

   (info "(elisp) Timers")




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-28 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-26 13:21 Killing timers and buffer local variables Lennart Borgman (gmail)
2008-04-28  1:26 ` Stefan Monnier
2008-04-28 15:08   ` Johan Bockgård
2008-04-28 15:17     ` Lennart Borgman (gmail)

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).