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 09:52:32 -0800 Message-ID: <96603590-acc9-65d1-4086-7e2f114f9441@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4545"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Daniel Mendler To: Stefan Monnier , 54001@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 14 18:53:35 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 1nJfXa-0000vb-BV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Feb 2022 18:53:34 +0100 Original-Received: from localhost ([::1]:52726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJfXY-0006UB-SK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Feb 2022 12:53:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJfXI-0006St-0w for bug-gnu-emacs@gnu.org; Mon, 14 Feb 2022 12:53:16 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJfX3-0004SR-PN for bug-gnu-emacs@gnu.org; Mon, 14 Feb 2022 12:53:15 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJfX3-0001Xa-L1 for bug-gnu-emacs@gnu.org; Mon, 14 Feb 2022 12:53:01 -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 17:53:01 +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.16448611605888 (code B ref 54001); Mon, 14 Feb 2022 17:53:01 +0000 Original-Received: (at 54001) by debbugs.gnu.org; 14 Feb 2022 17:52:40 +0000 Original-Received: from localhost ([127.0.0.1]:42493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJfWi-0001Wu-AB for submit@debbugs.gnu.org; Mon, 14 Feb 2022 12:52:40 -0500 Original-Received: from mail-pl1-f178.google.com ([209.85.214.178]:37846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJfWf-0001Wg-Ft for 54001@debbugs.gnu.org; Mon, 14 Feb 2022 12:52:38 -0500 Original-Received: by mail-pl1-f178.google.com with SMTP id x4so11135470plb.4 for <54001@debbugs.gnu.org>; Mon, 14 Feb 2022 09:52:37 -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:content-transfer-encoding; bh=PcegR0gAKg2ptFMf4SM7UqRMH0/X0OVw6zNVnp7GQI4=; b=A1fg7Mj3KAfL4TiXYzQa+N8wdmXNnABWZWLSoIUEQpvtBbtJ1slCVMmP4TVEMznQul n1nI7SGwdwRaK1hlEQLTXpYsaFDbRtwZkRleJoIJH17m7XZN3jlGhhTrVLIfA0B/Tok9 Bl10eGHBT4YZS0VirAyr/aJc+mYzP77O0mEctr4Ue97y1E0Zykd3nVdBjg8/GUO/gJ+N vvGQlsi9+TDf8FAxZb5TXCQpt0GRZ0KbTwDAr4oeRStrBVyuUl/F/kgtsT1tO1FaFiuq 2Ay9NiBf8d0+KBeJTD0jXw4R3X/vPgnzEv8F3VHsg0iuYgeTK+I5LWgnfQfyMa7ceLO3 BkCQ== 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:content-transfer-encoding; bh=PcegR0gAKg2ptFMf4SM7UqRMH0/X0OVw6zNVnp7GQI4=; b=VUtn/hi8Ou/E8rbCFsgVysMZx9Q2ffEn0S+kHCbbeFMkGGjHEpEtzfH4LhCP3fjAUh ZfeiO5Uy9qxnHvFWPj2NUpfBvg7MAXQggacN7VO1UYu7Kf2+A9179QFnkBhiqoxcQR/3 QyfbORVP3plmSWGS8LeK3PXKDmyRZc8v6wjaKlSc5jnrQcvkUE4FjS9QAPQq43XoUc9q tYZb6Skyj/k8+UgYts1xWQxwWFUeP0Hai32yHgBu6g2lODsUfGyaRnRgvAgZ2cDltjpC Jr4yllLiT2q3A8447XEalgTLacq6tyPKd6yZdooQIZOyC6SIW3vF+25+1z5Nf/DuwSpl 2fZQ== X-Gm-Message-State: AOAM530AYpssTYbJuMTCYojWMxTfSYGVpENtlBeAgPVLpjopmnA1XAPX B7Zc7BZmjIo0LXc9DghahRM= X-Google-Smtp-Source: ABdhPJz3yLymwmi3cCvYBPBFOAGB9t17eEADVGoeMGMhSC9LiJ9L9s5SrurQgqgFjWFMuZfjrWMD7w== X-Received: by 2002:a17:90a:ae11:: with SMTP id t17mr798475pjq.53.1644861151480; Mon, 14 Feb 2022 09:52:31 -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 d16sm30430461pfj.1.2022.02.14.09.52.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Feb 2022 09:52:31 -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:226909 Archived-At: On 2/14/2022 9:19 AM, Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Package: Emacs > Version: 29.0.50 > > > Since: > > commit bf505a63f98ed61934a8fb81ec65c96859606b6e > Author: Jim Porter > Date: Mon Nov 15 13:33:07 2021 +0100 > > Support abbreviating home directory of Tramp filenames > > `abbreviate-file-name` has significantly changed in its behavior: > - it's slower (because it goes through file-name-handlers) > - it can have very visible side effects like prompting the user for a password. > > I haven't measured the slowdown, so I'll assume it's acceptable, but > asking for a password (or contacting a remote host) is not. Sorry about that. I did what I could to minimize the slowdown (including some more general optimizations to make Tramp faster). There are some benchmarks in the original bug here (these are with 1000 iterations; you'll want to compare the first section with the last): . > I suggest we take a step back and think of how to get that feature > without having to contact any remote host during `abbreviate-file-name`. > Maybe we can do that by making Tramp opportunistically add entries to > `directory-abbrev-alist` when it performs expansion? I think Michael Albinus suggested doing that in the original bug, although I was concerned about modifying defcustoms invisibly like that. Is that ok to do? Another option might be to store the abbreviations for a given file-name-handler somewhere internally and consult that when calling that file-name-handler's implementation of `abbreviate-file-name'. Maybe this patch should be backed out for now; it shouldn't be interrupting the user. (I thought I'd tested that, but maybe it was on an earlier revision of the patch.) I'll probably have time to look into a new solution in a few weeks, but anyone else who's interested should feel free to fix it in the meantime.