unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Daniel Mendler <mail@daniel-mendler.de>
Cc: emacs-devel@gnu.org
Subject: Re: [elpa] externals/osm 05ac461360: Bail out earlier if dependencies are missing
Date: Tue, 10 May 2022 21:53:27 -0400	[thread overview]
Message-ID: <jwv35hgq1lq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <04e511b4-f988-401b-92a4-32fce1b5e115@daniel-mendler.de> (Daniel Mendler's message of "Wed, 11 May 2022 00:07:31 +0200")

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	other threads:[~2022-05-11  1:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165221267003.11226.2207874159602256273@vcs2.savannah.gnu.org>
     [not found] ` <20220510195750.558C1C01683@vcs2.savannah.gnu.org>
2022-05-10 21:00   ` [elpa] externals/osm 05ac461360: Bail out earlier if dependencies are missing Stefan Monnier
2022-05-10 22:07     ` Daniel Mendler
2022-05-11  1:53       ` Stefan Monnier [this message]
2022-05-11  6:34         ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv35hgq1lq.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=mail@daniel-mendler.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).