From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#54001: 29.0.50; abbreviate-file-name has side-effects Date: Mon, 14 Feb 2022 13:38:58 -0800 Message-ID: References: <96603590-acc9-65d1-4086-7e2f114f9441@gmail.com> <506247fd-ed3a-f560-c8b5-1ece88cdfa76@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------EED72BCE072C2BA326A623E3" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33288"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Daniel Mendler , 54001@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 14 22:41:28 2022 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 1nJj68-0008XU-Gc for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Feb 2022 22:41:28 +0100 Original-Received: from localhost ([::1]:47600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJj67-0001NM-Gj for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Feb 2022 16:41:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJj4l-0008RM-3C for bug-gnu-emacs@gnu.org; Mon, 14 Feb 2022 16:40:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJj4k-0000Oi-Ha for bug-gnu-emacs@gnu.org; Mon, 14 Feb 2022 16:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJj4k-0007HX-Eu for bug-gnu-emacs@gnu.org; Mon, 14 Feb 2022 16:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Feb 2022 21:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54001 X-GNU-PR-Package: emacs Original-Received: via spool by 54001-submit@debbugs.gnu.org id=B54001.164487475427907 (code B ref 54001); Mon, 14 Feb 2022 21:40:02 +0000 Original-Received: (at 54001) by debbugs.gnu.org; 14 Feb 2022 21:39:14 +0000 Original-Received: from localhost ([127.0.0.1]:42819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJj3s-0007Fy-Nm for submit@debbugs.gnu.org; Mon, 14 Feb 2022 16:39:14 -0500 Original-Received: from mail-pl1-f179.google.com ([209.85.214.179]:36754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJj3p-0007FS-Ee for 54001@debbugs.gnu.org; Mon, 14 Feb 2022 16:39:07 -0500 Original-Received: by mail-pl1-f179.google.com with SMTP id u5so368048ple.3 for <54001@debbugs.gnu.org>; Mon, 14 Feb 2022 13:39:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language; bh=MbBsLBiAl6pI0PXIJjph6O+CVPXuy+JAtTj6UXEBHBs=; b=ip3VqfLr+gDvO6Tf7zxQqaxbGZ5aMDOA8lgmuF7UoNq9tu9GmM4xt1IaDCPwNsx9Ja CdhqqvW9fuSzpUXZahhrOPB3+4/IaxGJyqYnJ1PhLc5glV/Q/FYIC7aXlwlrFcGk45dh R6/8OYtkzAgllSUQkAZPiLLbxVoKDtyrnh3xMkenpH+wS+9+4xtOY6VcrBT6Y2etXlUo wUuTxB4gwsKnCU4anicQhNHBvwEIflv9pn+35HFytCmgkbTcBVjahq6M6dI9rzv8pvH7 u6erL3YFxCmN2OxKAtG7nxSf8cyTE74tDHfHJCb2KY5j91GvdROCuOsJVj3cyPbmgkOQ kCaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language; bh=MbBsLBiAl6pI0PXIJjph6O+CVPXuy+JAtTj6UXEBHBs=; b=sXewATy0DF4UJQvfI0blnQBsMockW6TPOzBGX1D+nVH6Qx6OKsv6So7OXc/Wtp9C8H O2nUEPL0HeqFhGu12lp2bRh7nal3Qw8+szurUwobA6ALneSskFqQorknEVl2mFCmeFFy N8UTqqBYaItiOKECmt6/YxMHTwhGaMEf6ye20x1wp71MBLhwc6EasrYKIlKTSfWrKUxt 5pvqTmp81fhdWQjAcTRi6vUfeQm8UOD1u6JrAWt9mY26i1RwN5o7uQngGJ1x6w1oMgFZ vl0EuivP/DoRAELkpBVpidRrrTBWO3KWxsSH8sG5OXALgJ434D7Cue3xNxeT0O9Hixk3 K/xQ== X-Gm-Message-State: AOAM533owcCgovC+LNIrHMTUqK0L6V+ov6i+WPuhznReFb2up3poyqVB mA85tUf3vuxLoQIYdYPDSWLXUh24Bzs= X-Google-Smtp-Source: ABdhPJyTJdkKQ8/P9flj6VDZ1sXHQFWCRo77XfcKEoH7hM5MpY9VeIepC1NkFSemJkLCoBjJCAlv5Q== X-Received: by 2002:a17:902:d641:: with SMTP id y1mr790545plh.64.1644874739558; Mon, 14 Feb 2022 13:38:59 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id y10sm2889288pjc.0.2022.02.14.13.38.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 13:38:58 -0800 (PST) In-Reply-To: Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:226924 Archived-At: This is a multi-part message in MIME format. --------------EED72BCE072C2BA326A623E3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2/14/2022 1:00 PM, Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: >> Looking at my original patch again, this value is already cached as a Tramp >> connection property named "home-directory". If the code were changed to set >> that connection property in a more-appropriate place, and >> `tramp-handle-abbreviate-file-name' simply *reads* that connection property, >> then I think that should resolve this issue. > > Sounds like it, I've only lightly tested this patch, but I think it should resolve the issue. It only sets the "home-directory" connection property when a connection is already established. Otherwise, it just uses the cached value (if any). Maybe there's a cleaner way to do this though; opportunistically setting a connection property like this seems like something there might be a special function for in Tramp, but I didn't see one after a bit of looking so this is what I went with. --------------EED72BCE072C2BA326A623E3 Content-Type: text/plain; charset=UTF-8; name="0001-Don-t-attempt-to-connect-to-a-remote-server-during-a.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-Don-t-attempt-to-connect-to-a-remote-server-during-a.pa"; filename*1="tch" RnJvbSBmNjZkY2JkYmNkMjZhZDk3NDIzZTM3MDM0NTA4YTMyZjU1MjYzNTk3IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j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