From: Oleg Sivokon <oleg.sivokon@elastifile.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 24959@debbugs.gnu.org
Subject: bug#24959: 26.0.50; cancel-timer: void-variable timer
Date: Thu, 17 Nov 2016 21:19:05 +0200 [thread overview]
Message-ID: <CA+-61TRpCCR71LeNajRjPAC=tipjF0nTKU6V61UBuGMmA_VpQA@mail.gmail.com> (raw)
In-Reply-To: <CA+-61TSMdW1O1TaxjxPTkvVrc6c9Qd3t3UTt2iTzbnMoB90d4g@mail.gmail.com>
But, before I find one, here's the original code that caused the problem:
(defun tesla-do-containers (command &optional need-refresh output)
(let (temp-buffs timer)
(unwind-protect
(cl-loop for container being the hash-value of tesla-makred-containers
for buf = (get-buffer-create
(generate-new-buffer-name "*tesla-temp*"))
do (with-current-buffer buf
(set (make-local-variable 'container)
(format "%s:%s"
(docker-container-loader container)
(docker-container-names container))))
(funcall command container buf)
(push buf temp-buffs))
(when output
(setq timer
(run-at-time
1 1
(lambda (output buffs)
(condition-case err
(unless
(cl-loop for buf in buffs
thereis (get-buffer-process buf))
(cl-loop for buf in buffs
for container = (with-current-buffer
buf container)
for contents =
(with-current-buffer buf
(buffer-substring (point-min) (point-max))) do
(kill-buffer buf)
(with-current-buffer output
(insert (format "\n\n===== %s
=====\n\n" container))
(insert contents)))
(cancel-timer timer))
(error
(cl-loop for buf in buffs
when (buffer-live-p buf) do
(kill-buffer buf))
(cancel-timer timer))))
output temp-buffs)))
(when need-refresh
(tesla-list-containers)))))
On Thu, Nov 17, 2016 at 9:14 PM, Oleg Sivokon
<oleg.sivokon@elastifile.com> wrote:
> Lars,
> I'll need to experiement with this then. My hunch is that when this
> happens inside condition-case, the things don't work exactly the same.
> I'll try to come up with a minimal example for the problem.
>
> On Thu, Nov 17, 2016 at 8:09 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>> Oleg Sivokon <oleg.sivokon@elastifile.com> writes:
>>
>>> No, I don't use lexical bindings in this code. But, my point is that
>>> the behavior of setq used to be to make variable special (i.e.
>>> universaly accessible, like global, except it can be let-bound
>>> temporarily), which it doesn't seem to do anymore.
>>
>> It does for me.
>>
>> [...]
>>
>>>>> (setq timer (run-at-time 1 1 (lambda () (cancel-timer timer)))
>>
>> You've forgotten an end parentheses there. If I add one and eval the
>> form, it works fine for me.
>>
>> --
>> (domestic pets only, the antidote for overdose, milk.)
>> bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2016-11-17 19:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 9:48 bug#24959: 26.0.50; cancel-timer: void-variable timer Oleg Sivokon
2016-11-17 17:08 ` Eli Zaretskii
2016-11-17 17:11 ` Lars Ingebrigtsen
2016-11-17 17:55 ` Oleg Sivokon
2016-11-17 17:56 ` Lars Ingebrigtsen
2016-11-17 18:00 ` Oleg Sivokon
2016-11-17 18:03 ` Lars Ingebrigtsen
2016-11-17 18:06 ` Oleg Sivokon
2016-11-17 18:09 ` Lars Ingebrigtsen
2016-11-17 19:14 ` Oleg Sivokon
2016-11-17 19:19 ` Oleg Sivokon [this message]
2016-11-17 19:22 ` Lars Ingebrigtsen
2016-11-17 19:24 ` Oleg Sivokon
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='CA+-61TRpCCR71LeNajRjPAC=tipjF0nTKU6V61UBuGMmA_VpQA@mail.gmail.com' \
--to=oleg.sivokon@elastifile.com \
--cc=24959@debbugs.gnu.org \
--cc=larsi@gnus.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).