From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?U8O4cmVuIFBpbGfDpXJk?= Newsgroups: gmane.emacs.devel Subject: Re: How about making `sleep-for' interactive? Date: Thu, 27 Jun 2019 09:46:41 +0200 Message-ID: References: <87v9wrwsde.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="222577"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Emacs developers To: Marcin Borkowski Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 27 09:47:11 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgP7f-000vid-4D for ged-emacs-devel@m.gmane.org; Thu, 27 Jun 2019 09:47:11 +0200 Original-Received: from localhost ([::1]:47420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgP7d-0000zw-ED for ged-emacs-devel@m.gmane.org; Thu, 27 Jun 2019 03:47:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35173) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgP7X-0000zX-Df for emacs-devel@gnu.org; Thu, 27 Jun 2019 03:47:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgP7W-0003DK-9t for emacs-devel@gnu.org; Thu, 27 Jun 2019 03:47:03 -0400 Original-Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]:37655) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgP7W-0002xV-0M for emacs-devel@gnu.org; Thu, 27 Jun 2019 03:47:02 -0400 Original-Received: by mail-ed1-x529.google.com with SMTP id w13so6158354eds.4 for ; Thu, 27 Jun 2019 00:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TzxmcrH54IkObj5hBO9QgwgWqyssMdqgTIBW5x+OxNk=; b=L889tF1CnIK1itBUfgKHxQ7oAAZlNngyXEsl1A+usIcAjXrbtl3/uSklYHJjKDDC6V rmAG+s2zJ0zk1ZyOU7NWP/+BHNUBSgLFBitOSPkER2H+0DDbVH/lpr1c0k8jrqKEl3xD JYw1D+9aUptvQZEvmHHtBky8w5696flrKrF24Gz1wtYkLhMSCBU6+US69JoKG08lJf+4 aXonCfGFmG20+Mij+uahMzZln5NK+qF4J1uMN5BdJcllmYEyZSbE9jv0skzXGoGLeKu9 opk5mgGZKfKytGae7uciN6SLFf3wm9dHQChOWGCJrnn95ugemUV88XENEbs/omB5EAoN Qecw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TzxmcrH54IkObj5hBO9QgwgWqyssMdqgTIBW5x+OxNk=; b=s8hhYk+E/vFxg70g5TH2ljFmJ9C9SMuRaPhwVFtxaAyUG5gbpkY42QGkLkKS6ctEHc I9jvN47ibFBHDIyXvooabnmMdu/rXNw68ijKf96KYdfnaXchNXDzbVD29hznu4jXnj0X wLN0fCSUaAymO8Gf7/c7QEHytKv0IOzOel5pSZ7wMYOHJrrFuo2EyeWajA/f9gDFmcNP iyZzROP9Rw/BclnfSQWIt4mOHQpItvZ4iqwb5hXRRhiNtlR7gS73zVw1Umnm/L+sRBZ9 ydayWrSKEM7/TDVGO0enDa6irJ92uC8TFt6GXjlWuvnDgAZ+5zqYc5OXljhMP0RIOftQ KfRA== X-Gm-Message-State: APjAAAUd/7wv3Dk0TWxJwoyqtqhRiGfyLnjC2Cdr98zmku47P6GXZptX /jBO988IFbI0SSegvmS3laX5g207PLD/AD42Ne4= X-Google-Smtp-Source: APXvYqwGGMwWBfLxr9tuVQVwHCKZWHBJXBiv+WqtAUwpRyUBXuFyb81h3RHocrpV3s0TdQO6RqcCnSvURJNuD984BAk= X-Received: by 2002:a17:906:2341:: with SMTP id m1mr1802517eja.165.1561621612455; Thu, 27 Jun 2019 00:46:52 -0700 (PDT) In-Reply-To: <87v9wrwsde.fsf@mbork.pl> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::529 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238185 Archived-At: On Thu, Jun 27, 2019 at 6:47 AM Marcin Borkowski wrote: > > Hi all, > > I noticed today that `sleep-for' is not an (interactive) command. IMHO > it should be - at least I can see a need for it. Here is my use case. > I recorded a keyboard macro which edits the text in some way. The macro > begins with isearching for something (which may be outside the part of > the buffer currently seen) and then changing. Having e.g. a 1-second > delay between moving to that part and actually changing it would help > spot mistakes. > > Since `sleep-for' is a builtin, I can't prepare a patch (I don't speak > C very well), but if I get a hint I can try (just to learn something > new). > > WDYT? > I can't really see the use. You could always just do ```M-: (sleep-foor xxx)``` in the macro. Being time sensitive and waiting for abortion is a bit too dangerous in my taste, either I am sure and do it everywhere or I want to accept / decline in cases like that. What I usually do in cases like that is to make a macro that moves to the next occurrence, then does the changes and then moves to just the beginning of the next occurrence again. That way I can just call the macro repeatedly and it will move forward to the next place where a change will happen each time. If I decide not to apply the macro I will skip forward, either searching manually for the next occurrence or sometimes just moving the point forward so the macro will edit the next occurrence instead.