From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: master 08c80c45dde: Don't use file-truepath in Eglot (bug#70036) Date: Thu, 18 Apr 2024 09:34:26 +0100 Message-ID: References: <171215083924.12380.5369373861551158668@vcs2.savannah.gnu.org> <20240403132719.A18EFC12C28@vcs2.savannah.gnu.org> <87il0fsufu.fsf@thornhill.no> <86o7a7fcf4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32627"; mail-complaints-to="usenet@ciao.gmane.io" Cc: theo@thornhill.no, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 18 10:35:17 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rxNEi-0008CK-Kx for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Apr 2024 10:35:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxNED-0007Ix-1X; Thu, 18 Apr 2024 04:34:45 -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 1rxNEB-0007IN-PS for emacs-devel@gnu.org; Thu, 18 Apr 2024 04:34:43 -0400 Original-Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxNE9-0000x3-Vm; Thu, 18 Apr 2024 04:34:43 -0400 Original-Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2d895e2c6efso7315221fa.0; Thu, 18 Apr 2024 01:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713429279; x=1714034079; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YFnzQ56478xsCpUOCYPLxjg00yfgVbBvMtQmWamYhKI=; b=VppghIrbCi6ri16iO0CUAySTLQ981DR1fb1qaHnK5Aau3W37PDMzJuo/9uYYIGABi3 m6A458ZooKZEiXsz7Brdlssm2yYZqCszB5NbZqfwQa5u60oJvwoYgSbtWyaB4g03IFzH nWtdCOnV2uVzbeE3YjAhXR4CKvcTmTzyTARSt4vtcvx3hXQfiw+Vs9nyqaGFFjP+COXl PhCSNWzn1cCf5c7kqfELBJb/2lwdsWhOaY8SCsCKulPSZKUacWZDmKyGXpwos+GAOiEy WIhN9/wA3s/qNKsy9evC2zu5TqmvVRHANu9jzDNfirVEYKZDm3nHNhCBjjyUuOhoOxD7 iLFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713429279; x=1714034079; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YFnzQ56478xsCpUOCYPLxjg00yfgVbBvMtQmWamYhKI=; b=b3yTzEydpulGSY/iSQPDs4HeyVqPm3LfkcQCgYVSXXrW5ZX5W9q3hTWR9P0zqAbOX0 8aKbNvxiJ4fObgAdO+4suVYlL9hPdbHZ4WDsj2bwgsqcckZgMRSI9R9D6Oq/ycjyMJ29 fLGLqGpxQXXKsAjl4PenWYxtP1R0AS9OQgW8waUFkyFAq/lAuxH78vcPm+gVIt3gBSrf i2Yp8cqcchHNa0/9rLvJmRRVRtC6H6hpZ4LpQL/d5HFTLOZFqRIPmnfefL8qiU0Asv3e 1njle9gR3CHi+XwtjGWWOhauXRwh6UujpNDUH+sac8wB+DyXTcNy4pW+qXsvLzK+gCI+ KgfA== X-Forwarded-Encrypted: i=1; AJvYcCVr9OCf/mW9tbsh0cal741MkI6b70LwhLQhagDBFZriWHYmhmEwQwuZmQkE3TBTrZHgB7E8uP3eOogjFeyHRXzrjsz8 X-Gm-Message-State: AOJu0YzTALYfuE/TOtyTyfrS4iNMuNrUBb1K/1nkcbjNVUelhOLUUjD0 HoAPmSaqvw8H7WFFGPdv3XrJ3KOXmBtClPKTL6rXOH/ks/Q1T/HumEEwO4IbCawY0xSqaVZm8AN FllZZwheNtKrGiEFGya6Ark77zpJ8uQ== X-Google-Smtp-Source: AGHT+IGjeAstaquiWoDUEnecAp3U9vaOAWF/PXcpNS5jGaOCSogkUMQzwC75FNDH3ka5Cs88iXAIQSPT8ZgtUmTd+No= X-Received: by 2002:a2e:9b58:0:b0:2d8:a814:583d with SMTP id o24-20020a2e9b58000000b002d8a814583dmr1093001ljj.30.1713429278632; Thu, 18 Apr 2024 01:34:38 -0700 (PDT) In-Reply-To: <86o7a7fcf4.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=joaotavora@gmail.com; helo=mail-lj1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317803 Archived-At: On Thu, Apr 18, 2024 at 6:49=E2=80=AFAM Eli Zaretskii wrote: > > > From: Jo=C3=A3o T=C3=A1vora > > Date: Thu, 18 Apr 2024 01:24:59 +0100 > > Cc: emacs-devel@gnu.org > > > > Let's say that during the Eglot session I visit both main.cpp > > and mainlink.cpp in different buffers (either because I don't visit > > them at the same time or because find-file-existing-other-name is > > nil). Then I press M-? on lib.h's foo() to tell me who references it. > > > > Before you change, Eglot will -- correctly -- tell me there is a singl= e > > user of lib.h's foo() function in my project. > > > > After your change, it tells me there are two users. This is wrong, > > there is only one. > > > > It could be that some servers with direct access to the file system > > can deduplicate the information and add back the symlink smarts. > > > > But clangd doesn't do this, and in general servers _can't_ do > > this because LSP models a virtual file system. > > > > And for symlinks to large enough files, I'd be surprised if this > > doesn't slow down the performance of the server because it has to > > analyse what it is told is a completely new file. > > > > So this seems like a pretty big flaw to me after just minimal > > surface scratching. Please reinstate the previous code. > > I asked exactly this question when the change was discussed, and was > told that symlinks are not a problem. Surely not by me, and perhaps whoever told you this wasn't considering this and other scenarios. Some funcionality works > If we need to support symlinks in Emacs instead of leaving this to the > LSP servers, we could perhaps do that once in some strategic place, > instead of using file-truename everywhere where normally > expand-file-name would do. Or maybe explicitly test with > file-symlink-p before using file-truename, which is (and has to be) > pretty expensive. IOW, "punishing" everyone for the benefit of > relatively rare use cases is not the best optimization. As far as I can tell, file-truename is (was) only used "naked" once or twice, I think it's the use inside "find-buffer-visiting" which is= the most crucial for the scenarios at hand. I'll try to see if I can separate them. Jo=C3=A3o