unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* byte-compile-file not reentrant?
@ 2009-12-30  2:58 Lennart Borgman
  2009-12-30  3:12 ` Jason Rumney
  2009-12-30  3:17 ` Daniel Colascione
  0 siblings, 2 replies; 5+ messages in thread
From: Lennart Borgman @ 2009-12-30  2:58 UTC (permalink / raw)
  To: Emacs-Devel devel

A buffer created with (get-buffer-create " *Compiler Input*") makes
byte-compile-file not reentrant if I understand it correctly. (I did
not look very carefully.)

I do not understand the meaning of this. Should the old buffer be
reused in some way?

There is a similar call in byte-compile-from-buffer.

Could perhaps these calls be changed to generate new buffer names?
Would that make byte compiling reentrant or are there other
restrictions that makes this impossible?




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

* Re: byte-compile-file not reentrant?
  2009-12-30  2:58 byte-compile-file not reentrant? Lennart Borgman
@ 2009-12-30  3:12 ` Jason Rumney
  2009-12-30  3:18   ` Lennart Borgman
  2009-12-30  3:17 ` Daniel Colascione
  1 sibling, 1 reply; 5+ messages in thread
From: Jason Rumney @ 2009-12-30  3:12 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

On 30/12/2009 10:58, Lennart Borgman wrote:
> A buffer created with (get-buffer-create " *Compiler Input*") makes
> byte-compile-file not reentrant if I understand it correctly. (I did
> not look very carefully.)
>    

It's not very clear what you did not look very carefully at, but I 
suspect that what you are looking at is the test for reentrancy, not the 
cause.






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

* Re: byte-compile-file not reentrant?
  2009-12-30  2:58 byte-compile-file not reentrant? Lennart Borgman
  2009-12-30  3:12 ` Jason Rumney
@ 2009-12-30  3:17 ` Daniel Colascione
  2009-12-30  3:24   ` Lennart Borgman
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Colascione @ 2009-12-30  3:17 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Emacs-Devel devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/29/09 9:58 PM, Lennart Borgman wrote:
> A buffer created with (get-buffer-create " *Compiler Input*") makes
> byte-compile-file not reentrant if I understand it correctly. (I did
> not look very carefully.)
> 
> I do not understand the meaning of this. Should the old buffer be
> reused in some way?
> 
> There is a similar call in byte-compile-from-buffer.
> 
> Could perhaps these calls be changed to generate new buffer names?
> Would that make byte compiling reentrant or are there other
> restrictions that makes this impossible?

I looked into this a bit when I wrote byte-code-cache.el. The buffer
name is just the first obstacle to a re-entrant byte compiler: there are
various variable bindings that would be hard to catch and sort out.

TBH, it'd probably be easier to just re-execute emacs itself, in batch
mode, as a subprocess.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAks6xl8ACgkQ17c2LVA10VuwBQCgn7Jwf0xL/PjKOPmM+T7ffdYu
JV4AoLEaSRnOKSIb7c4kilEEuP4AvxJ6
=EIDE
-----END PGP SIGNATURE-----




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

* Re: byte-compile-file not reentrant?
  2009-12-30  3:12 ` Jason Rumney
@ 2009-12-30  3:18   ` Lennart Borgman
  0 siblings, 0 replies; 5+ messages in thread
From: Lennart Borgman @ 2009-12-30  3:18 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Emacs-Devel devel

On Wed, Dec 30, 2009 at 4:12 AM, Jason Rumney <jasonr@gnu.org> wrote:
> On 30/12/2009 10:58, Lennart Borgman wrote:
>>
>> A buffer created with (get-buffer-create " *Compiler Input*") makes
>> byte-compile-file not reentrant if I understand it correctly. (I did
>> not look very carefully.)
>>
>
> It's not very clear what you did not look very carefully at, but I suspect
> that what you are looking at is the test for reentrancy, not the cause.


For the output it does

     (with-current-buffer
         (setq bytecomp-outbuffer (get-buffer-create " *Compiler Output*"))
       (set-buffer-multibyte t)
       (erase-buffer)

This does not look very reentrant.




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

* Re: byte-compile-file not reentrant?
  2009-12-30  3:17 ` Daniel Colascione
@ 2009-12-30  3:24   ` Lennart Borgman
  0 siblings, 0 replies; 5+ messages in thread
From: Lennart Borgman @ 2009-12-30  3:24 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: Emacs-Devel devel

On Wed, Dec 30, 2009 at 4:17 AM, Daniel Colascione
<daniel@censorshipresearch.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12/29/09 9:58 PM, Lennart Borgman wrote:
>> A buffer created with (get-buffer-create " *Compiler Input*") makes
>> byte-compile-file not reentrant if I understand it correctly. (I did
>> not look very carefully.)
>>
>> I do not understand the meaning of this. Should the old buffer be
>> reused in some way?
>>
>> There is a similar call in byte-compile-from-buffer.
>>
>> Could perhaps these calls be changed to generate new buffer names?
>> Would that make byte compiling reentrant or are there other
>> restrictions that makes this impossible?
>
> I looked into this a bit when I wrote byte-code-cache.el. The buffer
> name is just the first obstacle to a re-entrant byte compiler: there are
> various variable bindings that would be hard to catch and sort out.


Hm, thanks. Then I have to change strategy.

I do not understand what is happening. I got trouble with defmacro:s
that are in some way half defined sometimes. I am rewriting require to
download from the web (as I (implicitly) told in another message). But
this creates of course some problem with loading. But the expansion of
defmacro is a black hole for me.

Can I just use catch+throw to jump out of a compilation when I detect
a require (and reque compilation)? Or are there some state to cleanup?




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

end of thread, other threads:[~2009-12-30  3:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30  2:58 byte-compile-file not reentrant? Lennart Borgman
2009-12-30  3:12 ` Jason Rumney
2009-12-30  3:18   ` Lennart Borgman
2009-12-30  3:17 ` Daniel Colascione
2009-12-30  3:24   ` Lennart Borgman

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).