From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bob Newell Newsgroups: gmane.emacs.help Subject: Re: try-this-for ? Date: Wed, 17 Jan 2018 16:08:39 -1000 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 1516241288 17050 195.159.176.226 (18 Jan 2018 02:08:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2018 02:08:08 +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 03:08:03 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 1ebzcS-0003gy-QP for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 03:07:56 +0100 Original-Received: from localhost ([::1]:51865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebzeR-0007gT-2R for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Jan 2018 21:09:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebzdV-0007eA-KR for help-gnu-emacs@gnu.org; Wed, 17 Jan 2018 21:09:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebzdU-0003Kz-MO for help-gnu-emacs@gnu.org; Wed, 17 Jan 2018 21:09:01 -0500 Original-Received: from mail-yw0-x235.google.com ([2607:f8b0:4002:c05::235]:43577) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebzdU-0003KY-D2 for help-gnu-emacs@gnu.org; Wed, 17 Jan 2018 21:09:00 -0500 Original-Received: by mail-yw0-x235.google.com with SMTP id x190so9999115ywd.10 for ; Wed, 17 Jan 2018 18:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobnewell-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=irPuQUDcG5sOO/LDEmLgnIYjNmdN+1kzBGzDogMKhlI=; b=J15p2OKfzFe0xeTvZMiPtU5zbCmKQPydShfafvrBjjaDpuPtjk0aZVt3V0nAiOdeCQ zdv/88XYgc/bY9vmcw2pBBTP+tPEiVly7+AQMXS92QGrLZuLLO1BZlMralgna6oID5vD rwuDCYkYypDEaAMEWfU2FBM6/ncVfbM8KISu0pKIWw+Hzjl4d2q7QAH9fzyN0LwQL+lH 8Snit+w2x60dL8VaJnOP8PBmbk/2jE5KZ81/Dz90TvH3dtIP1tTKZ4xaSktPUiJ89uuJ FZ9RA/7j9EDzfInirom2kwSmDlIat4QZ8yGb3bcOUXfmnMXWSI2vIWIOPstZOkklQhaY 2rTg== 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=irPuQUDcG5sOO/LDEmLgnIYjNmdN+1kzBGzDogMKhlI=; b=SiA/+CcCENK5K5EyNkfIX07PfoExUPaZEIycFd84V+6MgBzbGH9j2dtI3ZEa11vkft M4kZkNWFu+7PKyEIFvnuhX4jofYQwZl+hW00Jizc0SQFNXo/gfhv77JKyluGuuYPQOak 9RK0f5bpdLOWchx3GH1wrmk4h5AEFWbdgOF7wn+rZ+nCRYJ/oXeUzVdMkJEf0Dqzs5xI bFclsgb5MxbMk2Vck6EAJ9qNx+iYaA8ecad4c7+F1Po6KPfoybx42DygqaCBSXmcYjC9 UKFq4Whz3fi3Pe4IMEukuNMY5n6ktp4C+1cRqYQruSOPL+aiIywEVjy7FtJYU8Exx3H3 sc6w== X-Gm-Message-State: AKwxyteaqVs5xR+0v560sL+6z4fHV78nN3nkTGRso+E1cA8rZKtUn5Pm 4HowAktMiKFgIdm5vsVZuBQLzX+7lDTKjzUI25S4JA== X-Google-Smtp-Source: ACJfBosoKTUwBddGyl2YtKEV3+GyWu0PUYRMZmnae4rUJ6bwPqZ9cEwm3r5zhxUcA1Y+2UaSVWS/fykLbmTH0zrREYw= X-Received: by 10.37.200.6 with SMTP id y6mr21056635ybf.267.1516241339467; Wed, 17 Jan 2018 18:08:59 -0800 (PST) Original-Received: by 10.37.129.68 with HTTP; Wed, 17 Jan 2018 18:08:39 -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:4002:c05::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:115765 Archived-At: > (try-this-for SECONDS BODY) The best way to do this is to build the timer check into 'body' itself. That way you can be sure to always exit in a known state. If an external timer interrupts 'body' (and I haven't yet figured out how to do that, so it's in theory) then the state could be in some disorder. Of course if 'body' is something like an internal emacs call that simply might run for a long time, this idea won't work. If 'body' is running a /process/, however, an Emacs timer can trigger a call to 'kill-process' or 'interrupt-process' to halt the process. Don't know if any of this helps ... -- Bob Newell Honolulu, Hawai`i Sent via Linux Mint 17.