unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [guile-emacs] Circular require problem
@ 2014-09-20 20:12 Left Right
  2014-09-24 13:49 ` Robin Templeton
  0 siblings, 1 reply; 2+ messages in thread
From: Left Right @ 2014-09-20 20:12 UTC (permalink / raw)
  To: guile-devel

Hello, I've asked at #guile IRC channel and was told this is the right
place to report these.

So, I've built Guile-2.2 and Guile-Emacs. Vanilla Emacs didn't start
at first due to:

(provide 'calendar)
(require 'cal-menu)

lines in cal-menu.el. This is because calendar requires cal-menu and
cal-menu requires calendar. It seems like the strategy in these
situation with Emacs Lisp is to put a "fake" provide statement in the
beginning of the file which provides the library, knowing that there's
the second "real" provide statement in the end of the file. I've
witnessed this same problem with couple more libraries, ERC being one
of them. The first thing I tried was:

(unless (featurep 'cal-menu) (require 'cal-menu))

Which, in some cases magically solved the problem, but not in other cases.

But I don't think it is useful to mimic Emacs behavior wrt circular
require. I think it would be better to make circular require possible
by remembering what libraries had already been required.

----

I have more problems to report. I've tried loading some popular Emacs
packages, such as Org, SLIME, ESS and CEDET, and few others, but none
of that worked. Only relatively large library that loaded was Pymacs,
but it affected the rest of the code somehow so that nothing else
would compile any more.

There was another problem with eval-buffer, where (add-to-list
'load-path ...) with the following (require ...) sexp wouldn't work,
but if evaluated sexp after sexp they magically worked.

I have saved backtrace and crash messages, and I could probably
produce more / more specific error messages if I knew better how to
debug. The regular backtrace buffer doesn't seem to be particularly
useful (too much technical info, which is difficult to trace back to
the source of the problem).

Best,

Oleg



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

* Re: [guile-emacs] Circular require problem
  2014-09-20 20:12 [guile-emacs] Circular require problem Left Right
@ 2014-09-24 13:49 ` Robin Templeton
  0 siblings, 0 replies; 2+ messages in thread
From: Robin Templeton @ 2014-09-24 13:49 UTC (permalink / raw)
  To: guile-devel

Left Right <olegsivokon@gmail.com> writes:

> Hello, I've asked at #guile IRC channel and was told this is the right
> place to report these.
>
> So, I've built Guile-2.2 and Guile-Emacs. Vanilla Emacs didn't start
> at first due to:
>
> (provide 'calendar)
> (require 'cal-menu)
>
> lines in cal-menu.el. This is because calendar requires cal-menu and
> cal-menu requires calendar. It seems like the strategy in these
> situation with Emacs Lisp is to put a "fake" provide statement in the
> beginning of the file which provides the library, knowing that there's
> the second "real" provide statement in the end of the file. I've
> witnessed this same problem with couple more libraries, ERC being one
> of them. The first thing I tried was:
>
> (unless (featurep 'cal-menu) (require 'cal-menu))
>
> Which, in some cases magically solved the problem, but not in other cases.
>
> But I don't think it is useful to mimic Emacs behavior wrt circular
> require. I think it would be better to make circular require possible
> by remembering what libraries had already been required.

Thank you for the detailed report! This problem has been fixed in the
current version of Guile-Emacs.

I had modified `load' to compile and execute entire files at once, but
the expression-by-expression evaluation normally performed by `load' is
important for breaking `require' cycles like the one you encountered.
Top-level `require' forms are evaluated at compile time but `provide'
forms aren't, so when `load' compiles the whole file at once, early
`provide' forms can never take effect at the right time.

Additionally, some packages simply don't `require' all their
dependencies and can't be byte-compiled cleanly. To support such
packages, `load' now loads source files using an interpreter, just as
standard Emacs does. Guile-Emacs will support automatic compilation
again in the future, but it will take some time to implement in a
completely compatible way.

> I have more problems to report. I've tried loading some popular Emacs
> packages, such as Org, SLIME, ESS and CEDET, and few others, but none
> of that worked. Only relatively large library that loaded was Pymacs,
> but it affected the rest of the code somehow so that nothing else
> would compile any more.

Org, SLIME and ESS all work for me with the current version. (I haven't
tested CEDET or Pymacs.)

> There was another problem with eval-buffer, where (add-to-list
> 'load-path ...) with the following (require ...) sexp wouldn't work,
> but if evaluated sexp after sexp they magically worked.

This should be fixed now as well.

> I have saved backtrace and crash messages, and I could probably
> produce more / more specific error messages if I knew better how to
> debug. The regular backtrace buffer doesn't seem to be particularly
> useful (too much technical info, which is difficult to trace back to
> the source of the problem).

This is now fixed.

Thanks,
Robin
-- 
Inteligenta persono lernas la lingvon Esperanton rapide kaj facile.
Esperanto estas moderna, kultura lingvo por la mondo. Simpla, fleksebla,
belsona, Esperanto estas la praktika solvo de la problemo de universala
interkompreno. Lernu la interlingvon Esperanton!




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

end of thread, other threads:[~2014-09-24 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-20 20:12 [guile-emacs] Circular require problem Left Right
2014-09-24 13:49 ` Robin Templeton

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