From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: try-this-for ? Date: Wed, 17 Jan 2018 15:50:36 -0800 Message-ID: References: <86lggw6vtn.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1516232993 7802 195.159.176.226 (17 Jan 2018 23:49:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 17 Jan 2018 23:49:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 18 00:49:49 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebxSU-0000lg-4Q for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 00:49:30 +0100 Original-Received: from localhost ([::1]:44077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebxUU-0000fQ-99 for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Jan 2018 18:51:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebxTv-0000ey-Ii for help-gnu-emacs@gnu.org; Wed, 17 Jan 2018 18:51:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebxTu-0004yi-9J for help-gnu-emacs@gnu.org; Wed, 17 Jan 2018 18:50:59 -0500 Original-Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:46760) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebxTu-0004w9-40 for help-gnu-emacs@gnu.org; Wed, 17 Jan 2018 18:50:58 -0500 Original-Received: by mail-qt0-x235.google.com with SMTP id o35so15943507qtj.13 for ; Wed, 17 Jan 2018 15:50:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=h0Mrqfu8Dk/FJHIDhBbnLgOv2fAThYdTmOL5e92hYvQ=; b=tQrqqhZ7flu23ciY/KCTYaU8qoh4hI66ki4q/rj/SpyWNoSIloVioUkAtzXP/oyTjy gPVVFtu5XX0S4uV4CS7tzZcwsLQDVAD1+3MKw+3SS3fRzBahaqaps9t+tnBSJzYiGlhs M5MBzEFAtL0p028vQ8hS6J/QDWpXpJ1/R8I8mkid+QT+3n86EPNvGtW+0cPasJ/hnPBd rr/OBQLPQpEKyBAZ60Ukfus+aa2pY7BHWFMyral9jV+ZPuvXUcgY2JujJdoel1QgLlJ6 x0s93vTS6t7W/+TBW8J/bySaDpGbwzTs96D4yXCiujraUas30RzeBtuN//NdMbRVOhNk vbKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=h0Mrqfu8Dk/FJHIDhBbnLgOv2fAThYdTmOL5e92hYvQ=; b=Ck+FMP2MvDF7QO+gqgEg8cij3dUgdwgOJJBhlGfuLBKB7954l470g672sdKWZXt4An 3esyotFOBOUaDQBpkm0cebS7Gf0BhIx2DxrojftJ/weF6yLBP2R0Gee21OzQN3sokD9U HnQH68WDOugHGw4ab+cOp8ZtSISC3XGST553Vkvk0nP84liAgUp7A0meSlsn2MibFu/6 Ud2jPfBpAEvtsnWZeYx1UgdsUmCtdeOscG9PtNeFEA6rBdDywfO8wFKfYDoNaqk/z4rS u+qvL2MygWPKOZcK6xJ5jdU/SRSorLkyrgc9tYkVtkodBSQk6Clv6XV+Ui8lhF+S3GO1 5u1g== X-Gm-Message-State: AKwxyte51gCoH/GC6BideqRq3JYauz+IBzSGaJ+JSPK68hD0Yv31w+CD PNE9Y73F3ELf0wtUssA7+B1N4rTL7R/SeFQsAvqyPBUR X-Google-Smtp-Source: ACJfBot0MgHDY2+j9x/heQVMqkGxFeBFkylHKgzUU8erKlCy+e8ZjhdgPv9N3z6xS1d74K/G7JD+booVZzlM7aZa/NE= X-Received: by 10.55.15.203 with SMTP id 72mr28726179qkp.91.1516233056770; Wed, 17 Jan 2018 15:50:56 -0800 (PST) Original-Received: by 10.200.15.68 with HTTP; Wed, 17 Jan 2018 15:50:36 -0800 (PST) In-Reply-To: <86lggw6vtn.fsf@zoho.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::235 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:115764 Archived-At: Emanuel Berg wrote: > Is there something like this: > > (try-this-for SECONDS BODY) > > If BODY hasn't completed after SECONDS, > everything will be aborted, i.e. > the equivalence of `keyboard-quit' (or whatever > appropriate). > > But what has already happened until the point > of abortion don't have to be rolled back or any > state restored or dumped or anything like that. > > If BODY do complete before SECONDS it should be > transparent in the sense that what should be > returned is the final evaluation of BODY. There's `with-timeout' in timer.el, however (from the docstring): The timeout is checked whenever Emacs waits for some kind of external event (such as keyboard input, input from subprocesses, or a certain time); if the program loops without waiting in any way, the timeout will not be detected. So it may not be exactly what you want. John