From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74289: 30.0.92; `require-with-check' fails on non-existing files Date: Sun, 10 Nov 2024 12:38:51 -0500 Message-ID: References: <87ldxrbhse.fsf@daniel-mendler.de> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34353"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74289@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 10 18:40:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tABv8-0008ku-QK for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Nov 2024 18:40:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tABv0-0004E8-PE; Sun, 10 Nov 2024 12:40:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tABut-00049Z-8K for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 12:40:06 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tABus-0000x7-87 for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 12:40:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=BeYBCBNKCMVcXm1N+jYtLxs9s+DnXNuWI6H7WdG2cRw=; b=RBL9NwC3l/iigC2foowsiQJeHCFDaAH1AqSItQ2NDF968rw+ANxQgFCoMmuuh0+PmSIcQZ/K/06b/AkCsnqYuRWpZP2arPXtGYnPnMepjDj8MmzmDvfFayLc9sux6OqFEg2t2vq42bk1WaZy4XBQzfLRrvhmRtY2RV0fulDev6KoLSVG10bE0umN5Cq0c0WKyRG2A2wwLHCHsPB38zdDZDGjpGNuhST9YXYajsOVV+vwCwjfEsau4Rubyq+hCQMpzGWdp2ehmwVKm2EhUeyyLuLlOcwgJGHiLPBLHfSmlczzsovmpde+/lVz23YxYVeCOC0rYswIFuUFP8TN0g0pbg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tABus-0004ik-37 for bug-gnu-emacs@gnu.org; Sun, 10 Nov 2024 12:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Nov 2024 17:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74289 X-GNU-PR-Package: emacs Original-Received: via spool by 74289-submit@debbugs.gnu.org id=B74289.173126034218057 (code B ref 74289); Sun, 10 Nov 2024 17:40:02 +0000 Original-Received: (at 74289) by debbugs.gnu.org; 10 Nov 2024 17:39:02 +0000 Original-Received: from localhost ([127.0.0.1]:56479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tABtt-0004gz-OD for submit@debbugs.gnu.org; Sun, 10 Nov 2024 12:39:02 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:24515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tABtr-0004gg-K2 for 74289@debbugs.gnu.org; Sun, 10 Nov 2024 12:39:00 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 25FEC8099D; Sun, 10 Nov 2024 12:38:54 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1731260333; bh=9Ez7VWh+OjpXKQk7gzFbi6xgFNrIv7B7iECjAariea4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=b34Lu/232iWMZcBWyYh2DGwp37Ovy2mf2LxXQqZj0nkXR0KsGDeZtkBE1T0Bvu8fj HLZavDWvev7PoRg8nNaJiP/WHJ4GRCms7ylgIHh/+iyRmOP8hHPol+PWJgjXtNFPgz /nYkyTjjnuuVinf5xWaNsHMatnX9TM+7XlsjATjD0kk9H4KCuMwUDDTO+25LV6Q72c +pBEIOC+DP4R7QwxoKQfKeXJeMMNXwzmFCuey/xBm4I3hLpHMAtWVoQp3w+RZ27As1 mIvy/Q049OxNDgjHOYBIXXrFz4FXqXvOObqh+PVruQJ8aVQDwXGnkxx38TJaYiuUso vbclgp4fl5tvg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4831380964; Sun, 10 Nov 2024 12:38:53 -0500 (EST) Original-Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1BAEB12020C; Sun, 10 Nov 2024 12:38:53 -0500 (EST) In-Reply-To: <87ldxrbhse.fsf@daniel-mendler.de> (Daniel Mendler's message of "Sun, 10 Nov 2024 09:43:29 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295195 Archived-At: > `require-with-check' fails since > 0aae02a3741c397d6952e3128d434827aca0f912 on non-existing files. > > See the CI run of the Compat test suite: > > https://github.com/emacs-compat/compat/actions/runs/11763132765/job/32766767667 > > This call fails: > > (require-with-check 'compat-does-not-exist nil 'noerror) Oops, can you confirm that the patch below works for you? Stefan diff --git a/lisp/files.el b/lisp/files.el index c3fce9f15f9..0d998e6e18e 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1288,10 +1306,11 @@ require-with-check ;; we did load "it". (bug#74040) ;; So use a "permissive" search which doesn't pay attention to ;; differences between file extensions. - (prefix (if (string-match - (concat (regexp-opt (get-load-suffixes)) "\\'") fn) - (concat (substring fn 0 (match-beginning 0)) ".") - fn)) + (prefix (when fn + (if (string-match + (concat (regexp-opt (get-load-suffixes)) "\\'") fn) + (concat (substring fn 0 (match-beginning 0)) ".") + fn))) (lh load-history)) (while (and lh (let ((file (car-safe (car lh)))) (not (and file (string-prefix-p prefix file)))))