all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Redisplay inside keyboard macros
@ 2022-02-08 15:17 Eduardo Ochs
  2022-02-08 16:47 ` Eli Zaretskii
  2022-02-08 17:31 ` Eduardo Ochs
  0 siblings, 2 replies; 6+ messages in thread
From: Eduardo Ochs @ 2022-02-08 15:17 UTC (permalink / raw)
  To: help-gnu-emacs

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 <<s>> 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-02-09 18:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08 15:17 Redisplay inside keyboard macros Eduardo Ochs
2022-02-08 16:47 ` Eli Zaretskii
2022-02-08 19:42   ` Bruno Barbier
2022-02-08 21:00     ` Eduardo Ochs
2022-02-09 18:28       ` Bruno Barbier
2022-02-08 17:31 ` Eduardo Ochs

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.