[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recursive Fload and eval-after-load forms. (See bug #43116.)

From: Alan Mackenzie
Subject: Re: Recursive Fload and eval-after-load forms. (See bug #43116.)
Date: Mon, 31 Aug 2020 19:42:38 +0000

Hello, Stefan.

Thanks for such a rapid reply!

On Mon, Aug 31, 2020 at 14:54:54 -0400, Stefan Monnier wrote:
> > The cause of the double evaluation is a custom-menu-create form in
> > fortran.el, which causes a recursive evaluation of (load "fortran").

> That sounds like a misfeature we should address.

Yes.  The idea of a recursive load left me a bit shocked.  Fload bails
out with an error if the nesting of files it's loading has a file more
than three times in the stack.

> > What do people think of the following proposal: that the
> > eval-after-load forms should be evaluated only after the outermost
> > load has completed?  This would be a simple amendment to the function
> > Fload.

> I think it would only hide the problem and would make the specification
> of `eval-after-load` needlessly more complex.

I suppose it would.

> Recursive loading of a file should be rare and should always be
> considered as a bug/misfeature in itself, so I don't think we should
> take extra steps to try and better support it.

Maybe instead we could modify custom-menu-create such that it will only
require its target file if that file isn't currently being loaded.  If it
is currently being loaded, then we only include the customisable
variables that have already been defined.  This shouldn't be too much of
a hardship, since custom variables tend to be defined near the start of
a .el file, and the higher level functions which create the custom menu
tend to be nearer the end of the file.

What do you think?

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]