From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Dave Abrahams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Jun 2023 22:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 64198@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16873002785155 (code B ref -1); Tue, 20 Jun 2023 22:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jun 2023 22:31:18 +0000 Received: from localhost ([127.0.0.1]:60126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBjsb-0001L4-Ug for submit@debbugs.gnu.org; Tue, 20 Jun 2023 18:31:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:57862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBjsZ-0001Kw-Rt for submit@debbugs.gnu.org; Tue, 20 Jun 2023 18:31:16 -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 1qBjsZ-0003bC-M3 for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2023 18:31:15 -0400 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBjsW-0000kd-Om for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2023 18:31:14 -0400 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-19a427d7b57so3499206fac.2 for ; Tue, 20 Jun 2023 15:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boostpro-com.20221208.gappssmtp.com; s=20221208; t=1687300270; x=1689892270; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=jSCyLAiqpqE45vkBL4p8oCWhWlDyYRgK4FwLIR3fQnA=; b=4uS2ZLasNIhVMxUri4jWZp7tj847J3mgGc+HhkU1Qlvjtyi0P7YYXcXyZtorLD/1Qb Ds8Up74buS9Q9/yVH9hP216P/Og858dx2okYpHhDYjoqSmED1LA+ESCofp5KGL0DcRBl AxSQOEXkrkxQNIMv4NuI6ufC3fos75utMRyD0BJzOjVdlQirYc2hcCI15hV6XZ6rqj90 0K+NR1rg1nYpQceUaOMEwkd/M4umZMDy7Q99prJO6XLiYVdMgttvu6AXA2pVjRAu5UxC 3AHBeO9Wc6oQiOqut55r/mg/9FstER98tjYkMylgmZC8j7zrJY5+eg2Rwz2w5qLJM1ei 0VeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687300270; x=1689892270; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jSCyLAiqpqE45vkBL4p8oCWhWlDyYRgK4FwLIR3fQnA=; b=DW/Q/YuY32n3yTCu37glZ+mwoMMp8DWWm+4faThsnXdv/CWn8cg9rpZH3DmOsw4Y7g QfPOH/3HowBYFrHH0P35Q7ijcC0pAyNgvTe6cd3y6V39OnIYK769YO4rdAY4EBKgmCi6 FKhufId+LPKMlZSyEveExI6Zt/juHM1LGa4hzkTqnjQO57Az+RMSEmtuZ2ox9TmKCSoi r7lwfpUGk+aJPjy0yV52ulJMmxdZNWcTteemdZS1s+5LcZR9jUwTKaSrExY2Xr51dC1b 1kSN+zHB24ciqz13/Ly3g7RUDCrMByW/ibtg72JmrtmaPSK6kCEJcUXWZS1fWKJ5Ge5n rqrA== X-Gm-Message-State: AC+VfDxu5ovLSt5CTCnj5vteDi9wS27x9P1ZCdvpyqHLUV1xPEgVFXWZ h8fHZN5QB+PDZhCnONCIS8rAnRWCkyywCY2snMs= X-Google-Smtp-Source: ACHHUZ5szXtZmKBzfEyShj6OBeiymKNsGtxCC7H5RZ+waUJ3Nv6aYmb6ULqHEvW/JrTDqub3rq0F/g== X-Received: by 2002:a05:6871:616:b0:1ad:544:f643 with SMTP id w22-20020a056871061600b001ad0544f643mr1066931oan.14.1687300269724; Tue, 20 Jun 2023 15:31:09 -0700 (PDT) Received: from smtpclient.apple (69-209-31-205.lightspeed.sntcca.sbcglobal.net. [69.209.31.205]) by smtp.gmail.com with ESMTPSA id c204-20020a814ed5000000b0057060bb2874sm748601ywb.37.2023.06.20.15.31.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2023 15:31:09 -0700 (PDT) From: Dave Abrahams Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Message-Id: Date: Tue, 20 Jun 2023 15:30:58 -0700 X-Mailer: Apple Mail (2.3731.600.7) Received-SPF: none client-ip=2001:4860:4864:20::34; envelope-from=dave@boostpro.com; helo=mail-oa1-x34.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) 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 (---) [I hope this is the right venue for feature requests. If not, sorry!] When a file can't be found via the path given in a diagnostic, I'd like = to be able to override the prompt that emacs gives to locate the file. = compilation-parse-errors-filename-function happens too early, while the = buffer is being initially parsed. A similar = compilation-locate-file-function would be great. If there's interest I = could try to develop a patch.= From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Jun 2023 11:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dave Abrahams Cc: 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.16873466695264 (code B ref 64198); Wed, 21 Jun 2023 11:25:01 +0000 Received: (at 64198) by debbugs.gnu.org; 21 Jun 2023 11:24:29 +0000 Received: from localhost ([127.0.0.1]:60768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBvwq-0001Mq-M8 for submit@debbugs.gnu.org; Wed, 21 Jun 2023 07:24:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBvwo-0001MX-E2 for 64198@debbugs.gnu.org; Wed, 21 Jun 2023 07:24:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBvwf-0000Ig-IW; Wed, 21 Jun 2023 07:24:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=yurkDmh40J/JhycNyfNYyOgU+TuhusabpkyDxWpJFgs=; b=NNojFzWcCQjo JMvZufuQeA9zYcwb1eCb3kdj4lL7IeP/xf8O8t1Du9yUmbVGgDSNGf/MA3NLuFaQ0EESHuWCdvqJh UpjGq3t9j4UvbzOvSBhtu4zdSKFW/4n5kneDl2bu1+DJg6IgOXrjLng8RTmEKCUp+0KZfXs7Oc8qr aI4fPW1/3o/a7UIzYXcpd3JMCXliIspCytdsr2MWocn0VfLEvnH/pEz1TO024dORJlpBbaZyVzf3a IVdZJsJO+CzGS5TdM1nq/g0l15BZLsQn2YrknBo0fQpLKqZqkEWB7OlVWF/sxhgMAIKMLHH6zuPZz mzzCGWPYyT5JB5U2DgoEfg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qBvwW-000801-BJ; Wed, 21 Jun 2023 07:24:17 -0400 Date: Wed, 21 Jun 2023 14:24:14 +0300 Message-Id: <837crx5a8x.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dave Abrahams on Tue, 20 Jun 2023 15:30:58 -0700) References: X-Spam-Score: -2.3 (--) 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 (---) > From: Dave Abrahams > Date: Tue, 20 Jun 2023 15:30:58 -0700 > > [I hope this is the right venue for feature requests. If not, sorry!] This is the right place. > When a file can't be found via the path given in a diagnostic, I'd like to be able to override the prompt that emacs gives to locate the file. compilation-parse-errors-filename-function happens too early, while the buffer is being initially parsed. A similar compilation-locate-file-function would be great. If there's interest I could try to develop a patch. Before discussing patches, could you please describe your situation? Specifically, how does it happen that neither the compilation directory plus the file name shown by the diagnostics nor the search of compilation-search-path succeed to locate the file? And what would the hook function you suggest adding do to resolve this, i.e. how would it know where to look for the file? Thanks. From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Dave Abrahams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Jun 2023 16:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.168736376911208 (code B ref 64198); Wed, 21 Jun 2023 16:10:01 +0000 Received: (at 64198) by debbugs.gnu.org; 21 Jun 2023 16:09:29 +0000 Received: from localhost ([127.0.0.1]:34139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qC0Oe-0002uh-Jj for submit@debbugs.gnu.org; Wed, 21 Jun 2023 12:09:28 -0400 Received: from mail-ot1-f54.google.com ([209.85.210.54]:49553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qC0Oc-0002uT-A2 for 64198@debbugs.gnu.org; Wed, 21 Jun 2023 12:09:26 -0400 Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6b5d57d7db9so398527a34.3 for <64198@debbugs.gnu.org>; Wed, 21 Jun 2023 09:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boostpro-com.20221208.gappssmtp.com; s=20221208; t=1687363760; x=1689955760; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=Gx7xRNC79PFcohDAvwKjCsVlppbbXPa9n5q2ZCzmORQ=; b=T+HO2e8LHwCmJlMrqgsPZsheeGO4rgqoCvwU+JLGlQhR6AQz8TmcI6yH8rwONSKnMV zqcWDQpK9LPRYzKB8H5KTUv7Urg41y1ZkhUPHx524jQvEWnVNSPE3g3ws5mO4rQHvueQ xp3Zpu79ciQyLJNPnSip5s6SPkO3m5XO8AdSAFtSHeuvg9MeXxKMD8d/OVqYJGOBnOa7 FEYpZPkY8lO4HS6r5qbXwkGuUhito9VrMrvsL5+9Wv1P5MYWHjplellwjYEeH2HIjSDa WDs+RQkcuL9qoQuib59RUVuxI05bkX+Jlne3qJ1ST98FOaq4yW6zTcsPLIov/F8otK3l ik+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687363760; x=1689955760; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Gx7xRNC79PFcohDAvwKjCsVlppbbXPa9n5q2ZCzmORQ=; b=AQ/LUNK42uQo4hnpltKTzr9BXQgd5ow0QQuV3EQ1cADWQ0fvZHG7yQMBIbiXGAaWIj FDFMljOyBfeygAlh1xgDl2L1KRXbh6FnLrgXa918uPlgGqMhdYe5cBxPnVLuCbKTF9kl Zunu6HZVKrxNItlwOvY4AF2EdaRIrTlLsE2zdpKecA4X0/D4xNkvqt2VlyjExs6FJaWN PSz2uMw4Of5WCHcm/79sTLqtmauil0cyJz4vphY4jQci+O+CmNeRpzC72gQpgmW6wBc5 AKNBRMfNRltUr7AYe/+ABT0WKYY/eJ28gy/sulNm8DOO+09a2gOefPJggACp2kPQJ4cp JoJw== X-Gm-Message-State: AC+VfDxLwB7CFr1CXsuyGMgBeXoY4wXWLz+tK0PCYXGDuQBPHl/WY1HJ pi2EDCHru5r/tyH3qIQ1z//Smg== X-Google-Smtp-Source: ACHHUZ5PDXqxcnR7v34cmakU/ErF/2/XPHlkJZ+Ktqo1CayCtD3pE06ImoUaR3aDQk7WGirlLHiD0g== X-Received: by 2002:a05:6358:704f:b0:12b:dd2b:f170 with SMTP id 15-20020a056358704f00b0012bdd2bf170mr7399705rwp.27.1687363760174; Wed, 21 Jun 2023 09:09:20 -0700 (PDT) Received: from smtpclient.apple (69-209-31-205.lightspeed.sntcca.sbcglobal.net. [69.209.31.205]) by smtp.gmail.com with ESMTPSA id b65-20020a816744000000b0056183cdb2d9sm1195297ywc.60.2023.06.21.09.09.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2023 09:09:19 -0700 (PDT) From: Dave Abrahams Message-Id: <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_868CB592-7A88-44BB-AD9C-49A4490AF95F" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Date: Wed, 21 Jun 2023 09:09:08 -0700 In-Reply-To: <837crx5a8x.fsf@gnu.org> References: <837crx5a8x.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Score: 0.0 (/) 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 (-) --Apple-Mail=_868CB592-7A88-44BB-AD9C-49A4490AF95F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 21, 2023, at 4:24 AM, Eli Zaretskii wrote: >=20 >> From: Dave Abrahams >> Date: Tue, 20 Jun 2023 15:30:58 -0700 >>=20 >> [I hope this is the right venue for feature requests. If not, = sorry!] >=20 > This is the right place. >=20 >> When a file can't be found via the path given in a diagnostic, I'd = like to be able to override the prompt that emacs gives to locate the = file. compilation-parse-errors-filename-function happens too early, = while the buffer is being initially parsed. A similar = compilation-locate-file-function would be great. If there's interest I = could try to develop a patch. >=20 > Before discussing patches, could you please describe your situation? > Specifically, how does it happen that neither the compilation > directory plus the file name shown by the diagnostics nor the search > of compilation-search-path succeed to locate the file? And what would > the hook function you suggest adding do to resolve this, i.e. how > would it know where to look for the file? When Swift asserts, it doesn't write the path to the file into the = output, because=E2=80=A6 reasons I grudgingly accept. So one needs to = guess at the file. https://github.com/apple/swift/issues/66777 contains = all the details, but if you want additional info, please ask.= --Apple-Mail=_868CB592-7A88-44BB-AD9C-49A4490AF95F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Jun = 21, 2023, at 4:24 AM, Eli Zaretskii <eliz@gnu.org> wrote:

From: Dave Abrahams <dave@boostpro.com>
Date: = Tue, 20 Jun 2023 15:30:58 -0700

[I hope this is the right venue = for feature requests.  If not, sorry!]

This is = the right place.

When a file can't be = found via the path given in a diagnostic, I'd like to be able to = override the prompt that emacs gives to locate the file. =  compilation-parse-errors-filename-function happens too early, = while the buffer is being initially parsed.  A similar = compilation-locate-file-function would be great.  If there's = interest I could try to develop a patch.

Before = discussing patches, could you please describe your = situation?
Specifically, how does it happen that neither the = compilation
directory plus the file name shown by the diagnostics nor = the search
of compilation-search-path succeed to locate the file? =  And what would
the hook function you suggest adding do to = resolve this, i.e. how
would it know where to look for the = file?

When Swift asserts, it = doesn't write the path to the file into the output, because=E2=80=A6 = reasons I grudgingly accept.  So one needs to guess at the file. =  https://github.com/ap= ple/swift/issues/66777 contains all the details, but if you = want additional info, please ask.
= --Apple-Mail=_868CB592-7A88-44BB-AD9C-49A4490AF95F-- From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Jun 2023 21:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Dave Abrahams , 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.168738436218161 (code B ref 64198); Wed, 21 Jun 2023 21:53:01 +0000 Received: (at 64198) by debbugs.gnu.org; 21 Jun 2023 21:52:42 +0000 Received: from localhost ([127.0.0.1]:34325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qC5ko-0004ir-JG for submit@debbugs.gnu.org; Wed, 21 Jun 2023 17:52:42 -0400 Received: from thaodan.de ([185.216.177.71]:46696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qC5kl-0004ih-Pk for 64198@debbugs.gnu.org; Wed, 21 Jun 2023 17:52:41 -0400 Received: from odin (dsl-trebng12-50dc76-249.dhcp.inet.fi [80.220.118.249]) by thaodan.de (Postfix) with ESMTPSA id E88E3D08DA2; Thu, 22 Jun 2023 00:52:37 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1687384358; bh=+nrYU3NtupEHyjTc10vCKpk279IXgGvc5BiojPpAa8o=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=0KavNCL4m3wxc7gmYp3OWbsm0A7ZV6g0fwbzz9NQbS3dVp17PbnDKUjrS1GeG8j3o 4Wo6hRGyo9FXv3bQf4hNVuONJKIq8h3nK3onBA1J12fzvXMB5K4o//9Q3wqO/ZpiJV FRRVkfziNSpRBRHAWXtPhxS9Tu6RBdInjwWPHXd1WVd/N9dlbk1yz+5V3Lo7eo/9sa NAMWFuTT81IR4tYngrtU2FpRISB+m91EguOhqHOwUobaOWewdrxURapBIQ4HJ3YYbP 5rrTaST058q06QIFATcTIrCEk9nrCtyCueQI1kFHMtx0P6R5FK6ZeDxOGOUrndaZqS JMIiN5WbtLkqfbL5XGbQdOYwMFjJ50OC6ZHRzl6rpi0YD4GHGTJrObohcYJql60JBs EIy1RqagXeLPOBV3URMXKSK7wDOy1N+iwOhrHiF1UFMrPB5KbfkOWevhGIY1Z/SNf+ MnxcLGczeQzxBEwfC23FjXnvP7mK3p7pEIM7uNLkqKZDNkupepwvf+VtfmLiKUy1OK 3t5Qq5d60Iq24Rzu+mKLjhu5/wYzeVRmBEmgflLbqMQirRuQkIP3szdDoIomI+rhjN HCOcGxO1gGI6KE8Bx0W3vRTUsqjR9pPvFubwUIFaKLXMZc6E0NtTxDkycp6qOu0XbK kpZmoeft9iTOmRal8zSxvOPQ= From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar In-Reply-To: <837crx5a8x.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 21 Jun 2023 14:24:14 +0300") References: <837crx5a8x.fsf@gnu.org> Date: Thu, 22 Jun 2023 00:52:36 +0300 Message-ID: <87mt0so53v.fsf@thaodan.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) 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 (-) Eli Zaretskii writes: >> When a file can't be found via the path given in a diagnostic, I'd >> like to be able to override the prompt that emacs gives to locate >> the file. compilation-parse-errors-filename-function happens too >> early, while the buffer is being initially parsed. A similar >> compilation-locate-file-function would be great. If there's >> interest I could try to develop a patch. > > Before discussing patches, could you please describe your situation? > Specifically, how does it happen that neither the compilation > directory plus the file name shown by the diagnostics nor the search > of compilation-search-path succeed to locate the file? And what would > the hook function you suggest adding do to resolve this, i.e. how > would it know where to look for the file? I'm not the original requester but for cross compilation this could be useful. E.g I compile Sailfish OS RPM packages with mb2 which runs rpmbuild in scratchbox2. The patches in the output come from the command line output that is the same as if it was ran outside of the cross compilation target however it should resolve through the target rather than the host unless it is sourced from the very same package that I compile right now. E.g. /usr/include/stdio.h should be resolved to -> /srv/mer/sailfishos-devel-aarch64/usr/include. When building with open build service the situation is very similar. From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jun 2023 04:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Cc: dave@boostpro.com, 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.168740965129993 (code B ref 64198); Thu, 22 Jun 2023 04:55:01 +0000 Received: (at 64198) by debbugs.gnu.org; 22 Jun 2023 04:54:11 +0000 Received: from localhost ([127.0.0.1]:34550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCCKg-0007nh-O0 for submit@debbugs.gnu.org; Thu, 22 Jun 2023 00:54:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCCKd-0007nN-Lu for 64198@debbugs.gnu.org; Thu, 22 Jun 2023 00:54:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCCKX-0004rl-9N; Thu, 22 Jun 2023 00:54:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=JXA4vd7Hg2oc5o2cZLTqmnZTMw0K/LZ6l3xk7t88nAg=; b=XyRtm+lXphQumk9ezQ4g ZtjQHl3l/vb4ZO/UeaEizLEu5FThXEjwozl2DJQjR3t8RjTiESKSAdKXcmM/FLiqHv74t4IjM1yy/ GwAb310Ixo36BhmqGOTI+MqqL8C60ZqMk3gDLPGuf7JBlHzvotZOmCv1+WxBAFU/9XczfBosHlE6I wbL+mOtRImg9MUUYb8yIVcMIHasjSegMJ4PXxOmGAmFRPPIY5rzs5lghQ/yNKOU3Twi/NAxfihb2I /VgT65A2CFWXKkU1vAxYjXqdIirnnD8NtTJIe+JhtqRb565BvfG/kAJ5K1UHQ/cMhGSWylYTHas8Q BTyWj0EIWVTz4A==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCCKW-0008RU-17; Thu, 22 Jun 2023 00:54:01 -0400 Date: Thu, 22 Jun 2023 07:54:11 +0300 Message-Id: <83bkh83xn0.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87mt0so53v.fsf@thaodan.de> (message from =?UTF-8?Q?Bj=C3=B6rn?= Bidar on Thu, 22 Jun 2023 00:52:36 +0300) References: <837crx5a8x.fsf@gnu.org> <87mt0so53v.fsf@thaodan.de> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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 (---) > From: Björn Bidar > Cc: Dave Abrahams , 64198@debbugs.gnu.org > Date: Thu, 22 Jun 2023 00:52:36 +0300 > > Eli Zaretskii writes: > > >> When a file can't be found via the path given in a diagnostic, I'd > >> like to be able to override the prompt that emacs gives to locate > >> the file. compilation-parse-errors-filename-function happens too > >> early, while the buffer is being initially parsed. A similar > >> compilation-locate-file-function would be great. If there's > >> interest I could try to develop a patch. > > > > Before discussing patches, could you please describe your situation? > > Specifically, how does it happen that neither the compilation > > directory plus the file name shown by the diagnostics nor the search > > of compilation-search-path succeed to locate the file? And what would > > the hook function you suggest adding do to resolve this, i.e. how > > would it know where to look for the file? > > I'm not the original requester but for cross compilation this could be > useful. E.g I compile Sailfish OS RPM packages with mb2 which runs > rpmbuild in scratchbox2. > > The patches in the output come from the command line output that is the > same as if it was ran outside of the cross compilation target however it > should resolve through the target rather than the host unless it is > sourced from the very same package that I compile right now. > > E.g. /usr/include/stdio.h should be resolved to -> > /srv/mer/sailfishos-devel-aarch64/usr/include. And you cannot use compilation-search-path for achieving that result? From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jun 2023 17:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dave Abrahams Cc: 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.168745334620986 (code B ref 64198); Thu, 22 Jun 2023 17:03:02 +0000 Received: (at 64198) by debbugs.gnu.org; 22 Jun 2023 17:02:26 +0000 Received: from localhost ([127.0.0.1]:36606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCNhR-0005SO-W2 for submit@debbugs.gnu.org; Thu, 22 Jun 2023 13:02:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCNhP-0005S9-79 for 64198@debbugs.gnu.org; Thu, 22 Jun 2023 13:02:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCNhJ-0005q9-Pc; Thu, 22 Jun 2023 13:02:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=W8rFZlZi1y6D0A69aA//CSUBGKwn7RQxM3gsu0SYzAI=; b=H3v1vh5NAlqo0fAinTBH YrM2TXYC5NzYuQH1dT/6XhHT1OeEsJn1lxZZVwp0181a5niS8oaMgeVV8wLCkcerx8oELjry8AcU6 yTVlonYfwgMTsRHfHbpG7manS++HjyY4u8gxfhb8ftJ2pG+3sd1j33wy3jAM5SeWDtnaWDSdtIhdK DHTZlSlYkU0OzCv2k5B5fcO62uG9rIgHBjPm8nb0BG6IOsJ7IE6qGQSHV0RrrwTN4tsFT7WO49+XG PEe1bTH75CberE/GVjg5yJdNkxKP3c1A6mu8RweaY8PHPWJZhvxcGfm2m62umH2MMtYyKBFkvi2eA FH/6KbMH7W7O2w==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCNhJ-0004Jy-9u; Thu, 22 Jun 2023 13:02:17 -0400 Date: Thu, 22 Jun 2023 20:02:29 +0300 Message-Id: <83ilbf2zx6.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> (message from Dave Abrahams on Wed, 21 Jun 2023 09:09:08 -0700) References: <837crx5a8x.fsf@gnu.org> <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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 (---) > From: Dave Abrahams > Date: Wed, 21 Jun 2023 09:09:08 -0700 > Cc: 64198@debbugs.gnu.org > > Before discussing patches, could you please describe your situation? > Specifically, how does it happen that neither the compilation > directory plus the file name shown by the diagnostics nor the search > of compilation-search-path succeed to locate the file? And what would > the hook function you suggest adding do to resolve this, i.e. how > would it know where to look for the file? > > When Swift asserts, it doesn't write the path to the file into the output, because… reasons I grudgingly > accept. So one needs to guess at the file. https://github.com/apple/swift/issues/66777 contains all the > details, but if you want additional info, please ask. I don't know what Swift is, and that issue talks about something called #fileID, which I again have no idea about. So yes, please do elaborate, and TIA. From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Dave Abrahams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jun 2023 17:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.168745391222094 (code B ref 64198); Thu, 22 Jun 2023 17:12:02 +0000 Received: (at 64198) by debbugs.gnu.org; 22 Jun 2023 17:11:52 +0000 Received: from localhost ([127.0.0.1]:36624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCNqa-0005kH-63 for submit@debbugs.gnu.org; Thu, 22 Jun 2023 13:11:52 -0400 Received: from mail-yw1-f172.google.com ([209.85.128.172]:47374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCNqW-0005jf-Nk for 64198@debbugs.gnu.org; Thu, 22 Jun 2023 13:11:49 -0400 Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-5702116762fso78824017b3.3 for <64198@debbugs.gnu.org>; Thu, 22 Jun 2023 10:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boostpro-com.20221208.gappssmtp.com; s=20221208; t=1687453901; x=1690045901; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=H8wgNZMHmmzDk8Q1wnbKtS/AWEMwDjmjE0Q3yuN84cI=; b=2CoWgNCFie+2WWMsqdKOsxXvvwp/zb9SYDxNF/ofxT9V14PRoFOepZ/zJLqw68+q4l XXMC/t9qpS+vzHTBcFrJgvwhaRO1fk1EC9Ns9EoEdCb3ACvVO9vaehJQEIlR72l13XJf vIMGgmPOVVQFm1u37dzrY6EgRYBr6l8KS6zkvpbfw7P+spj/qLZJfVVTs06i7qWvBany 3vwfwCtseg7HcMZo7q2g64J+4pOv5c6Rkq6XcOTt/Q40sZZlEhf2Tsak75BUlcwH3qY+ 7sQclkM5Q8VHU8AFyBGtqdBFua1i9vXAWCPRTCl3VdraQq7vOszmcSKstgp4Ud4zg1BR Kkqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453901; x=1690045901; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H8wgNZMHmmzDk8Q1wnbKtS/AWEMwDjmjE0Q3yuN84cI=; b=KpmL3N4xJSsUUwxkJKuqI2xtm5yvxtgiIC3djIUX2qPfytgp4gBSfskAe3tNxQ2wK9 /zAlBSdrfHg6lSoqq/Odt2rpEl4b/4fFFZ9ZTGmN63lEJwRCjKAinUCtmnJf4p2vBqHq fQmq04bFWl+Jz4F4IaUXkb/HFfH9XCR3XXk9FhlsxLQgYHoJAzB1p72T9Rg/U53jzq// b74ol7IEDgZkS60p8vxan75B31UBEDScMvLWIN408oLbbJcGtpK47nPo+HPV6X5nKF7t PfniTH6gJ6RCOE4jGVJn1/tg4uBGevbae/adtYbk8bLeLKwiKilcjpP9PzM8zlgpD4Oa ljNQ== X-Gm-Message-State: AC+VfDyQWcEaGj/yAjYkHRenKyEOvRpFriwI7DiKTG8mvuTLp83gs5U1 G7VZbl9RkMb9RC6+u7Cz5ZJaeg== X-Google-Smtp-Source: ACHHUZ4VrGccQc7IcbCegbYQ4MND1aR7VorGgaodhLzxp9Px72fKK11T9PqAiWhFdnNQ0ng6zFJS+w== X-Received: by 2002:a0d:db4e:0:b0:56d:464e:db7e with SMTP id d75-20020a0ddb4e000000b0056d464edb7emr20490266ywe.13.1687453900971; Thu, 22 Jun 2023 10:11:40 -0700 (PDT) Received: from smtpclient.apple (69-209-31-205.lightspeed.sntcca.sbcglobal.net. [69.209.31.205]) by smtp.gmail.com with ESMTPSA id j206-20020a816ed7000000b0056d2eb86724sm1903829ywc.142.2023.06.22.10.11.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2023 10:11:40 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) From: Dave Abrahams In-Reply-To: <83ilbf2zx6.fsf@gnu.org> Date: Thu, 22 Jun 2023 10:11:29 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <3D7A63CD-5B7B-412A-8C55-90EFFA294F09@boostpro.com> References: <837crx5a8x.fsf@gnu.org> <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> <83ilbf2zx6.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Score: 0.0 (/) 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 (-) > On Jun 22, 2023, at 10:02 AM, Eli Zaretskii wrote: >=20 >> From: Dave Abrahams >> Date: Wed, 21 Jun 2023 09:09:08 -0700 >> Cc: 64198@debbugs.gnu.org >>=20 >> Before discussing patches, could you please describe your situation? >> Specifically, how does it happen that neither the compilation >> directory plus the file name shown by the diagnostics nor the search >> of compilation-search-path succeed to locate the file? And what = would >> the hook function you suggest adding do to resolve this, i.e. how >> would it know where to look for the file? >>=20 >> When Swift asserts, it doesn't write the path to the file into the = output, because=E2=80=A6 reasons I grudgingly >> accept. So one needs to guess at the file. = https://github.com/apple/swift/issues/66777 contains all the >> details, but if you want additional info, please ask. >=20 > I don't know what Swift is, and that issue talks about something > called #fileID, which I again have no idea about. So yes, please do > elaborate, and TIA. Swift is a programming language. When its assertions (like C's assert() = macro) fail, a diagnostic is output with a file ID and line. The file ID = looks like a path, but it's really not. If it's a path in the = filesystem, that's coincidental but it's likely to point to the right = file. I don't want to manually hunt down the file every time an = assertion fails; I'd rather emacs made an educated guess based on the = current project. It's obviously not the right answer for everyone, but = I'd like to have the hooks needed to implement that without too much = hackery.= From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jun 2023 17:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dave Abrahams Cc: 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.168745462323324 (code B ref 64198); Thu, 22 Jun 2023 17:24:02 +0000 Received: (at 64198) by debbugs.gnu.org; 22 Jun 2023 17:23:43 +0000 Received: from localhost ([127.0.0.1]:36653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCO22-000648-PI for submit@debbugs.gnu.org; Thu, 22 Jun 2023 13:23:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCO20-00063u-IB for 64198@debbugs.gnu.org; Thu, 22 Jun 2023 13:23:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCO1u-0001WM-Qy; Thu, 22 Jun 2023 13:23:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=jJkml4uu2iqk8j9M4XzKsXq4IvOXSuoBJMcVtpDaq1A=; b=FRN1KhJ7SBqtORv9Nf5z LwdN8nb7gojEooorzKq/b8nNbaSz1XBdizXC9rHamDak53z+4TMrQ0LniiTRP/BoVugJP8lHju8+R FyL9pI5mCJt4oP7XzJ+HUGHjLJFzQ62fUz+JkxYsHyjjlQOWu3XMigHa5ZdSHbG89Pv1M2Qu7xJh2 zLU4nOLW7g9fiXfe8eRdGffCkr3S/od+cWpCrAXOvGtYSi91xGTZd2XB37mypqsBCvwn57L716na/ qg1PsN8Wg8x36zgl9vMcB5QxrKCiRcK2Ajrxu5wbmoV0LvPoCki12eujVxFo1NpxxnsJB3r3FlTdq Ami2dAy1WfJtDw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCO1u-0008Uu-BL; Thu, 22 Jun 2023 13:23:34 -0400 Date: Thu, 22 Jun 2023 20:23:45 +0300 Message-Id: <83fs6j2yxq.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <3D7A63CD-5B7B-412A-8C55-90EFFA294F09@boostpro.com> (message from Dave Abrahams on Thu, 22 Jun 2023 10:11:29 -0700) References: <837crx5a8x.fsf@gnu.org> <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> <83ilbf2zx6.fsf@gnu.org> <3D7A63CD-5B7B-412A-8C55-90EFFA294F09@boostpro.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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 (---) > From: Dave Abrahams > Date: Thu, 22 Jun 2023 10:11:29 -0700 > Cc: 64198@debbugs.gnu.org > > > On Jun 22, 2023, at 10:02 AM, Eli Zaretskii wrote: > > > >> From: Dave Abrahams > >> Date: Wed, 21 Jun 2023 09:09:08 -0700 > >> Cc: 64198@debbugs.gnu.org > >> > >> Before discussing patches, could you please describe your situation? > >> Specifically, how does it happen that neither the compilation > >> directory plus the file name shown by the diagnostics nor the search > >> of compilation-search-path succeed to locate the file? And what would > >> the hook function you suggest adding do to resolve this, i.e. how > >> would it know where to look for the file? > >> > >> When Swift asserts, it doesn't write the path to the file into the output, because… reasons I grudgingly > >> accept. So one needs to guess at the file. https://github.com/apple/swift/issues/66777 contains all the > >> details, but if you want additional info, please ask. > > > > I don't know what Swift is, and that issue talks about something > > called #fileID, which I again have no idea about. So yes, please do > > elaborate, and TIA. > > Swift is a programming language. When its assertions (like C's assert() macro) fail, a diagnostic is output with a file ID and line. The file ID looks like a path, but it's really not. If it's a path in the filesystem, that's coincidental but it's likely to point to the right file. I don't want to manually hunt down the file every time an assertion fails; I'd rather emacs made an educated guess based on the current project. It's obviously not the right answer for everyone, but I'd like to have the hooks needed to implement that without too much hackery. I'm okay with adding a hook function which will be called from compilation-find-file if compilation-find-file-1 fails to find the file. But I must say that you are trying to use compilation-mode in a situation for which it was never been designed to be used. From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jun 2023 17:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dave Abrahams Cc: Eli Zaretskii , 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.168745673626939 (code B ref 64198); Thu, 22 Jun 2023 17:59:01 +0000 Received: (at 64198) by debbugs.gnu.org; 22 Jun 2023 17:58:56 +0000 Received: from localhost ([127.0.0.1]:36683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCOa7-00070R-KW for submit@debbugs.gnu.org; Thu, 22 Jun 2023 13:58:55 -0400 Received: from sonic312-26.consmr.mail.ir2.yahoo.com ([77.238.178.97]:38158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCOa5-00070B-Iz for 64198@debbugs.gnu.org; Thu, 22 Jun 2023 13:58:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1687456727; bh=odIFtAPItpPno2fkkSw96HrG1+sEwjg5bX1sOrjdooE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=GwOuaYVSkfw4ECPzU+M2ulYV03qSrU7zlxeLF/eJ0zKqVsIphYXOxBplaK6PPXQXs5PCYgMyok/eShtMW4jlXo7Vtm1yrp80J5HlrA5lhjw23DJyzEGBNXqeFEVAmk6U0v8jvJXnPDwDWS0L0wla8JIzI3F+AybEoBVfaSYjFVotRuuo0YKTCjhv2nkBGE7H3Cgsoh5s4J63AxC+lIX52IGwSml2uEhzuChSyNn8hHDBZ1u2rTmhjF55Rcroo/suAm0ics8fARZTesIXa8Nff3pOeKXUzQGJTZ8G/MD572oM/0XbQ5aF8w/er7D7vcfl3SqnAtOEuj99j3hkEF5Tng== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1687456727; bh=WvfJnP5q/R6Dq/cw9QQgtpGjRMlHOncWJ27GDpPczDt=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=T2ZNtJWQfK31x5EOp7J291HelMHYkExRYVia/stLjVP4cZIL0L6PlVdnja4uWmz80fTOI499WKzTxwvWiMDtzu/BOZ1waka0zqVMHdU7QW07SO1PMQ/fPkCnVGFGWGRrZf3tiXYN9Z2E1BmGu/x+vFEDfgzr4DUbAxePePNUpdGL3M5s2q73PlOPbUgCViezfTaMBUJkRWTorhqWo58hwwf0WFHbLSffeLncLJ9LqgN03DMOan/k+cpoIJ4+t7UoIPNV8Ma7wFkDFG9wAK26DW8dcjzyzf7fyJrCt0daULuZfn8nM8QuEyP3gpwvBcLD3enaWgVIPjnbJytzzej4oQ== X-YMail-OSG: aQ2Vt.IVM1mlNUrO.arSZSeEWgI2pEQ1wMLcpVuj20Ppu.1Shg685AHxR6KCN9U tcQ1BZl7VmMmoLUuLrYi_hDQtCPYnG7FuSvae5Gpp0.GSyl1Qi5_VGL_RZ48iTzr6Cu2v7_IvR12 UfSU.j.GPYEv1JyJiQI08ceCx1s4sRtNea45lShtH7p.A0xXo0wZ8NAbVBKMvzJsq3ZOLBzc6o_W VokjDqYCGbWdtcYvpFUeeSNVJXwQyEG7lXRtmbIpvwY1BjPi_NvZs56ot8DRoei0wS1eBHfNtxX2 qUxk5iuTtnyveoZvZbxONiSdgsHvKcEWRH0QIHKTOLsAKSbGxcxh0ootgaEWoqYgfYA3IzgONgiF R4IarvKNvvb9U4rwUw9W3cAXdw_n3tZ8JQ3KI9sSi2g1sQez_IJKTO9y2TaSqF.Dq4eEOHIEuRgm IyT7UgI6oZfJmMTURzZSKaBsnszW50AAP9ctP3vzyubvQTWF4cZfAq5aY8WSTVwxQYysVnu5QKHR nAm.L3YfilBAXp6YqGESwpPfrXWCsxy50Jaew2M7TN5MtnVHml0_cZrtKwWH_YV1aMDYZM8gw.Zh ddSMud7.npfzZea4undVR_ez6.XwbCJgTlI4WJUGk._KXRHxcRwtPuuLScNHCHwjTcTDQTBmPhVK GcmMxxBxpqeSgTCKUaIXhXHztSqAMmyyvB5SglmJCxkgA5UMA1cACO0w2l30MwIT3Jw3pIJyECkk QqJ2y6RvK.lOxNqv8IHuCx5rq9oDXiodRFFwW72jtTF4hSVXHZh9ew3O35UUcJSvc_zzhdH6sE12 ZcjDqXEsMmOp6kQ5lcB0D1YQHcXsi5kV4NEtrEntujGxTNsAXZ5mqgi2YbXXrBYaGXw8AeMhc5xt P46FyLK85Dz0Iq1mYpUsewY9xKIue_IwP6n88tqFLAmY0t_B9NXxs6rFKrZeP2YRL1JoVQz4wqJi FaWy_vKpnXcp.sNd99nJL4IIv6sY7ktilcFtdmGAafBeStgYLDyh2N_FAM5TjvVMqhBCcGcUhDZz KdjVI0cpy10PndgF_LuECTKPRxcRvBMWaPHU__MGXm1q07NDmIlH1g..LlIX.SBnw8fS.9LW.Z4X NwfgQv.h0R78mBnxOMF6ZDqpnIqgolHCIAFRmapMa2x426QGjibMeGMjyHmtyxyqN3TqbwEJvkIh UNzc_RDM.wTMoEjXL2ZD6ghxR7Dd4lXh__dxDdXMzmcZHqSuWM8YhEZjjHUb4tPnwyP3Oi6pc5.W jrfuZnKPgrfI4bGyiqohtVEw13bJekrHpOJfkesX82CEFGBleMUSo9LItzEh7Czok6cPIpxC64Tu dRi62VRlbGxofb8MWHfR75NoMS_K2WDTaSXeBocF5Gyf_TuQOGAQlVMbhrv1fczcTaEv5298yynq fgwwQy_3mLU78xGOrEI9_eoYkJVBtxKcuDDN9E6qbnIZtem_jBBXKdW3cNxCJ9SYA78oj2FBezzD pomfgYtYgwxNkbuITmsfpXkPpRuRxD_BrGXAFYahB34_QU9_PCQJplCyj3IZbqsPDbAld.X2YZK3 ncSh673Xkp1wW0opHnFuW0zMfiiP4rxSlBdoLZ3PYQ6C66wSoXanej7TaiIHYhvT4JAHagjI.lo4 36DwLDGn8ISlechOiqhQvzU4RGuPudfuvXoXjl22qUH03_P8AUTK.2y_ZFzwRvlBwTcsRwW88X6l bfkrxfC4lXhzg.8Rul0n5wPhhftbW61mnhAOYKMcyQUF55Ihs49SieBtFpuRwVw3bDxAKQwJHn0a igwiPAOZeuHqZSwGvnZmvPx9SU7HhIHYI1blx0S8Z1YRKhhftWn4ZQlNGxe3HDIjWuLsFz4jEij4 5fpBOLXnsF1Z6ayvmtT_M2etAMfn6ay0LNhcTkNUcyL7XVOjX4i0SQb1vcDKxze7zsnlCYBgp29O 7K9NBywPeGP5c2Hi1uvCxMi27XUZpF12Ier6jYDk8HggJZJZkVC0lAk3ob0665J5_o6n5ogWVzef G3Z_4OWLfNfSwC384IS7zdNGpZjN3rYrn9O.PpKcJPFq4jeco1kYkgxGftbBXzePhY6fEsA5D3Sa 6EJ5ec9sRyKKFJiJmw6_GOtQQ.xyvZjw1.I1OqhDGXIH344vmFcJC54HAtD5h0d8hfhRnN5iBeUg Y53Kg60OOyNdr5Jj1OmF3xAiLF_CRNbw68TGX.vVXFGxYcnLBhuOKcomzTB9YF0wLDzJ_bQYiJYQ VckyhnuDRFI30Rf5mpNX9JHfhxw0dLKEnmx_3muSOp2Ew X-Sonic-MF: X-Sonic-ID: 9d199d59-6672-4dc4-af9a-3b9f97e8bded Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Thu, 22 Jun 2023 17:58:47 +0000 Received: by hermes--production-ir2-7867f454fc-hvmwx (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d6a5634d285f768a2a7bfaf915444e57; Thu, 22 Jun 2023 17:58:44 +0000 (UTC) From: Daniel =?UTF-8?Q?Mart=C3=ADn?= References: <837crx5a8x.fsf@gnu.org> <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> <83ilbf2zx6.fsf@gnu.org> <3D7A63CD-5B7B-412A-8C55-90EFFA294F09@boostpro.com> Date: Thu, 22 Jun 2023 19:58:43 +0200 In-Reply-To: <3D7A63CD-5B7B-412A-8C55-90EFFA294F09@boostpro.com> (Dave Abrahams's message of "Thu, 22 Jun 2023 10:11:29 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Mailer: WebService/1.1.21557 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 2844 X-Spam-Score: 0.2 (/) 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: -0.8 (/) Dave Abrahams writes: > > Swift is a programming language. When its assertions (like C's > assert() macro) fail, a diagnostic is output with a file ID and > line. The file ID looks like a path, but it's really not. If it's a > path in the filesystem, that's coincidental but it's likely to point > to the right file. I don't want to manually hunt down the file every > time an assertion fails; I'd rather emacs made an educated guess based > on the current project. It's obviously not the right answer for > everyone, but I'd like to have the hooks needed to implement that > without too much hackery. This is the Elisp code you posted on GitHub, based on customizing compilation-parse-errors-filename-function: (defun dwa/path-tails-matching (path paths) "Returns the elements of PATHS with PATH as their suffix, matching by path component." (let ((tail (file-name-concat "/" path))) (seq-filter (lambda (full-path) (string-suffix-p tail full-path)) paths))) (defun dwa/compilation-parse-errors-filename-in-project (path-in-error) "If PATH-IN-ERROR is found in the filesystem, returns it unchanged; otherwise tries to return a unique file in the current project likely to be identified by PATH-IN-ERROR. Returns PATH-IN-ERROR unchanged if no such file can be found." (if (file-exists-p path-in-error) path-in-error ;; First look for relative path suffixes. (let* ((candidates (project-files (project-current t))) (full-matches (dwa/path-tails-matching path-in-error candidates))) ;; If not found, try just the filename component of ;; path-in-error; Swift assertions are weird and include a ;; module name that doesn't necessarily correspond to anything in the ;; filesystem. (cond ((null full-matches) (let ((filename-matches (dwa/path-tails-matching (file-name-nondirectory path-in-error) candidates))) (cond ((null filename-matches) path-in-error) ;; unique match; return it ((null (cadr filename-matches)) (car filename-matches)) ;; multiple matches; consider prompting for the user to select one. (t path-in-error)))) ;; unique match; return it ((null (cadr matches)) (car matches)) ; multiple matches; consider prompting for the user to select one. (t path-in-error))))) (setq compilation-parse-errors-filename-function 'dwa/compilation-parse-errors-filename-in-project) I've tried it and it seems to work well, although I agree that the code is a bit hacky and prone to error. How would the new hooks you propose simplify this customization code? Similar use cases have been discussed in the mailing list in the past. Someone proposed to make compilation-find-file customizable, which may not be a bad idea. See https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg00910.html From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Dave Abrahams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jun 2023 21:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Cc: Eli Zaretskii , 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.16874706175022 (code B ref 64198); Thu, 22 Jun 2023 21:51:01 +0000 Received: (at 64198) by debbugs.gnu.org; 22 Jun 2023 21:50:17 +0000 Received: from localhost ([127.0.0.1]:36891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCSC0-0001Iw-V8 for submit@debbugs.gnu.org; Thu, 22 Jun 2023 17:50:17 -0400 Received: from mail-yw1-f178.google.com ([209.85.128.178]:53373) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCSBx-0001Ih-PZ for 64198@debbugs.gnu.org; Thu, 22 Jun 2023 17:50:14 -0400 Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-57026f4bccaso80458777b3.2 for <64198@debbugs.gnu.org>; Thu, 22 Jun 2023 14:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boostpro-com.20221208.gappssmtp.com; s=20221208; t=1687470608; x=1690062608; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=FEGp6MYpjQluEug0CbglZRW50KLQ1UV1weV/GBhGBdc=; b=wsQkK/3q1UkwGHSVkMoT44cjaj5bZUmpcqwOEvYbXEST+UQdJ1A7L5qPJbVet8CDZC RCYSg4C5j0N1jinJDxv49tNnwX4etehdwPqjQsk/s7thXfgBw6soE/EcvB6RRFXJq6T+ v8ZHCRbNEK0JnLFCEdlHhqhr+/4ubYLFXtVx3S75ZxNf0m48bN28Sif7eCnGD+0LvMEI 9UJq4wgnxToSuVt7wehywX37EYSRqIuwZHiZbrsX0zXogti4Fu412I4ZeXrMrWT8SX3S P8/Wg2VXIem9uayzmh8jsgD2tTeJiQ+Fw5Ita3ZQQnJgyM6l4ME3yaoyV3/fZFMGtGfs wCew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687470608; x=1690062608; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FEGp6MYpjQluEug0CbglZRW50KLQ1UV1weV/GBhGBdc=; b=YqMJrfw4tq/o5ay2w69+RgNG7qGXTpOVMqbHpw+bggX6rGb8u0ZEpbEb26anbSGIig rfSrRCnZQWBy00N+3U8ct299WsFNmrudXxRieso14GCjuAmwHGwsZdKkD+ARcctl4j4D A/kxqv/q+9PDdqpa1peJLQWP+ydG5TmaUIUmukfcEbSq7S+cJIRnbbOATQ9ZhcEwjlsu 0WO1MNwCcwoEYTyv+jXMK6kuWdGOLuUcuwOxD5LvFwKL3Nw9JV9vjVGGCWTOczTNM8YX 3D5hyXBi5g+ihsJgXb4Kj1HCzTpjbwbEPyfbmWp5uGDmzfDW49w4VbR4nAuyk1PiRHKc 0IIg== X-Gm-Message-State: AC+VfDwgnrhvvhUJRlmAHs6xHGHPb3gwOc5r74QcGwOHLwc+lGurjFBt fRnJTbwjDVxLTt22oBwmrjUliA== X-Google-Smtp-Source: ACHHUZ5LFRCK4BiNa3SNg+GuFN55O/4ykD7BwYkz4RKzNehwJjGgPHpWumFbIdz0Id8tz2oRhccirA== X-Received: by 2002:a81:7109:0:b0:572:2759:c099 with SMTP id m9-20020a817109000000b005722759c099mr13075190ywc.52.1687470608100; Thu, 22 Jun 2023 14:50:08 -0700 (PDT) Received: from smtpclient.apple (69-209-31-205.lightspeed.sntcca.sbcglobal.net. [69.209.31.205]) by smtp.gmail.com with ESMTPSA id x124-20020a81a082000000b0054c0f3fd3ddsm2105150ywg.30.2023.06.22.14.50.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2023 14:50:07 -0700 (PDT) From: Dave Abrahams Message-Id: <1601C730-4525-4130-8746-FF57FD743DD5@boostpro.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_0A6A6292-7228-4684-95F6-F6702F17C0AB" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Date: Thu, 22 Jun 2023 14:49:56 -0700 In-Reply-To: References: <837crx5a8x.fsf@gnu.org> <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> <83ilbf2zx6.fsf@gnu.org> <3D7A63CD-5B7B-412A-8C55-90EFFA294F09@boostpro.com> X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Score: 0.0 (/) 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 (-) --Apple-Mail=_0A6A6292-7228-4684-95F6-F6702F17C0AB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 22, 2023, at 10:58 AM, Daniel Mart=C3=ADn = wrote: >=20 > Dave Abrahams > writes: >>=20 >> Swift is a programming language. When its assertions (like C's >> assert() macro) fail, a diagnostic is output with a file ID and >> line. The file ID looks like a path, but it's really not. If it's a >> path in the filesystem, that's coincidental but it's likely to point >> to the right file. I don't want to manually hunt down the file every >> time an assertion fails; I'd rather emacs made an educated guess = based >> on the current project. It's obviously not the right answer for >> everyone, but I'd like to have the hooks needed to implement that >> without too much hackery. >=20 > This is the Elisp code you posted on GitHub, based on customizing > compilation-parse-errors-filename-function: >=20 > (defun dwa/path-tails-matching (path paths) > "Returns the elements of PATHS with PATH as their suffix, matching by = path component." > (let ((tail (file-name-concat "/" path))) > (seq-filter (lambda (full-path) (string-suffix-p tail full-path)) = paths))) >=20 > (defun dwa/compilation-parse-errors-filename-in-project = (path-in-error) > "If PATH-IN-ERROR is found in the filesystem, returns it > unchanged; otherwise tries to return a unique file in the current > project likely to be identified by PATH-IN-ERROR. Returns > PATH-IN-ERROR unchanged if no such file can be found." > (if (file-exists-p path-in-error) path-in-error > ;; First look for relative path suffixes. > (let* ((candidates (project-files (project-current t))) > (full-matches (dwa/path-tails-matching path-in-error = candidates))) >=20 > ;; If not found, try just the filename component of > ;; path-in-error; Swift assertions are weird and include a > ;; module name that doesn't necessarily correspond to anything in = the > ;; filesystem. > (cond ((null full-matches) > (let ((filename-matches > (dwa/path-tails-matching (file-name-nondirectory = path-in-error) candidates))) > (cond ((null filename-matches) path-in-error) > ;; unique match; return it > ((null (cadr filename-matches)) (car = filename-matches)) > ;; multiple matches; consider prompting for the = user to select one. > (t path-in-error)))) > ;; unique match; return it > ((null (cadr matches)) (car matches)) > ; multiple matches; consider prompting for the user to = select one. > (t path-in-error))))) >=20 > (setq compilation-parse-errors-filename-function = 'dwa/compilation-parse-errors-filename-in-project) >=20 > I've tried it and it seems to work well, although I agree that the = code > is a bit hacky and prone to error. How would the new hooks you = propose > simplify this customization code? It would not. The problem with this code is that it runs too early. = That means two things: 1. if you get 1000 errors in different files, this code will try to = resolve each one, accessing the filesystem during parsing, before the = compilation buffer even font locks, which is really inefficient = especially if you only care about the first of these errors. 2. There's no good way to prompt the user for a match when there are = multiple matches. =20 I want a hook that will be run at the time compile.el currently prompts = me to locate the file in the filesystem: the first time I visit an error = at a given path and no file is found there by emacs. > Similar use cases have been discussed in the mailing list in the past. > Someone proposed to make compilation-find-file customizable, which may > not be a bad idea. See > https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg00910.html Yes, I think I could probably get where I need to by advising = compilation-find-file.= --Apple-Mail=_0A6A6292-7228-4684-95F6-F6702F17C0AB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Jun = 22, 2023, at 10:58 AM, Daniel Mart=C3=ADn <mardani29@yahoo.es> = wrote:

Dave = Abrahams <dave@boostpro.com> writes:

Swift is a programming language.  When = its assertions (like C's
assert() macro) fail, a diagnostic is output = with a file ID and
line. The file ID looks like a path, but it's = really not. If it's a
path in the filesystem, that's coincidental but = it's likely to point
to the right file.  I don't want to = manually hunt down the file every
time an assertion fails; I'd rather = emacs made an educated guess based
on the current project.  It's = obviously not the right answer for
everyone, but I'd like to have the = hooks needed to implement that
without too much = hackery.

This is = the Elisp code you posted on GitHub, based on customizing
compilation-parse-errors-filename-function:

(defun = dwa/path-tails-matching (path paths)
 "Returns the = elements of PATHS with PATH as their suffix, matching by path = component."
 (let ((tail (file-name-concat "/" path)))
   (seq-filter (lambda (full-path) = (string-suffix-p tail full-path)) paths)))

(defun = dwa/compilation-parse-errors-filename-in-project = (path-in-error)
 "If PATH-IN-ERROR is found in the filesystem, returns = it
unchanged; otherwise tries to return a unique file in the = current
project = likely to be identified by PATH-IN-ERROR.  Returns
PATH-IN-ERROR unchanged if no such file can be = found."
 (if (file-exists-p path-in-error) = path-in-error
   ;; First look for relative path = suffixes.
   (let* ((candidates (project-files = (project-current t)))
=    (full-matches = (dwa/path-tails-matching path-in-error candidates)))

     ;; If not found, try just the = filename component of
     ;; path-in-error; Swift = assertions are weird and include a
     ;; module name that doesn't = necessarily correspond to anything in the
     ;; filesystem.
     (cond ((null = full-matches)
=      (let = ((filename-matches
=    (dwa/path-tails-m= atching (file-name-nondirectory path-in-error) candidates)))
      = ; (cond ((null filename-matches) path-in-error)
=      ;; = unique match; return it
=      ((nul= l (cadr filename-matches)) (car filename-matches))
=      ;; = multiple matches; consider prompting for the user to select = one.
=      (t = path-in-error))))
=     ;; unique = match; return it
=     ((null = (cadr matches)) (car matches))
=      ; = multiple matches; consider prompting for the user to select = one.
=     (t = path-in-error)))))

(setq = compilation-parse-errors-filename-function = 'dwa/compilation-parse-errors-filename-in-project)

I've = tried it and it seems to work well, although I agree that the = code
is a = bit hacky and prone to error.  How would the new hooks you = propose
simplify this customization code?

It would not.  The problem = with this code is that it runs too early.  That means two = things:

1. if you get 1000 errors in different = files, this code will try to resolve each one, accessing the filesystem = during parsing, before the compilation buffer even font locks, which is = really inefficient especially if you only care about the first of these = errors.
2. There's no good way to prompt the user for a match = when there are multiple matches.
 
I want a = hook that will be run at the time compile.el currently prompts me to = locate the file in the filesystem: the first time I visit an error at a = given path and no file is found there by = emacs.

Similar use cases have = been discussed in the mailing list in the past.
Someone = proposed to make compilation-find-file customizable, which may
not be = a bad idea.  See
https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg00910.html=

Yes, I think I could probably get = where I need to by advising compilation-find-file.
= --Apple-Mail=_0A6A6292-7228-4684-95F6-F6702F17C0AB-- From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Dave Abrahams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jun 2023 21:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.16874709835552 (code B ref 64198); Thu, 22 Jun 2023 21:57:02 +0000 Received: (at 64198) by debbugs.gnu.org; 22 Jun 2023 21:56:23 +0000 Received: from localhost ([127.0.0.1]:36895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCSHv-0001RU-8e for submit@debbugs.gnu.org; Thu, 22 Jun 2023 17:56:23 -0400 Received: from mail-yb1-f179.google.com ([209.85.219.179]:41999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCSHt-0001RH-3e for 64198@debbugs.gnu.org; Thu, 22 Jun 2023 17:56:21 -0400 Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-bc43a73ab22so102938276.0 for <64198@debbugs.gnu.org>; Thu, 22 Jun 2023 14:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boostpro-com.20221208.gappssmtp.com; s=20221208; t=1687470975; x=1690062975; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KfvYR+HCpwl7hATri8OMQI0MB8TBNyZo3O+fWZ94/1c=; b=oDE1+ZBSd1KBPj5FgGgg6BQ+R40b+aGkmt/ieMPDRAmXhd7Xrah4b5c49F0sN76is4 5Uod8kyiytGyTB+ZMgeAxTb801JkPb4q5bPbFZQW3jQSpfa69/nHM2SEn7oq3ngVtZby BBk0S0vxfh0veL9CIzLRI9fYePZ0O+Lf8YBOHFIFUYW68NpC9W3oBuvthqOEcjq1bDnI veeC8qkUFwS6iJ212o20tR7SB9lSFuK+wFTiSpd9d8MlkeawmpZv7FErYS8SQZShwkiF bX2vxZQzsPLCvCcqPQ8Wz/bc6mVi0UOZcX3YeMmaGOyw7hSW8gNGmMbl9mKtjkkSGoH+ hjfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687470975; x=1690062975; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KfvYR+HCpwl7hATri8OMQI0MB8TBNyZo3O+fWZ94/1c=; b=NseIVljGsDCJUX1runYanH05JGsYwL/aXeX9Q5Azjpglu4/zkIkiY90PmNZTjxq7uo 1aG1dCvFqIf/1GkR2tbVi1HU469UcpCo+sa12VX5X8wTAvxEftWGNL3dSN6iOej/DTxX QBuoWyFLPJSusj9hDdtUS1GoJQnJu4DmUBsN3CIKT+voZ+iyfGmtSwSNmR+7Wp1fKQfo QGKWNch6dtiOXHv5YnC433dUfQS7ofWu55vU/nQ+YVGDJj+0oQlkBVC144rbXslZqAEl +WP+ZmEeV5Pfix0WdEvP+AJb13rE6592nbCbIwTMWqi2B6qZL57pVG2SFRlTkVqijZrd BleA== X-Gm-Message-State: AC+VfDxd8Zc6+TCcEZ7CFL/18mfVSSaIl1YaqtWJpCV3B0h7r6lsWY23 +Fs1s5VNqm5VQOaQU2dA7R5/7fnBjO+zZ5LV3YY= X-Google-Smtp-Source: ACHHUZ5MbkjwlzIjOnMCSoM4sKpc1QNdb/9EjDEk5ygMeom8mdnjvltVyFAfdsKr6VGESsOIAiZp7w== X-Received: by 2002:a25:4007:0:b0:b94:bbf2:19a3 with SMTP id n7-20020a254007000000b00b94bbf219a3mr20121191yba.18.1687470975420; Thu, 22 Jun 2023 14:56:15 -0700 (PDT) Received: from smtpclient.apple (69-209-31-205.lightspeed.sntcca.sbcglobal.net. [69.209.31.205]) by smtp.gmail.com with ESMTPSA id y30-20020a25ad1e000000b00bcf788d09e3sm1746727ybi.34.2023.06.22.14.56.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2023 14:56:15 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) From: Dave Abrahams In-Reply-To: <83fs6j2yxq.fsf@gnu.org> Date: Thu, 22 Jun 2023 14:56:04 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <837crx5a8x.fsf@gnu.org> <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> <83ilbf2zx6.fsf@gnu.org> <3D7A63CD-5B7B-412A-8C55-90EFFA294F09@boostpro.com> <83fs6j2yxq.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Score: 0.0 (/) 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 (-) > On Jun 22, 2023, at 10:23 AM, Eli Zaretskii wrote: > I must say that you are trying to use compilation-mode in a > situation for which it was never been designed to be used. Of course I am, but I don't know why you're saying so. Compilation-mode = was obviously designed to be a general facility, thus the great = flexiblity in the regexp alists and compilation-search-path, etc., so = the original designer knew their ability to envision the details of = future use cases was limited. I'm suggesting a feature that makes it = more adaptable to un-envisioned use cases.= From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Dave Abrahams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Jun 2023 22:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Cc: Eli Zaretskii , 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.168747421911064 (code B ref 64198); Thu, 22 Jun 2023 22:51:02 +0000 Received: (at 64198) by debbugs.gnu.org; 22 Jun 2023 22:50:19 +0000 Received: from localhost ([127.0.0.1]:36947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCT87-0002sO-4F for submit@debbugs.gnu.org; Thu, 22 Jun 2023 18:50:19 -0400 Received: from mail-yw1-f178.google.com ([209.85.128.178]:51676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCT84-0002s8-Ez for 64198@debbugs.gnu.org; Thu, 22 Jun 2023 18:50:17 -0400 Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-570114e1feaso86017317b3.3 for <64198@debbugs.gnu.org>; Thu, 22 Jun 2023 15:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boostpro-com.20221208.gappssmtp.com; s=20221208; t=1687474211; x=1690066211; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=bzH7eUj+LS1L0WQ7nla5ivSP6FMjCma01ZvGHm+kv9s=; b=aYEWkrjpD9fsQBkfmN3jEZGosIq0GJtxc+HCqzybMp7uH9Hf3aT/WibQ7VVbsDGFDk 2AxABvLZ5RSv0wNsPnBSnV4z93Ducc8GLbZR3dW+oJciQiDBUm09jgctMekglC8c/jfw 9zuMDJCziu95KfcgBea83LCgQoYqJpWPZ86usrwfhWz8tz4nknV4nioa4btnWtmjdHUb Kz8l5EtUFfcgWKTRKWVmWI2eTy7B+5uX3Fm1i4+GczNyHtHN+vq0jQxJwbxuPWvhT8x+ 59We+9bqd2h1VwAYHLjND7Ly6vWhc3TJKhPARnocmwseNTkRFMF0Jtfzy2zM/v61RcNJ NKsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687474211; x=1690066211; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bzH7eUj+LS1L0WQ7nla5ivSP6FMjCma01ZvGHm+kv9s=; b=LGO5nE/ZYfA+cgoBpVHla9sM9NFPFwu7OKh2YB2ikzvVwD8AEyZekIrK926ex14dA0 hSwHbXji0GLY4p9VYfzpiYdrB7uxb62qwMvV/EdWi2esT9zWY6+TV1M253hhakRUrT9K 40FeQcVLNKqJkHIyBGzIkp615564Ed1pGOZje45+dY6ahiLMOnSZYOyNpCNmHaqvC4An BWnJQcJ3+X/tL193Vq5Kv2EENj2cLyFzpdQ1PomApL1OPzG97G3edpNOdkvTHEkIstXu eIlpLlLe0qBs2/lCp4laUdUGQvlSOzLiVR7L9+Fv1BjXrY7nxAFU01ygmy/ZIC+NKmDv 0EGg== X-Gm-Message-State: AC+VfDwcsjzAlWTvWivQl0TY5ASlXbV3RhSCpZPN3HWUYCNyGN0Cc6rK yjDZLwYaD4P4QR6b39OyPLI5Og== X-Google-Smtp-Source: ACHHUZ5uiJacYx3NhkQaYotkTlyIQXDzFhviiazmAp5K+9LPXHnuQVqeXpBjbNMA2MkMfsIb7eAuOg== X-Received: by 2002:a0d:c886:0:b0:573:7f55:a40e with SMTP id k128-20020a0dc886000000b005737f55a40emr7786827ywd.49.1687474210697; Thu, 22 Jun 2023 15:50:10 -0700 (PDT) Received: from smtpclient.apple (69-209-31-205.lightspeed.sntcca.sbcglobal.net. [69.209.31.205]) by smtp.gmail.com with ESMTPSA id a65-20020a0dd844000000b0054f56baf3f2sm2100278ywe.122.2023.06.22.15.50.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2023 15:50:10 -0700 (PDT) From: Dave Abrahams Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_9FC25BA0-4469-4C10-8ADD-1CB120FF18A0" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Date: Thu, 22 Jun 2023 15:49:59 -0700 In-Reply-To: <1601C730-4525-4130-8746-FF57FD743DD5@boostpro.com> References: <837crx5a8x.fsf@gnu.org> <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> <83ilbf2zx6.fsf@gnu.org> <3D7A63CD-5B7B-412A-8C55-90EFFA294F09@boostpro.com> <1601C730-4525-4130-8746-FF57FD743DD5@boostpro.com> X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Score: 0.0 (/) 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 (-) --Apple-Mail=_9FC25BA0-4469-4C10-8ADD-1CB120FF18A0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jun 22, 2023, at 2:49 PM, Dave Abrahams wrote: >=20 > Yes, I think I could probably get where I need to by advising = compilation-find-file. I take it back; no I couldn't. I need too much of the logic it = implements before prompting.= --Apple-Mail=_9FC25BA0-4469-4C10-8ADD-1CB120FF18A0 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii

On Jun 22, 2023, at 2:49 PM, Dave Abrahams <dave@boostpro.com> wrote:

Yes, I think I could probably get where I need to by advising compilation-find-file.

I take it back; no I couldn't. I need too much of the logic it implements before prompting.
--Apple-Mail=_9FC25BA0-4469-4C10-8ADD-1CB120FF18A0-- From unknown Tue Jun 17 22:27:19 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64198: Feature request: compile.el's "Find this in" prompt should be hookable. Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jun 2023 05:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dave Abrahams Cc: 64198@debbugs.gnu.org Received: via spool by 64198-submit@debbugs.gnu.org id=B64198.168749887620258 (code B ref 64198); Fri, 23 Jun 2023 05:42:02 +0000 Received: (at 64198) by debbugs.gnu.org; 23 Jun 2023 05:41:16 +0000 Received: from localhost ([127.0.0.1]:37163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCZXn-0005Gg-Pz for submit@debbugs.gnu.org; Fri, 23 Jun 2023 01:41:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCZXm-0005GR-0s for 64198@debbugs.gnu.org; Fri, 23 Jun 2023 01:41:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCZXg-00045q-I7; Fri, 23 Jun 2023 01:41:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7ShEER1yszNVD8PRhrkphrnyDMUX3Ev4Jv0H/hknakA=; b=Wqq1jMdlLSr7 +0tQwsnQKl1k+ODAlnRXzUnRk0QW+n5J4UxVzbMINAr1AHKDct/IISJSZmb6tG6s/olmBfgHVF7o8 kBchc9h29mibiMLDMMkpckbd5Zc9PIPVv9InU7VwbhhlVJ9vLMp7TI4nCnf57/KKLFel8KCDqGXs+ trJLriET/P8Pu0QQ+JT4EEvmVYSxhsd/EV1hdn34ZUtMzjSmQ/AAYN9/FKASEys2xtfZq3/E3gKUv bNXYKT/Tml1EF51/WHUb8wPQsNw4XLByTMKlK9849SEUMBZErtAxcqW+GB1/RcoXPYPwFW2G/9VjB 4nR841rxKHk25PuDxaOCjw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCZXe-0000vn-Qq; Fri, 23 Jun 2023 01:41:07 -0400 Date: Fri, 23 Jun 2023 08:41:19 +0300 Message-Id: <837cru3fcw.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dave Abrahams on Thu, 22 Jun 2023 14:56:04 -0700) References: <837crx5a8x.fsf@gnu.org> <03EC2FC3-A297-4CD1-91FB-2262A319A6F3@boostpro.com> <83ilbf2zx6.fsf@gnu.org> <3D7A63CD-5B7B-412A-8C55-90EFFA294F09@boostpro.com> <83fs6j2yxq.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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 (---) > From: Dave Abrahams > Date: Thu, 22 Jun 2023 14:56:04 -0700 > Cc: 64198@debbugs.gnu.org > > > On Jun 22, 2023, at 10:23 AM, Eli Zaretskii wrote: > > > I must say that you are trying to use compilation-mode in a > > situation for which it was never been designed to be used. > > Of course I am, but I don't know why you're saying so. Compilation-mode was obviously designed to be a general facility No, it was designed to work with programs that emit notifications in certain supported formats, which are assumed to include the file name and the line/column numbers of the locus of interest. See the file etc/compilation.txt in the Emacs source tree. Anyway, I already said I'm okay with a hook there, so you are responding to a marginal comment. Would you like to submit a patch that adds such a hook in compilation-find-file? Then we could declare victory, even if we disagree about that minor issue. Thanks.