emacs-devel
[Top][All Lists]
Advanced

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

Re: [elpa] externals/osm 05ac461360: Bail out earlier if dependencies ar


From: Stefan Monnier
Subject: Re: [elpa] externals/osm 05ac461360: Bail out earlier if dependencies are missing
Date: Tue, 10 May 2022 21:53:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Daniel Mendler [2022-05-11 00:07:31] wrote:
> On 5/10/22 23:00, Stefan Monnier wrote:
>> Better not signal such errors when loading the file, since the file might
>> be loaded for all kinds of reasons beside running its code.  In some of
>> those cases it can get loaded in an Emacs batch session.
> I agree that the global check is a code smell. In this case I don't
> expect batch usage since we are talking about a mouse driven map
> display.

Again, I'm not talking about running the code.  I'm talking about
loading the file.  E.g. loading the file in order to find out which
functions or variables it defines (this can happen for example during
completion of `C-h o`).

> The alternative would be to replicate the check in all the
> entry points to the package, the osm-mode, the autoloaded osm-*
> commands, which would require more code.

The "right" place for such checks is as soon as you know that you *will*
definitely encounter an error.

When the file is being loaded, you don't know yet that an error is
inevitable because you don't know yet whether the loaded code will
be called.


        Stefan




reply via email to

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