From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70036: 30.0.50; Move file-truename to the C level Date: Thu, 28 Mar 2024 08:22:01 +0200 Message-ID: <86ttkqho52.fsf@gnu.org> References: <87le63xzjt.fsf@thornhill.no> <861q7vihnm.fsf@gnu.org> <87frwbxrs6.fsf@thornhill.no> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40554"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70036@debbugs.gnu.org To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 28 07:23:24 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rpjAZ-000AKH-VU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Mar 2024 07:23:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpjAE-0004KP-L2; Thu, 28 Mar 2024 02:23:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpjAD-0004KB-UO for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 02:23:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpjAD-0001Fb-Mf for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 02:23:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpjAE-0004by-6o for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 02:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Mar 2024 06:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70036 X-GNU-PR-Package: emacs Original-Received: via spool by 70036-submit@debbugs.gnu.org id=B70036.171160693317492 (code B ref 70036); Thu, 28 Mar 2024 06:23:02 +0000 Original-Received: (at 70036) by debbugs.gnu.org; 28 Mar 2024 06:22:13 +0000 Original-Received: from localhost ([127.0.0.1]:38844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpj9R-0004Y3-BL for submit@debbugs.gnu.org; Thu, 28 Mar 2024 02:22:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpj9P-0004XK-Da for 70036@debbugs.gnu.org; Thu, 28 Mar 2024 02:22:12 -0400 Original-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 1rpj9I-000152-HX; Thu, 28 Mar 2024 02:22:04 -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=UhZXiJZWBlG+OvvBG2MmwQUR3+cI2M9HbdyQdZO2sAY=; b=A8xGDVixr/f7 pve1gXRDX0MJ0Jv2sd50W+R6Mf7ec5i9bBQVDtXSQxo0z6QIhZ5F6BSbsN7TnXPaY+TDHG8qG+mcb 62Ls+RzJvhjpug1FWhTkNpwpLUNStuWjkGR63ug0YtdSF9Nlhj9J6QIhgt2gOn/FtSXUlqzgL8r73 4s0o6Nrt1RZhDonlLWHk3DKEENR0BtCGofsO2dtd2W3lell9Hi7oNFrqTZtibHvSZYTjmKMp8cTov CzYgQJurbF1v0rq9nylo9FXiI0eiY9Ri5lKhscFKhVeXUyCaW/qKyzAiiZa7uLK0JNJ6P58Oln89J OI1w0L5P4G3/rU9hvfjROA==; In-Reply-To: <87frwbxrs6.fsf@thornhill.no> (message from Theodor Thornhill on Wed, 27 Mar 2024 22:56:41 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282176 Archived-At: > From: Theodor Thornhill > Cc: 70036@debbugs.gnu.org > Date: Wed, 27 Mar 2024 22:56:41 +0100 > > Eli Zaretskii writes: > > >> As for the patch - it now relies on wordexp to resolve the paths, and I > >> believe there is no real feature parity with the old variant as for now, > >> but I haven't seen any issues thus far. If this approach is accepted I > >> will of course make sure we have feature parity, unless that isn't > >> wanted. > > > > We cannot rely on wordexp and we cannot rely on realpath: both are not > > portable enough. > > OK - for my education on the portability argument. Is that because of > Emacs support targets like haiku and old versions of windows, or > something else inherent in these functions? Platforms other than GNU/Linux are the main concern, yes. Another aspect to consider is whether the function is available in Gnulib -- if it is, we can import the Gnulib implementation and use it on platforms which don't provide it natively; in that case, using such a function is okay (but the MS-Windows port will likely need to provide its own implementation, because Emacs uses Unicode APIs to access and process file names, something Gnulib doesn't do on Windows). In this case, realpath is available in Gnulib, but wordexp isn't, AFAICT. And I'm not even sure we want to use wordexp here, because (reading its docs) it does stuff we don't want to do in file-truename. Why did you need to call it here? > Another much simpler way to improve Eglot performance her could be to > allow for the relevant functions to execute through handlers, to not > break other parts of Emacs. For example `find-buffer-visiting` could > allow to run through a simpler function that merely expands and looks up > the current file, considering that the LSP server likely reports on > files that are already existing, and likely most symlink shenanigans > aren't an issue here. Just thinking out loudly on this. AFAIR, find-buffer-visiting was significantly sped up recently (see bug#66117), so if you did your benchmarks with Emacs before commit b7a737ef49 on master, perhaps do it again with the latest master branch.