From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [elpa] externals/osm 05ac461360: Bail out earlier if dependencies are missing Date: Tue, 10 May 2022 21:53:27 -0400 Message-ID: References: <165221267003.11226.2207874159602256273@vcs2.savannah.gnu.org> <20220510195750.558C1C01683@vcs2.savannah.gnu.org> <04e511b4-f988-401b-92a4-32fce1b5e115@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38669"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Daniel Mendler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 11 03:54:20 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nobYS-0009ti-2k for ged-emacs-devel@m.gmane-mx.org; Wed, 11 May 2022 03:54:20 +0200 Original-Received: from localhost ([::1]:36928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nobYQ-00027w-ID for ged-emacs-devel@m.gmane-mx.org; Tue, 10 May 2022 21:54:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nobXl-0001Ls-DP for emacs-devel@gnu.org; Tue, 10 May 2022 21:53:37 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nobXi-0007Bg-6z for emacs-devel@gnu.org; Tue, 10 May 2022 21:53:35 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6F23544282D; Tue, 10 May 2022 21:53:30 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E787E44282C; Tue, 10 May 2022 21:53:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1652234008; bh=Do/8E5gthhfMI0SL2ggVOfcdJ8GbQ+9tIeekqJjUoVM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=nhqLD+Q4wnVet+l94I5pUNZrIWL4SuoI3j2OkTJlL9pCeUOh4Ofx3QQUqrC0VgKEw lTLC00e3/Qr5DiDYtLr5A52d1JbS7IpAOKdpCrDmPSlIgXeg3RFfJa0yZuLjx1bYfr E6DurlkJ1+LjZapXu3bwgbgho0ACdIZf3odhFYnyAfi+WecF56XFLCY6gS0hjMBoWv rMDKO8foZDZsRVrCIkjsPYVL5Wrgckq9CVR4lAmT3653uur3+nFVnv801oJptBFY6e tQoLHWWe/kRx75O5PLmyht6YHCWrLxJ0VjxW/Ce9BSK5DdiYqewQBPfXL831eowIJc /ax8Hv9M0W/wg== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AD4BC1202BB; Tue, 10 May 2022 21:53:28 -0400 (EDT) In-Reply-To: <04e511b4-f988-401b-92a4-32fce1b5e115@daniel-mendler.de> (Daniel Mendler's message of "Wed, 11 May 2022 00:07:31 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:289609 Archived-At: 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