unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* kill buffer created by url-retrieve-synchronously
@ 2016-02-26 11:25 Peter Münster
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Münster @ 2016-02-26 11:25 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

A timer calls periodically this function:

--8<---------------cut here---------------start------------->8---
(defun pm/get-json (url)
  "Copied from
http://frozenlock.org/2012/07/07/url-retrieve-and-json-api/."
  (let* ((url-mime-encoding-string "identity")
         (buffer (with-timeout (3 nil) (url-retrieve-synchronously url)))
         (result 
          (with-current-buffer buffer
            (goto-char (point-min))
            (re-search-forward "^$")
            (json-read))))
    (kill-buffer buffer)
    result))
--8<---------------cut here---------------end--------------->8---

Sometimes, the buffers created by url-retrieve-synchronously are not
killed, because I see them in (buffer-list).

What should I do to ensure, that these buffers are always killed at the
end of the function please?

TIA for any help,
-- 
           Peter




^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <mailman.5945.1456485979.843.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2016-02-28  3:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-26 11:25 kill buffer created by url-retrieve-synchronously Peter Münster
     [not found] <mailman.5945.1456485979.843.help-gnu-emacs@gnu.org>
2016-02-27  3:58 ` Lars Magne Ingebrigtsen
2016-02-27 17:55   ` Peter Münster
     [not found]   ` <mailman.6062.1456595760.843.help-gnu-emacs@gnu.org>
2016-02-28  3:52     ` Lars Magne Ingebrigtsen

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