From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#58360: 28.2; tramp-archive and file-directory-p Date: Sat, 08 Oct 2022 13:38:41 +0200 Message-ID: <87czb2ee9q.fsf@gmx.de> References: <877d1bk5mq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8625"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 58360@debbugs.gnu.org To: Gustavo Barros Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 08 13:39: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 1oh8Ax-00027e-9o for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 13:39:27 +0200 Original-Received: from localhost ([::1]:58786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oh8Av-0001T0-W4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Oct 2022 07:39:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh8AY-0001Sq-Hf for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 07:39:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oh8AY-0000aG-3h for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 07:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oh8AX-00087l-Vy for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2022 07:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Oct 2022 11:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58360 X-GNU-PR-Package: emacs Original-Received: via spool by 58360-submit@debbugs.gnu.org id=B58360.166522913331214 (code B ref 58360); Sat, 08 Oct 2022 11:39:01 +0000 Original-Received: (at 58360) by debbugs.gnu.org; 8 Oct 2022 11:38:53 +0000 Original-Received: from localhost ([127.0.0.1]:38444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh8AP-00087O-8o for submit@debbugs.gnu.org; Sat, 08 Oct 2022 07:38:53 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:45247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oh8AL-000879-Bn for 58360@debbugs.gnu.org; Sat, 08 Oct 2022 07:38:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1665229122; bh=9gl9R+AJSPWop0nVARtjA65EvXN6ke6B5DhyZfOwKig=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=corK6xOgZPw3QOOtTbcBtTrInrytoVR+MiFZJQGIMYS3Qe+PpBza+OXyBhyTe6oFg eAigN5tukK+2K2DkbJQTVqB+GFhfNl7hCO4qjHL5nzb4TXkAdh3DUeiYD0ZEp2PrCV j83gVWLu6BdfAV9kj9O7EoQlrgQvnzgcmVIWccu4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.148.171]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mqs0X-1pTNA30zRp-00moHo; Sat, 08 Oct 2022 13:38:42 +0200 In-Reply-To: <877d1bk5mq.fsf@gmail.com> (Gustavo Barros's message of "Fri, 07 Oct 2022 12:23:31 -0300") X-Provags-ID: V03:K1:u3rVI/pZHJOl+gnZJODHuvBg2AtN7qm+7fbucH0+cmdqGUrJIcW IPn6mRwrB0HEqWygh3bx0pgG3sZv4e+bB1+QFGOWbV201H7bZIKb/uLP4EeonOgbAID3PeX JiyLQIXvXSPwnhegGKGqr8SoTSdGYT2sbHIXaRK3WwXAqNiVfXaWU4D4mGzaD08UU++5GCo 4cXiqTRilDwLUMJLId34w== X-UI-Out-Filterresults: notjunk:1;V03:K0:WmWCTKmVNro=:uyCJTj1mNd6tF2VPXTbPLQ hpPyWoJGADYq0x2d1/h4O50066jhNHZ+Aafcf+7z4I2wxyYzD7beR2Nw8+vELySwi6UWhrVi8 fmRyWCTaU8fne+EozRu5qg0wmItbKzaT7OGasYC+n3JHXjqgRpKpEmNxkMaZXXWSF2LOAqFk1 eMFVyc3MTyqGEFqQiSlqJ6561RFz2GJ+egApYZc/b9YP8RGvPOv5hszbhRDMYlv2K55+Rh2+M tpTsyhDAhHsSy2zuLDMRjizmd+ywzcCClwMe+q+2xKLLagicRbsQeJU6Wx12J+y2CC0AZeFon vOys2PYeuMsrecTpu3teabaHwpWWBhVhUajxuvDFfjA2BUbsnXoF9EpUXSXe39gAWRvNXD4RO L6rQY4SG2Zgk8XQqQpbp1WZyCgq9Z/TdAYiCcNewjKUFviHETlafuuJ5w1q+TVunF7PcXI8sE 9upEq1Du2E+XZap42klo37mgVxDXOp5orA7Q3tfIWaEBBFwoAQ7jO4OLXWJOr5nbCyBruCPwa MLyWZIgCt8GcgXHAhCCel792xN55JZi+hv6SZtFn93iIsnJ8KFQZfGOndWH6H+XJTDgDlnbih IFXRNruDFR/oVzedyC3HpAgb7sN8LHGLinsBWTUhupT+lNg//SXx+XLICF+6ViM1+SgAjPIN+ v1iybYA/xHxHCDxR6w3ukiu/VCUH9Ag1J2k6Xh29i4JxcXrAZNfivj2v7rPOgSLpM4hxTcrmX ms8bLvEsw9LQSKmIPzVKy/wXZzcqVXhUstq1KJrby4KuoE36u8FB7Z3S4WC1cyTyH3WUYZ+9 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:244885 Archived-At: Gustavo Barros writes: > Hi All, Hi Gustavo, > The thing started with `counsel-find-file' which, instead of opening > an ODT file as I wished to do, would auto mount a volume on the system > and then navigate inside it as a directory. > > I went down the rabbit hole, and it turns out that `file-directory-p' > returns `t' for an ODT file appended with a slash. And the reason it > does is that `tramp-archive' is enabled by default, and that > OpenDocument format extensions are included in > `tramp-archive-suffixes'. > > So, if you try: > > (file-directory-p (expand-file-name "~/file.odt/")) > > provided that "~/file.odt" exists, will return `t' on an "emacs -Q" > session. > > Is this really intended? It was baffling to me (to the point that > I've personally set `tramp-archive-enabled' to nil, as Tramp's manual > taught me to), but perhaps there are use cases which I'm missing that > may justify it. This is intended. There is no need for packages like counsel to check (file-directory-p (expand-file-name "~/file.odt/")) It is a misuse to add a slash to an existing regular file and pray that it works. There has been a similar error in ange-ftp, see bug#56078. It has fixed. I recommend to contact the counsel author for a fix. > A side comment on this. Even assuming this is intended behavior, is > it really the case to bundle up every file type extension supported by > "libarchive" in `tramp-archive-suffixes'? There may be people who > wish to navigate into "tar", "iso", "rar" or "zip" files as > directories. But why should this be the default for OpenDocument > formats, or for "exe", or "deb" files, for example, for which the > desired behavior is likely something else? There might be people who wish to navigate into "odt", "exe", or "deb" files. It shall be possible. It happens only if you access "/path/to/file.odt/" (the trailing slash is important), for which there is no other desired behavior I could imagine. > Furthermore, `tramp-archive-suffixes' is a defconst, not a > defcustom. So users are stuck with "all or nothing", unable to select > for which file types tramp-archive should be used or not. (Of course, > I know one can always change things regardless, but that's not the > point.) I doubt that people would change such a user option. What would be the use case? There is still tramp-archive-enabled, and if a package really really really wants to access "file.odt/" for another purpose than the intended, the package shall let-bind this variable. > Best regards, > Gustavo. Best regards, Michael.