* Re: (progn (top-level) A B C)
@ 2007-02-14 17:37 A Soare
2007-02-14 17:48 ` Andreas Schwab
0 siblings, 1 reply; 2+ messages in thread
From: A Soare @ 2007-02-14 17:37 UTC (permalink / raw
To: Lennart Borgman (gmail)
Cc: Emacs Help [help-gnu-emacs], Emacs Bug [bug-gnu-emacs]
> I do not think you can do it directly, but maybe you can use a timer?
>
> (run-with-idle-timer 0 nil (lambda()
Thanks, I will check. Another method that I found is
(unwind-protect
(prog1
(message "x")
(top-level))
(message "a")
(message "b"))
By the way, this code returns "Back to top level." . BAD.
x
a
b
Back to top level.
What is the definition of prog1? It should return the first argument. It seems that in this case the 1st argument is lost.
This is a BUG in prog1... I think that prog2, progn give the same bug... That is?
Does somebody else knows another methods? Let us make all of you that know a list of methods here for this problem, please...
Trying to solve a bug in the E debugger I asked myself this problem...
Alin Soare.
> Message du 14/02/07 à 17h38
> De : "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> A : alinsoar@voila.fr
> Copie à : "Emacs Help [help-gnu-emacs]" <help-gnu-emacs@gnu.org>
> Objet : Re: (progn (top-level) A B C)
>
> A Soare wrote:
> > Hello,
> >
> > Can somebody tell me how you write a code to execute the followiung commands in the order t-l A B C:
> >
> > (top-level)
> > (A ...)
> > (B ...)
> > (C ...) ?
>
>
> I do not think you can do it directly, but maybe you can use a timer?
>
> (run-with-idle-timer 0 nil (lambda()
> (message "a")(sit-for 1)
> (message "b")(sit-for 1)
> (message "c")(sit-for 1)
> ))
> (top-level)
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: (progn (top-level) A B C)
2007-02-14 17:37 (progn (top-level) A B C) A Soare
@ 2007-02-14 17:48 ` Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2007-02-14 17:48 UTC (permalink / raw
To: alinsoar
Cc: Emacs Help [help-gnu-emacs], Lennart Borgman (gmail),
Emacs Bug [bug-gnu-emacs]
A Soare <alinsoar@voila.fr> writes:
> Thanks, I will check. Another method that I found is
>
> (unwind-protect
> (prog1
> (message "x")
> (top-level))
> (message "a")
> (message "b"))
>
>
> By the way, this code returns "Back to top level." . BAD.
It does not return anything.
> x
> a
> b
> Back to top level.
>
> What is the definition of prog1? It should return the first argument. It seems that in this case the 1st argument is lost.
This is not a bug. (top-level) throws to 'top-level, thus (prog1 ...) is
never finished. unwind-protect only returns a value if the body completes
normally. Otherwise it does not return anything, rather execution is
transferred directly to the receiving exception handler after executing
the unwind forms.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-14 17:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-14 17:37 (progn (top-level) A B C) A Soare
2007-02-14 17:48 ` Andreas Schwab
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).