unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Theodor Thornhill <theo@thornhill.no>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: master 08c80c45dde: Don't use file-truepath in Eglot (bug#70036)
Date: Thu, 18 Apr 2024 16:00:53 +0100	[thread overview]
Message-ID: <CALDnm52t59rg=Z0Q8pd8uOkNQ6bEg46vt54yL4Vz0qgQ-9p5Vw@mail.gmail.com> (raw)
In-Reply-To: <878r1bro1g.fsf@thornhill.no>

On Thu, Apr 18, 2024 at 10:57 AM Theodor Thornhill <theo@thornhill.no> wrote:

> >> 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ão
>
> This is correct. The find-buffer-visiting is the most crucial one.

And that one is a longstanding Emacs util function that is already
a good "strategic place" IMO.

So there is only one naked call to file-truename, in eglot--path-to-uri.
"URI" is what the server understands so it's essential that we tell
it the real name of the file visited in the Emacs buffer so as not
to trick it.  It's fairly easy to cache eglot--path-to-uri results
on a case by case basis though.

So to summarize:

* we don't use it "everywhere".  We use it once where it matters.
* the "punishment" isn't really severe and the little there was
  of it has been completely  avoided with my changes.

João



  reply	other threads:[~2024-04-18 15:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <171215083924.12380.5369373861551158668@vcs2.savannah.gnu.org>
     [not found] ` <20240403132719.A18EFC12C28@vcs2.savannah.gnu.org>
2024-04-17 15:35   ` master 08c80c45dde: Don't use file-truepath in Eglot (bug#70036) João Távora
2024-04-17 18:41     ` Theodor Thornhill
2024-04-18  0:24       ` João Távora
2024-04-18  5:49         ` Eli Zaretskii
2024-04-18  6:16           ` Theodor Thornhill
2024-04-18  8:34           ` João Távora
2024-04-18  9:57             ` Theodor Thornhill
2024-04-18 15:00               ` João Távora [this message]
2024-04-18 15:44                 ` Eli Zaretskii
2024-04-18 16:22                   ` João Távora
2024-04-18 16:30                     ` Theodor Thornhill
2024-04-18 17:12                       ` João Távora
2024-04-18 16:35                     ` Eli Zaretskii
2024-04-18  6:02         ` Theodor Thornhill
2024-04-18 14:49           ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALDnm52t59rg=Z0Q8pd8uOkNQ6bEg46vt54yL4Vz0qgQ-9p5Vw@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).