From unknown Thu Jun 19 16:24:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#74040 <74040@debbugs.gnu.org> To: bug#74040 <74040@debbugs.gnu.org> Subject: Status: `require-with-check` signals error for `project` Reply-To: bug#74040 <74040@debbugs.gnu.org> Date: Thu, 19 Jun 2025 23:24:31 +0000 retitle 74040 `require-with-check` signals error for `project` reassign 74040 emacs submitter 74040 Stefan Monnier severity 74040 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 26 23:15:46 2024 Received: (at submit) by debbugs.gnu.org; 27 Oct 2024 03:15:46 +0000 Received: from localhost ([127.0.0.1]:43417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4tkn-0002b4-Kl for submit@debbugs.gnu.org; Sat, 26 Oct 2024 23:15:45 -0400 Received: from lists.gnu.org ([209.51.188.17]:41032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4tkl-0002ZB-AX for submit@debbugs.gnu.org; Sat, 26 Oct 2024 23:15:44 -0400 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 1t4tkC-0002zh-Lh for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2024 23:15:08 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t4tkA-0003pZ-Ja for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2024 23:15:08 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C98CB4441A4 for ; Sat, 26 Oct 2024 23:15:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1729998902; bh=mtN1BTWKpqoaTmp7LBch/LOtwPoOEBQHdOvu6UNdFt8=; h=From:To:Subject:Date:From; b=KjM//ynlBZPyJ6bMvXNr9R69CbJoAtEJ0dP5/wNwoKW/+hkUTY3OHmoCd7SFl4fhp 55Kxtj4X3ifc+DdS+VQSm998URJdn6Ak91s/wpFfZT0LAkYUTkMYFegGtD9AQLGjxk TWIfGqC0xXELeFLM4wnOC9i2VtwfK3gifkl/klsi86JryF0ohpIYGrXcYRSbkkms54 FcFK+UmOWGicTcL0QE6k4CJQ4/WyadpOShHYTrVzGKHXqfLy0j5XHCR3Vf1jRx9ix5 eHKqx5lcwezSFu1EkF0JkkPGLfurqdvfK2Vck2nld3ZhBEWlZgxFkfmPlYzps+U7Pq EgsRU7i8fcYDA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 900F6444184 for ; Sat, 26 Oct 2024 23:15:02 -0400 (EDT) Received: from pastel (69-196-161-60.dsl.teksavvy.com [69.196.161.60]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 71282120406 for ; Sat, 26 Oct 2024 23:15:02 -0400 (EDT) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: `require-with-check` signals error for `project` Message-ID: X-Debbugs-Cc: monnier@iro.umontreal.ca Date: Sat, 26 Oct 2024 23:15:01 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.126 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Package: Emacs Version: 30.0.50 1. Customize `load-prefer-newer` to t. 2. Edit project.el in-tree, save it, don't recompile Emacs. 3. Restart Emacs. 4. Visit some code file and try to launch `M-x eglot` there. You should get an error along the lines of: require-with-check: Feature =E2=80=98project=E2=80=99 loaded from ".../lisp/progmodes/project.el" is now provided by ".../lisp/progmodes/project.elc" This error is spurious. AFAICT, it is due to the fact that `require-with-check` uses `locate-file` to "guess" which file `load` would use, but `locate-file` doesn't obey `load-prefer-newer`, so it guesses wrong. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 27 12:26:44 2024 Received: (at 74040) by debbugs.gnu.org; 27 Oct 2024 16:26:44 +0000 Received: from localhost ([127.0.0.1]:46011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t566G-0006WA-5L for submit@debbugs.gnu.org; Sun, 27 Oct 2024 12:26:44 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33255) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t566A-0006Vk-QC for 74040@debbugs.gnu.org; Sun, 27 Oct 2024 12:26:42 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E712980932; Sun, 27 Oct 2024 12:25:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1730046354; bh=vNts9pgU11MhfacLwgXz7xRaa3eiHmxOtnny2/ZgRGE=; h=From:To:Subject:In-Reply-To:References:Date:From; b=ZX6MA8Ml5GLgtKRcgOaGUbbEd7sVMqETW9GncG1TIppobjjfhbXmFJ0420LBsqPKr yvrFsv2NahT+2S6RkYWSFAFa8wVruLODtroKeJgAIt76I2KYI2P3mVz3dMnxQPDu3P aJD7zT07TNq8u9h1gPiXctW9N1zWZ9qmtNzXNx7WWSG6NZ1/j+NEYWp8EPhZoVtKV/ +jTM2OJRrKy9Bhm+RnwobaT54Ojm+caWMlxwku8UvpAhJkpfoRkXxpyzH9GiyvaXd+ ay3RsV81g269M8iTWQUxlJ5YHxtoNQFnSl56tmYLxXciUiDstDo0Ma7LEB0dG74o9Z JrsB94t9OVybg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 52D5D80762; Sun, 27 Oct 2024 12:25:54 -0400 (EDT) Received: from pastel (69-196-161-60.dsl.teksavvy.com [69.196.161.60]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 327C51201F9; Sun, 27 Oct 2024 12:25:54 -0400 (EDT) From: Stefan Monnier To: 74040@debbugs.gnu.org Subject: Re: bug#74040: `require-with-check` signals error for `project` In-Reply-To: (Stefan Monnier's message of "Sat, 26 Oct 2024 23:15:01 -0400") Message-ID: References: Date: Sun, 27 Oct 2024 12:25:53 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.046 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74040 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > 1. Customize `load-prefer-newer` to t. > 2. Edit project.el in-tree, save it, don't recompile Emacs. > 3. Restart Emacs. > 4. Visit some code file and try to launch `M-x eglot` there. > > You should get an error along the lines of: > > require-with-check: Feature =E2=80=98project=E2=80=99 loaded from > ".../lisp/progmodes/project.el" is now provided by > ".../lisp/progmodes/project.elc" > > This error is spurious. AFAICT, it is due to the fact that > `require-with-check` uses `locate-file` to "guess" which file `load` > would use, but `locate-file` doesn't obey `load-prefer-newer`, so it > guesses wrong. One approach is to expose the `prefer` option of `openp` to `locate-file` so we can use it in `require-with-check`, as in the patch below. Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=require-with-check.patch diff --git a/lisp/files.el b/lisp/files.el index a81f742bbb4..a67d34f81b2 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1039,7 +1039,7 @@ load-file (defvar comp-eln-to-el-h) -(defun locate-file (filename path &optional suffixes predicate) +(defun locate-file (filename path &optional suffixes predicate prefer-newer) "Search for FILENAME through PATH. If found, return the absolute file name of FILENAME; otherwise return nil. @@ -1057,7 +1057,10 @@ locate-file in which case file name handlers are ignored. This usage is deprecated. For compatibility, PREDICATE can also be one of the symbols `executable', `readable', `writable', or `exists', or a list of -one or more of those symbols." +one or more of those symbols. + +PREFER-NEWER, if non-nil, means to disregard the order of SUFFIXES and +return the most recently modified file instead." (if (and predicate (symbolp predicate) (not (functionp predicate))) (setq predicate (list predicate))) (when (and (consp predicate) (not (functionp predicate))) @@ -1065,7 +1068,7 @@ locate-file (logior (if (memq 'executable predicate) 1 0) (if (memq 'writable predicate) 2 0) (if (memq 'readable predicate) 4 0)))) - (locate-file-internal filename path suffixes predicate)) + (locate-file-internal filename path suffixes predicate prefer-newer)) (defun locate-file-completion-table (dirs suffixes string pred action) "Do completion for file names passed to `locate-file'." @@ -1278,7 +1281,8 @@ require-with-check (when (eq lh load-history) ;; If `require' did nothing, we need to make sure that was warranted. (let ((fn (locate-file (or filename (symbol-name feature)) - load-path (get-load-suffixes)))) + load-path (get-load-suffixes) nil + load-prefer-newer))) (cond ((assoc fn load-history) nil) ;We loaded the right file. ((eq noerror 'reload) (load fn nil 'nomessage)) diff --git a/src/lread.c b/src/lread.c index 854aaa784ad..6cc2e8b6349 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1793,7 +1793,7 @@ complete_filename_p (Lisp_Object pathname) && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2]))); } -DEFUN ("locate-file-internal", Flocate_file_internal, Slocate_file_internal, 2, 4, 0, +DEFUN ("locate-file-internal", Flocate_file_internal, Slocate_file_internal, 2, 5, 0, doc: /* Search for FILENAME through PATH. Returns the file's name in absolute form, or nil if not found. If SUFFIXES is non-nil, it should be a list of suffixes to append to @@ -1802,12 +1802,15 @@ DEFUN ("locate-file-internal", Flocate_file_internal, Slocate_file_internal, 2, PREDICATE can also be an integer to pass to the faccessat(2) function, in which case file-name-handlers are ignored. This function will normally skip directories, so if you want it to find -directories, make sure the PREDICATE function returns `dir-ok' for them. */) - (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_Object predicate) +directories, make sure the PREDICATE function returns `dir-ok' for them. +PREFER-NEWER, if non-nil, means to disregard the order of SUFFIXES and +return the most recently modified file instead. */) + (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, + Lisp_Object predicate, Lisp_Object prefer_newer) { Lisp_Object file; - int fd = openp (path, filename, suffixes, &file, predicate, false, true, - NULL); + int fd = openp (path, filename, suffixes, &file, predicate, + !NILP (prefer_newer), true, NULL); if (NILP (predicate) && fd >= 0) emacs_close (fd); return file; @@ -1886,7 +1889,7 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd, can't find even central .el files. */ if (NILP (Flocate_file_internal (build_string ("simple.el"), Vload_path, - Qnil, Qnil))) + Qnil, Qnil, Qnil))) return; Vdelayed_warnings_list = Fcons (list2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 27 12:44:13 2024 Received: (at 74040) by debbugs.gnu.org; 27 Oct 2024 16:44:13 +0000 Received: from localhost ([127.0.0.1]:46025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t56NB-0007GT-4A for submit@debbugs.gnu.org; Sun, 27 Oct 2024 12:44:13 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64459) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t56N8-0007GB-DR for 74040@debbugs.gnu.org; Sun, 27 Oct 2024 12:44:11 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4DB7C100180; Sun, 27 Oct 2024 12:43:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1730047408; bh=O7IjcLO0If/R6IVT2YqwarJfseGTOurf2nvs9rXxJXw=; h=From:To:Subject:In-Reply-To:References:Date:From; b=hexA5HFudh0mJdaQZGBOBp1yi7BIikYGhVJ1MPh3Y7tfD/pvYO6EHK5IcOxBlwERQ wYPG60e4j20sK05gVjP1AtLhwCF27dXXH0tvFKvaL4zZfEqbGXST7jo2Ojm0mPibVu w1OPEuoVP07I3eN/gqf4uumw+hDLWXhUz5ax5i8DEGGoRQDLIuXQnWoJJ+TIaL1/Bl Swd+fdXfNgatUcv8Khrfi93NrriczBQCd4bLkerAtD1iikt3TDIFqjeaiqMGDeoN7h 77SSCJn6t+Jy6WOyH7wF72fqBrA3KiatMArus0GFeBCT8K9pIHh4AywMxX8qu35/wh IujcxtnvI/8wA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7FCB810002E; Sun, 27 Oct 2024 12:43:28 -0400 (EDT) Received: from pastel (69-196-161-60.dsl.teksavvy.com [69.196.161.60]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 606E712005D; Sun, 27 Oct 2024 12:43:28 -0400 (EDT) From: Stefan Monnier To: 74040@debbugs.gnu.org Subject: Re: bug#74040: `require-with-check` signals error for `project` In-Reply-To: (Stefan Monnier's message of "Sun, 27 Oct 2024 12:25:53 -0400") Message-ID: References: Date: Sun, 27 Oct 2024 12:43:27 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.044 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74040 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain > One approach is to expose the `prefer` option of `openp` to > `locate-file` so we can use it in `require-with-check`, as in the > patch below. Another is to replace the `assoc` check with one that is more lenient, ignoring difference in file extensions. E.g. the patch below. This makes the change more localized, at the cost of making `require-with-check` slower and less strict. WDYT? Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=require-with-check.patch diff --git a/lisp/files.el b/lisp/files.el index a81f742bbb4..a5177250f45 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1277,10 +1280,19 @@ require-with-check ;; file, so we're done. (when (eq lh load-history) ;; If `require' did nothing, we need to make sure that was warranted. - (let ((fn (locate-file (or filename (symbol-name feature)) - load-path (get-load-suffixes)))) + (let* ((fn (locate-file (or filename (symbol-name feature)) + load-path (get-load-suffixes) nil + )) ;; load-prefer-newer + (fn (if (string-match + (concat (regexp-opt (get-load-suffixes)) "\\'") fn) + (concat (substring fn 0 (match-end 0)) ".") + fn)) + (lh load-history)) + (while (and lh (let ((file (car-safe (car lh)))) + (not (and file (string-prefix-p fn file))))) + (setq lh (cdr lh))) (cond - ((assoc fn load-history) nil) ;We loaded the right file. + (lh nil) ;We loaded the right file. ((eq noerror 'reload) (load fn nil 'nomessage)) ((and fn (memq feature features)) (funcall (if noerror #'warn #'error) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 27 17:25:42 2024 Received: (at 74040) by debbugs.gnu.org; 27 Oct 2024 21:25:42 +0000 Received: from localhost ([127.0.0.1]:46581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5Ala-0003Xh-BL for submit@debbugs.gnu.org; Sun, 27 Oct 2024 17:25:42 -0400 Received: from mail-ed1-f48.google.com ([209.85.208.48]:47587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5AlX-0003XV-6B for 74040@debbugs.gnu.org; Sun, 27 Oct 2024 17:25:40 -0400 Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5cb72918bddso4817302a12.3 for <74040@debbugs.gnu.org>; Sun, 27 Oct 2024 14:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730064243; x=1730669043; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=p4o1xgZ/7r7uD9mgAYL49L414uD5xRHXsZ2rsQvHejI=; b=Owf8Sd0lR9P7ZA9wKy6EdrZIZkaXw6a69AX/c+NI1VLLQt5Nrv+Oyipg7lkr3d1WN2 iDLCKjhia5iD790NarD23VFywxmO+BQyhryL7sev4LkbOjiaY24AvCjhxKhWdQqf7Z1H LIqN/nE5OmtVt9sidObms/tBvr6gE5egdFaca5RHcPpMJPaybRcSfQpNngIVP2mHFAY8 pwk3086kSAFTC0eIDWJWVW54O0z3dcgxJSapdFRQgnKVRdlVKTMSqzfSYNbcTRkNp++2 f8sCE3YtuQ5PlWUod2ZTAyGEPuwHREIS3Cx0aBaUg1Rk23sGpHNasIxAWg6K0VxEXf8j TE5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730064243; x=1730669043; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=p4o1xgZ/7r7uD9mgAYL49L414uD5xRHXsZ2rsQvHejI=; b=LVilTzzbek5asFTU6esDPTDTPgM7ItVjtAqEeJyHDkNiDG7ajMa516Qs/3Iqa1cQuk a4zWdya8DoVFpzcSxSXKyIZMQYyaiK95NN14BjBTOkacmsQxtQpm5jgcCQAD9NQMq5+G /OWHlfgLpALIyVMwrBBrwbFQ4swqMgoAfWpRAdnl46OA+qdDluwDb72aFxmF2mrf5yrm IIrvu1TOLWuR1NwLMfD3kBKFWSup8Mhg9J75ovgtCUEjtGa0FvHxTMOgffUg3W5JbOaC JJ+6PXb5ImbmJmcc6ksBq2kwUpSnIPYU0TYSsg/l0dpk5tXDdrTIPGIqLK+bWb2aAhl2 tecA== X-Forwarded-Encrypted: i=1; AJvYcCVcNgv5NRV3SWvPO2wFW9c57peIx0mkxhEjlNfWCu1M1p4rjCkxZq32ixweu8BA2ykKwzblGA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzMVfpcyddT5NBAM8Y4aM/Ejq6ZfKBGODB3gcU93TAf3CfEPm7X ndF3zaPUs1K5/xga3Ce1snd/Pft8Ebx5Hl5V/urO4GSsAsYBNmkVC+cn6PW9NvAOIq5lCVtQGt3 SFndEMaFN/yxkebjO1L1NJo4YuEOJFQ== X-Google-Smtp-Source: AGHT+IGc7AtwkvLAbbkpBYqzMuQC+yobYhyOqjnbLHJBrDfeFCR26L171G2wnFXJMN9wambMPz6xstvKKUitnEVBLeQ= X-Received: by 2002:a05:6402:40cf:b0:5cb:6158:cae9 with SMTP id 4fb4d7f45d1cf-5cbbf8863b8mr4291466a12.6.1730064242666; Sun, 27 Oct 2024 14:24:02 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 27 Oct 2024 14:24:01 -0700 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Sun, 27 Oct 2024 14:24:01 -0700 Message-ID: Subject: Re: bug#74040: `require-with-check` signals error for `project` To: Stefan Monnier , 74040@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74040 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: >> One approach is to expose the `prefer` option of `openp` to >> `locate-file` so we can use it in `require-with-check`, as in the >> patch below. > > Another is to replace the `assoc` check with one that is more lenient, > ignoring difference in file extensions. E.g. the patch below. > This makes the change more localized, at the cost of making > `require-with-check` slower and less strict. Either patch is fine by me, but having the change more localized is certainly nice. Do you have any other use case in mind for the new PREFER-NEWER argument of `locate-file` than `require-with-check`? If not, perhaps we should avoid making it more complex? From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 28 22:42:29 2024 Received: (at 74040-done) by debbugs.gnu.org; 29 Oct 2024 02:42:29 +0000 Received: from localhost ([127.0.0.1]:55365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5cBg-0003Ae-MG for submit@debbugs.gnu.org; Mon, 28 Oct 2024 22:42:28 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5cBd-0003AO-7s for 74040-done@debbugs.gnu.org; Mon, 28 Oct 2024 22:42:26 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7770880964; Mon, 28 Oct 2024 22:42:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1730169737; bh=UCwXBznxfU37GDmBWf8veE9T3BEOya59uG8jesB/ut8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=a9PTwez2hXAgmr/XMgN9FxWGzu3E2MVazZmWBqkkA4d8v0bzpR7Qe4cAefFcG2l0+ QqUJy57K9O6NIo1hIFvVYHx5c9feWjsECZIh7Y1E1IAjnadXUbF/zHN90orQuPC8N+ 2DQ2lEFk7FtYNr5UXsfMYbfBaW9D16qFMTst41d+PBiV0RWURu9c0cXGz4esWdP+4U r2HIylthXDaJdFZHdbjmcCCVugf8oUwwwXdNH6HhA9Yzl02qwizGWW2DQ1m+iTmPzy c7bfngjQM2pHaGv7CU9c11DkR+DaOg9n6E/UUeO0dMwdtC08Rl0NHMxr7IAGngw0mO 5p6EWc8ASltAg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B174480164; Mon, 28 Oct 2024 22:42:17 -0400 (EDT) Received: from pastel (69-196-161-60.dsl.teksavvy.com [69.196.161.60]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 48873120434; Mon, 28 Oct 2024 22:42:17 -0400 (EDT) From: Stefan Monnier To: Stefan Kangas Subject: Re: bug#74040: `require-with-check` signals error for `project` In-Reply-To: (Stefan Kangas's message of "Sun, 27 Oct 2024 14:24:01 -0700") Message-ID: References: Date: Mon, 28 Oct 2024 22:42:16 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.038 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74040-done Cc: 74040-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Either patch is fine by me, but having the change more localized is > certainly nice. Agreed. > Do you have any other use case in mind for the new PREFER-NEWER argument > of `locate-file` than `require-with-check`? If not, perhaps we should > avoid making it more complex? In principle, it's nice to be able to reproduce *exactly* the search performed by `load` and `require`, but in practice, I don't have any real use case, no. I pushed the more localized patch (after fixing it so it actually works). Stefan From unknown Thu Jun 19 16:24:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 26 Nov 2024 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator