From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Redisplay inside keyboard macros Date: Tue, 8 Feb 2022 12:17:52 -0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33513"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 08 17:29:47 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nHTNC-0008WR-QY for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 08 Feb 2022 17:29:46 +0100 Original-Received: from localhost ([::1]:48650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHTNB-0006UF-CI for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 08 Feb 2022 11:29:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHSFs-00033A-6C for help-gnu-emacs@gnu.org; Tue, 08 Feb 2022 10:18:08 -0500 Original-Received: from [2607:f8b0:4864:20::633] (port=40872 helo=mail-pl1-x633.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHSFq-0007wx-25 for help-gnu-emacs@gnu.org; Tue, 08 Feb 2022 10:18:07 -0500 Original-Received: by mail-pl1-x633.google.com with SMTP id y17so14069438plg.7 for ; Tue, 08 Feb 2022 07:18:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=UuG88bLeZx+3oQRv7Qw5xzqUJCRB6IZdej0Fa0Z6okU=; b=pooxJhS2+So7ihx0Bi5liwNBMQBdVnBXUcqaxxsiJN/Q950t0VyWXUDh/sJOX80+pi 8GvIVKeRub+BXR6vF62k/V2KovwNqA99M+dt8U5daC1ozTm1d2g9DtHYR52/Vk2nx/LM 4WStORwP1W4tpW7/vGV75DqgsI1qp7uJI1Nrm6Fq65gpZcuoriDRTdfiE/tusLq7CHYE wsE4lajvCOacKyX4hQggsQfFatxRDgZO4tJ/Tys7PZJj2MIksbBxo0Ba41O51F7aLXnN QlOXPg8bXX+m8lPAiftSfSL+qmUEfXxdtPY8p/jejkru8KbemT8NeGk6zlvdx1QAcqua PpCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=UuG88bLeZx+3oQRv7Qw5xzqUJCRB6IZdej0Fa0Z6okU=; b=JBkTlWXE+mQYMw6XIqhYe2AK3htzRjlOw6eWDQ1wk0SdtU8/o7uCOKimTheplKYy1s gR0xOQ+SvnMXNx0Ieu9FMzj9wgLm2h9MqIxQnbo9TMQG7M+QQm1dKs4cpwAQ5RnutndT cYCaLv6ekwRZ0EilKmPR0PPcquMriylZxMD7dms/9k7QTjh1G8ZK1bNeCgKPw3vRjzH/ 1n12WiW4Ev6dadEfYfFywWAxmTmzV4T4zGiiukPmnfgkAtu9ACrm3G5jskkYGhDiqpsN EAd5y9kAqRp/opoG6kI5ii9WuZ01RphW/jkKEAafNwYWiiOMAmmJSZlDFBtRAatxaM2X YanQ== X-Gm-Message-State: AOAM5305T65kgL69FMB9xmqH+f+sNDuORSzdf3pQaK1bucEghTg5Hy8r gvqQ2ch1/O8h9TrZxkSsRkJCRzOWgyDDP8bncmefiS3wREY= X-Google-Smtp-Source: ABdhPJwj0nEOzSjA6vYYnq9JP2WX1O7rJ3TWZGeRnFVs0stY1k26vb48mHOYcdrZfdlhG0gv9DJrDj2/MLEa2VwMkU0= X-Received: by 2002:a17:90b:1bc3:: with SMTP id oa3mr720002pjb.17.1644333484131; Tue, 08 Feb 2022 07:18:04 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::633 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=eduardoochs@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135833 Archived-At: Hi list, I am trying to write a keyboard macro that does some things, pauses for one second, and then does more things, but I discovered that the obvious ways to do sleep-and-redisplay don't work. Try to run the code below with your favorite variant of C-e C-x C-e after each sexp: (defun eek (str) "Execute STR as a keyboard macro. See `edmacro-mode' for the exact format.\n An example: (eek \"C-x 4 C-h\")" (interactive "sKeys: ") (execute-kbd-macro (read-kbd-macro str))) ;; Choose one: (defun s () (interactive) (sleep-for 1)) (defun s () (interactive) (redisplay) (sleep-for 1) (redisplay)) (defun s () (interactive) (redisplay 'force) (sleep-for 1) (redisplay 'force)) (eek "RET ab <> cd") I expected to see an "ab", then a pause, then the "cd", but that's not what happens - I get a pause and then "abcd". What am I doing wrong? I just triple-checked the docs about redisplay and this behavior makes no sense to me... Thanks in advance!!! Eduardo Ochs http://angg.twu.net/#eev