From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#5372: Calling url-retrieve-synchronously in a timer Date: Wed, 13 Jan 2010 14:57:58 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1263414083 15301 80.91.229.12 (13 Jan 2010 20:21:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jan 2010 20:21:23 +0000 (UTC) Cc: 5372@debbugs.gnu.org To: Lennart Borgman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 13 21:21:15 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NV9iF-0001FC-FU for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jan 2010 21:21:08 +0100 Original-Received: from localhost ([127.0.0.1]:56043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NV9iG-0006yj-5M for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jan 2010 15:21:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NV9gW-0006D0-4y for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2010 15:19:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NV9gR-0006AV-23 for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2010 15:19:19 -0500 Original-Received: from [199.232.76.173] (port=52442 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NV9gQ-0006AI-Tj for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2010 15:19:14 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54468) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NV9gQ-0000o7-M7 for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2010 15:19:14 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NV9Ms-0008LK-MR; Wed, 13 Jan 2010 14:59:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Jan 2010 19:59:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5372 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5372-submit@debbugs.gnu.org id=B5372.126341268632037 (code B ref 5372); Wed, 13 Jan 2010 19:59:02 +0000 Original-Received: (at 5372) by debbugs.gnu.org; 13 Jan 2010 19:58:06 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NV9Lx-0008Kg-VY for submit@debbugs.gnu.org; Wed, 13 Jan 2010 14:58:06 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NV9Lv-0008KC-Fj for 5372@debbugs.gnu.org; Wed, 13 Jan 2010 14:58:03 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvIEAJe0TUvO+KPG/2dsb2JhbACBRNV/hDAEijI X-IronPort-AV: E=Sophos;i="4.49,270,1262581200"; d="scan'208";a="53693412" Original-Received: from 206-248-163-198.dsl.teksavvy.com (HELO pastel.home) ([206.248.163.198]) by ironport2-out.pppoe.ca with ESMTP; 13 Jan 2010 14:57:58 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 97A61806E; Wed, 13 Jan 2010 14:57:58 -0500 (EST) In-Reply-To: (Lennart Borgman's message of "Wed, 13 Jan 2010 20:09:14 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -2.0 (--) Resent-Date: Wed, 13 Jan 2010 14:59:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34293 Archived-At: >>>> Furthermore, it doesn't look like a good thing to >>>> do anyway: timer code should not run for an indefinite amount of time, >>> Maybe you misunderstod me. =A0If I do the call to >>> url-retrieve-synchronously from the command loop it finishes very >>> quickly (in this case), but if I do the same thing in a timer >>> it hangs. >> I understood you alright. =A0The fact that "it finishes quickly" when you >> try it doesn't mean that it will always run in a definite amount of time. > What is the problem with letting code in a timer run/wait for a long time? Since it's run asynchronously, it can interrupt the user unexpectedly. Also timer code is normally run with inhibit-quit non-nil, so the user has no way to abort the timer code. So you'd need to use with-local-quit at least, which in turn means that if the user happens to press C-g while your timer happens to be running, it will be aborted. Stefan