[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: kill buffer created by url-retrieve-synchronously
From: |
Lars Magne Ingebrigtsen |
Subject: |
Re: kill buffer created by url-retrieve-synchronously |
Date: |
Sun, 28 Feb 2016 14:22:11 +1030 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Peter Münster <pmlists@free.fr> writes:
> Thanks. But it still does not work. Just an idea: Is it possible, that
> the with-timeout form kills the url-retrieve-synchronously function
> because of the timeout, but the buffer has already been created?
Sorry; I didn't notice the `with-timeout' thing at all.
[...]
> (let ((url-mime-encoding-string "identity"))
> (setq my-json-buffer (with-timeout (3 nil)
> (url-retrieve-synchronously url)))
[...]
> (if my-json-buffer
> (kill-buffer my-json-buffer)))))
Yes, the `with-timeout' is the reason the buffer isn't killed. Because
it'll just return nil when timing out, and there's no way to get at the
buffer url.el created.
For reasons like this, `with-timeout' isn't recommended.
`url-retrieve-synchronously' should have a timeout parameter. Feel free
to submit that as a wishlist bug report with `M-x report-emacs-bug'.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no