From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.help Subject: Re: kill buffer created by url-retrieve-synchronously Date: Sun, 28 Feb 2016 14:22:11 +1030 Message-ID: <87twktxzis.fsf@gnus.org> References: <87lh66ls7n.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1456631592 28571 80.91.229.3 (28 Feb 2016 03:53:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Feb 2016 03:53:12 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Peter =?iso-8859-1?Q?M=FCnster?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 28 04:53:02 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aZsPl-0005H1-Fr for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Feb 2016 04:53:01 +0100 Original-Received: from localhost ([::1]:57329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZsPh-0004rU-Ai for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Feb 2016 22:52:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZsPW-0004rB-IP for help-gnu-emacs@gnu.org; Sat, 27 Feb 2016 22:52:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZsPR-00046N-JD for help-gnu-emacs@gnu.org; Sat, 27 Feb 2016 22:52:46 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:43333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZsPR-00046I-Ch for help-gnu-emacs@gnu.org; Sat, 27 Feb 2016 22:52:41 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aZsP2-0007Mk-Bo; Sun, 28 Feb 2016 04:52:17 +0100 In-Reply-To: ("Peter \=\?iso-8859-1\?Q\?M\=FCnster\=22's\?\= message of "Sat, 27 Feb 2016 18:55:44 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aZsP2-0007Mk-Bo MailScanner-NULL-Check: 1457236338.43305@PtjHem+kucmeRjDfKMcAJw X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109351 Archived-At: Peter M=FCnster 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'. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no