From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felician Nemeth Newsgroups: gmane.emacs.bugs Subject: bug#70036: 30.0.50; Move file-truename to the C level Date: Sat, 30 Mar 2024 10:46:00 +0100 Message-ID: <87zfugoxwn.fsf@betli.tmit.bme.hu> References: <87le63xzjt.fsf@thornhill.no> <87ttkrqvru.fsf@betli.tmit.bme.hu> <87il17xsea.fsf@thornhill.no> <86wmpmhp0a.fsf@gnu.org> <874jcqygpn.fsf@thornhill.no> <875xx6muzt.fsf@ulti.tmit.bme.hu> <8734say2wi.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30032"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: Eli Zaretskii , 70036@debbugs.gnu.org To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 30 10:47:29 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 1rqVJB-0007cd-GO for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Mar 2024 10:47:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqVIs-0000w2-9f; Sat, 30 Mar 2024 05:47:10 -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 1rqVIi-0000vG-Cm for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 05:47:02 -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 1rqVIi-000389-4A for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 05:47:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqVIj-0002O5-MJ for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 05:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Felician Nemeth Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Mar 2024 09:47:01 +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.17117919759085 (code B ref 70036); Sat, 30 Mar 2024 09:47:01 +0000 Original-Received: (at 70036) by debbugs.gnu.org; 30 Mar 2024 09:46:15 +0000 Original-Received: from localhost ([127.0.0.1]:44009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqVHy-0002MS-U3 for submit@debbugs.gnu.org; Sat, 30 Mar 2024 05:46:15 -0400 Original-Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:53427) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqVHv-0002MD-7H for 70036@debbugs.gnu.org; Sat, 30 Mar 2024 05:46:13 -0400 Original-Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a465ddc2c09so149018366b.2 for <70036@debbugs.gnu.org>; Sat, 30 Mar 2024 02:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711791963; x=1712396763; darn=debbugs.gnu.org; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=fS5ZHG0AA6HvG/9ndxZby5pbzO7Rll+MbCy4dYEyXG0=; b=jH1NZoElJhwb7ytALWcfdTddwlk9zdyqw5wsgu2j33W6acbjADsU7r97a/J66JTRK1 mtIbUcsuL8Bp4JPG9TVLOvWReZk7yD80cyCzQeVR0esbbdjnMiM794pcHhXlsjI+1GxC NqhpZHn3CP06xavX6xULN1BV1UjdP9aqymaMjphZfLoZThBIy0AMvqDLopzp9POjxdYy pmkHWPfays80AmaL9MFfhG4vnostX9IgGRvqWQg0oYdTBCFTFLjomcCthb+Iocb2mPQw uNnkFURO9lHea+fFUHEQ9dvwjUMwO+JTfD4ULfNl4zk++kaT1fvt2eEstpp3Uzxp2x/S gbbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711791963; x=1712396763; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fS5ZHG0AA6HvG/9ndxZby5pbzO7Rll+MbCy4dYEyXG0=; b=KxyyivxRlpWCHtIAtb8gJh3xf2zoRq+GIlSQdcjfb5yecRqeIxgEr/IpuciexKH0mg BLE+YeZloNjVHpDG99tpU8TC4U546tMMX9eVmuo0V0yn2UfuELxtGfAQ9LsJOpo17D8K hrYC17yGng9uu7Dc63HnEclO0EeQ5unZ01RBIHgqOgvH3hOYgWoJ1tiwxen8oPMdD4CV zCSq7OOXyLLoN4dmp6OUPbsfGVmqOIiibG6FR7JcWLK0DTdkFJJbONQGrHZDJEn+YfBW pgHG2MDac9GibEgU887h20xpZKu5Ec4Hm90KmTYxW2X0VG9gIlHsDK2YY9/yhBla6FKI 5Y0Q== X-Forwarded-Encrypted: i=1; AJvYcCUcmHFj1mAFXE39xYc+6lrtXbGmCjhdt1xzxlNQDAV3pgXrMIm/lUwjQXwmSySb56QUcvuZ+xMdRS2CvAeId2tQQjJNNHM= X-Gm-Message-State: AOJu0Ywu++rH+DB/FSfKGoxQhJqttieGflqt5Ywlap4ejPxGIq/mJCtT WiRq7fDK2rdjlajDZ2O/Lcps/nO4xWJwwi4FP8VK0YR+U+7KGu9yfmqQSM4y X-Google-Smtp-Source: AGHT+IEDOm3mIbAbHZvJfWUNynJXHBT36jFT5lCEu4kq3rm1KfS7MigdI/LWIQIf3UgvL0WJ0WQymQ== X-Received: by 2002:a05:6402:5202:b0:56d:b5ce:9e04 with SMTP id s2-20020a056402520200b0056db5ce9e04mr3368473edd.30.1711791962455; Sat, 30 Mar 2024 02:46:02 -0700 (PDT) Original-Received: from betli.gmail.com (catv-213-222-160-137.catv.fixed.vodafone.hu. [213.222.160.137]) by smtp.gmail.com with ESMTPSA id fe8-20020a056402390800b0056c522d014esm2931729edb.57.2024.03.30.02.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 02:46:02 -0700 (PDT) In-Reply-To: <8734say2wi.fsf@thornhill.no> (Theodor Thornhill via's message of "Thu, 28 Mar 2024 13:08:45 +0100") Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX5+fmhoaEwMDD/ ///TMNVWAAAAAWJLR0QDEQxM8gAAAAlwSFlzAAAPEgAADxIBIZvyMwAAAAd0SU1FB+AICBUfHgLs gGoAAAGXSURBVCjPRdK/b5tAFAfw753gBEwM2ApMbuVIqf+Ko0qiyhOu4sj2xJBYMn/FUdX7UUUZ OjHgyvf+yj6IcW6Bjx53934ADEvs8bmEr8UVoTYTOyJO9KoYsVofN8kILdbeJ8Li6YpZWop4xOK0 VdfIoXmkHn5/5D7/Ts/8THacSqnkKTcMTxgUkVzFnEIRTKwwYYSCvzfg16f0i8YApW/XG/Pm8R49 dXjxKmRnxv3OwooQWcv4RUYem1fsNe/WU63uk7AmYxk78y32/ee2tZB4fO+WcZ7lnIGEolXW1EGw LfkSuQ0XTgRefgNlfNwRNV6QhBxJ8JNxTMUPyBqTd0bjaAP5G7NJRU39z80hLOZTjqB7K3tEEFSj aEsuQew6qBxxyhHjVUR7H7NpC9iHJZGLMCEuweqAqE1BHbfK2oRIz9EHYA/+wiFWru9smeVfuWNZ 2+NFtX80UA1TvJNdytM4DwO4kY7bJz8Qcd0G0ceslZGkkeoBsjUHwF1+jjM3XHaXEZ7mGLfwPFO+ RV9QLY2iEdmDo78D/gNPaXVYqd+pyQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wOC0wOFQyMzoz MDoyOCswMjowMGy/yHYAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDgtMDhUMjM6MzA6MjgrMDI6 MDAd4nDKAAAAAElFTkSuQmCC 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:282342 Archived-At: Theodor Thornhill writes: > Felician Nemeth writes: >> Theo, can you email me the relevant messages that your server sends >> to Emacs? Does the server send lots of similar diagnostics messages >> frequently? > I'll try to include such a report a little later today. Thanks, that would be helpful. > [2. text/x-diff; 0001-Don-t-use-file-truepath-in-Eglot-bug-70036.patch]... I think using find-buffer-visiting instead of get-file-buffer and file-truename instead of expand-file-name in Eglot is problematic. Let's say we have these files: /project/a.c /project/a.h -> /other/a.h Eglot will communicate these file names to the LSP server: /project/a.c and /other/a.h. Then the server cannot "associate" a.h with a.c. Additionally, a.h will be outside of the LSP workspace. This indeed confuses clangd a bit: it only takes into account the changes of buffer a.h when it is saved. (Because it assumes /project/a.h is not opened in the editor.) ------ Regarding the patch itself, cache invalidation is missing from it. The user might kill a buffer or save it under a different name with write-file. Changing (PATH -> BUFFER) to (PATH -> (BUFFER, FILENAME)) would probably work. Eglot should save the current buffer-file-name when it inserts a new item into the hash of managed-buffers. And when it retrieves an item, it should verify whether the buffer-file-name is the same as the saved file-name. Can file-truepath change while buffer-file-name remains the same? Yes, but I think Eglot could ignore those rare cases, or handle it elsewhere. (For example, it could update the cache entry after a buffer is saved.)