* Re: sit-for considered harmful in kbd-macros
[not found] ` <200202062308.PAA20392@radish.petrofsky.org>
@ 2002-02-06 23:19 ` Stefan Monnier
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2002-02-06 23:19 UTC (permalink / raw)
Cc: monnier+gnu/emacs, emacs-devel
> > From: "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu>
> >
> > How about short-circuiting sit-for when called from a kbd-macro,
> > as if input was pending ?
>
> > + if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro))
> > return Qnil;
>
> I'm pretty sure that's inappropriate when the argument to sit-for is
> non-zero, so the code should check for that. (After all, what fun
> would C-x ( M-` t g t C-u C-x ) be if it did no redisplay?)
Actually, no, the whole point of the patch is to make sit-for
not wait even when the argument is non-zero.
The redisplay/noredisplay is handled by the other argument.
Stefan
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sit-for considered harmful in kbd-macros
[not found] <200202062241.g16MfDO30778@rum.cs.yale.edu>
[not found] ` <200202062308.PAA20392@radish.petrofsky.org>
@ 2002-02-06 23:25 ` Kim F. Storm
2002-02-07 14:32 ` Stefan Monnier
2002-02-08 13:57 ` Richard Stallman
2 siblings, 1 reply; 6+ messages in thread
From: Kim F. Storm @ 2002-02-06 23:25 UTC (permalink / raw)
Cc: emacs-devel
"Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu> writes:
> How about short-circuiting sit-for when called from a kbd-macro,
> as if input was pending ?
>
I agree that it should definitely not delay execution (in fact, I
don't think 20.7 did that). I don't know if it should perform
redisplay though.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sit-for considered harmful in kbd-macros
2002-02-06 23:25 ` Kim F. Storm
@ 2002-02-07 14:32 ` Stefan Monnier
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2002-02-07 14:32 UTC (permalink / raw)
Cc: Stefan Monnier, emacs-devel
> > How about short-circuiting sit-for when called from a kbd-macro,
> > as if input was pending ?
>
> I agree that it should definitely not delay execution (in fact, I
> don't think 20.7 did that). I don't know if it should perform
> redisplay though.
I think it should behave exactly as if the macro's events were being
entered by the user: i.e. as if there was input pending.
So maybe the change should be done inside detect_input_pending_run_timers
(in keyboard.c). Looking at requeued_events_pending_p (and the comment
before it), I see that someone has had similar ideas and that
pushing the idea further might not be as straightforward as it seems.
So maybe patching sit-for is good enough for now.
Stefan
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sit-for considered harmful in kbd-macros
[not found] <200202062241.g16MfDO30778@rum.cs.yale.edu>
[not found] ` <200202062308.PAA20392@radish.petrofsky.org>
2002-02-06 23:25 ` Kim F. Storm
@ 2002-02-08 13:57 ` Richard Stallman
2002-02-08 14:58 ` Stefan Monnier
2 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2002-02-08 13:57 UTC (permalink / raw)
Cc: emacs-devel
How about short-circuiting sit-for when called from a kbd-macro,
as if input was pending ?
That might be a good idea. On the other hand, it would be nice
if there were a command you could use inside a macro to do a
redisplay.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sit-for considered harmful in kbd-macros
2002-02-08 13:57 ` Richard Stallman
@ 2002-02-08 14:58 ` Stefan Monnier
2002-02-10 5:19 ` Richard Stallman
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2002-02-08 14:58 UTC (permalink / raw)
Cc: monnier+gnu/emacs, emacs-devel
> How about short-circuiting sit-for when called from a kbd-macro,
> as if input was pending ?
>
> That might be a good idea. On the other hand, it would be nice
> if there were a command you could use inside a macro to do a
> redisplay.
I don't understand. My patch doesn't prevent redisplay (which
will happen inside `detect_input_pending_run_timers').
So is there any real objection to my suggested patch:
--- dispnew.c 19 Jan 2002 13:54:57 -0000 1.300
+++ dispnew.c 8 Feb 2002 14:56:58 -0000
@@ -6175,7 +6175,7 @@
swallow_events (display);
- if (detect_input_pending_run_timers (display))
+ if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro))
return Qnil;
if (initial_display)
-- Stefan
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sit-for considered harmful in kbd-macros
2002-02-08 14:58 ` Stefan Monnier
@ 2002-02-10 5:19 ` Richard Stallman
0 siblings, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2002-02-10 5:19 UTC (permalink / raw)
Cc: monnier+gnu/emacs, emacs-devel
I don't understand. My patch doesn't prevent redisplay (which
will happen inside `detect_input_pending_run_timers').
In that case, is it redundant for sit_for to call
redisplay_preserve_echo_area? If initial_display is nonzero
and display is too, does it redisplay twice?
So is there any real objection to my suggested patch:
If the purpose is to prevent waiting, I tend to think
that is right. Most of the time, when commands wait,
it is to make a message easier to see. Inside a macro
I think it is better not to do that.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-02-10 5:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200202062241.g16MfDO30778@rum.cs.yale.edu>
[not found] ` <200202062308.PAA20392@radish.petrofsky.org>
2002-02-06 23:19 ` sit-for considered harmful in kbd-macros Stefan Monnier
2002-02-06 23:25 ` Kim F. Storm
2002-02-07 14:32 ` Stefan Monnier
2002-02-08 13:57 ` Richard Stallman
2002-02-08 14:58 ` Stefan Monnier
2002-02-10 5:19 ` Richard Stallman
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).