bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24959: 26.0.50; cancel-timer: void-variable timer


From: Oleg Sivokon
Subject: bug#24959: 26.0.50; cancel-timer: void-variable timer
Date: Thu, 17 Nov 2016 21:24:49 +0200

Oh, I missed it was declared locally, my bad.
Sure, I wonder how did it work earlier.
Thanks for responses!

On Thu, Nov 17, 2016 at 9:22 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> Oleg Sivokon <oleg.sivokon@elastifile.com> writes:
>
>> (defun tesla-do-containers (command &optional need-refresh output)
>>   (let (temp-buffs timer)
>
> [...]
>
>>         (setq timer
>>               (run-at-time
>>                1 1
>>                (lambda (output buffs)
>
> [...]
>
>>                        (cancel-timer timer))
>
> This can't work.  You're setting a locally bound variable, and then
> you're running the lambda in a different context afterwards.
>
> Start using lexical bindings, and it'll work.
>
> In any case, this doesn't look like an Emacs bug, and I'm closing this
> bug report.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]