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#60505: 29.0.60; Fido Mode and Tramp Completion Date: Fri, 03 Feb 2023 20:23:26 +0100 Message-ID: <87h6w2d041.fsf@gmx.de> References: <87k024918k.fsf@jroy.ca> <8dea9f3e0e411c315b04@heytings.org> <87tu15m6g7.fsf@gmx.de> <8dea9f3e0eb47ac9e4ab@heytings.org> <371ba1d0be1f14c7c798@heytings.org> <8aadf0ddd54d67a3213d@heytings.org> <87a62jmwj6.fsf@gmx.de> <87o7qwm3dd.fsf@gmx.de> <43562d4dd9c31382eb40@heytings.org> <87k011dtw2.fsf@gmx.de> <43562d4dd93037f7d01f@heytings.org> <834js4zi69.fsf@gnu.org> <87cz6seanu.fsf@gmx.de> <87mt5udaey.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29769"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 60505@debbugs.gnu.org, Eli Zaretskii , Gregory Heytings , julien@jroy.ca To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 03 20:24:28 2023 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 1pO1ff-0007Zp-L2 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Feb 2023 20:24:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pO1fM-0000Tj-Cq; Fri, 03 Feb 2023 14:24:08 -0500 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 1pO1fG-0000Sd-Sn for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 14:24:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO1fG-0001pZ-KD for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 14:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pO1fG-0000fy-4P for bug-gnu-emacs@gnu.org; Fri, 03 Feb 2023 14:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Feb 2023 19:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60505 X-GNU-PR-Package: emacs Original-Received: via spool by 60505-submit@debbugs.gnu.org id=B60505.16754522232565 (code B ref 60505); Fri, 03 Feb 2023 19:24:02 +0000 Original-Received: (at 60505) by debbugs.gnu.org; 3 Feb 2023 19:23:43 +0000 Original-Received: from localhost ([127.0.0.1]:40006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO1ew-0000fI-OC for submit@debbugs.gnu.org; Fri, 03 Feb 2023 14:23:43 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:34079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO1et-0000f5-IE for 60505@debbugs.gnu.org; Fri, 03 Feb 2023 14:23:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1675452208; bh=cjWb16PV5qLN87k0fOOPdqJEIEMl4WEoky+XqrbfxVg=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=MazSkeQqPoxAnwvulcavdKoAv8L+PvbgyJgNVELpx4+ym/EtbUEFK2sXgTgMe5hC7 eGuAYkCnan/PM2YAAuTIx40VCAXJ68jUtA/fkaKzE144rhkhEVRwBtoZ26CgJcu50A ucPdhaHxPXrWW3t+dqsJUHhwGw9zOdOtKGDq1OFddx0KfTbVjvxg6AEXQKy5ec5a7a xqBNpUuHGtk2IolXBZZrvOzGLihPznJu34KkVVkdGpmk4Dsi7qmLewsMFFoP406Jse OZ2qohmeowEzpMNgeOHc3aBv/sa/UNDffbzAI8tIjN46+zs22hoYJZXRAvXVeI0yZK UPUDmt6f00Hfw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.22]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N63Vi-1oZVUW1hxA-016MMt; Fri, 03 Feb 2023 20:23:28 +0100 In-Reply-To: (Stefan Monnier's message of "Fri, 03 Feb 2023 13:43:07 -0500") X-Provags-ID: V03:K1:FVjl/7NeAjZ8LMs5aaZyeG+sXMocGk7TZY6y3vSPqK/LuVxbOap vB5727QKIQpdQr8CReAsNOlzb8MXASIJepNF8u0r1/iTKyevXmcOUZT8LxpS7thnI6+YDN4 ZaGU8MmQpnHk2vX0N/Z2hwoZ9l49j39RvHq9Na3q9JuRt4YbpDUv8H/eyAkyLx6twd5ErD6 AowVQ91vWeWj/NHJ+oz2g== UI-OutboundReport: notjunk:1;M01:P0:mnwkbSffbs0=;dJe/h38CKAUFCZx+hG/sBQgAC2x kzTWPye9iorCSe3SaMcYnBe5lI4Cayi1+4j5vqWivDNA+pzNE9ZJiCnKwAsg0IcTpPrfyjZIW uc2jnw1vBMmpSYElcO+Cgji6oSnEGcQORiggwIDoKsRhZuT06Sukir3jadvrZyqi7dQAGVyhD qamOc6nMCeENCWN53mENibVOwsgjdw1Vijt4TRAkodSW7cvRPXI20oN4QBm/Q6TGqS6EOUglC gJW9noZBWYAzHN/fITadRA9uIz1scyb4PQ+SfBjNMI8CUUAOtRf1JgGvs/LdaEItR3qa3jL/3 sOw3on7UKw1mgfnmM/LznwQLmB0e7wf5zMMjGPxKrDTTJl4m80Lr9uwfrR69Zx44L5OWyTKc7 vU3GVLWAhIg9lbpxPL7Sg23CHZt879rxXyzhXcdRiNvTi38GTUdBIwFdBpEdho7tHfIFgU18O o7RhdtTeEjyDKavutScguF2goICCfm6UOD9EMg3DBYlE8l7wIJBikluLImcPZlYXOOy0cns1r aVaQ58Q0sldjZ0eLdZWfx0I8uKy/K+qUBQnKFVSusuUeDRggRx0ebLnpMtN0T8AeT5dV1IdZw xy5JdXERrm5d6i5N1BcTd5gyvaKX4aRyHNCXykqk5QLe/FIwRBX9U2pSA/7Hxh8ufYI5gepI/ zNsG5ZBndBMux0BqMx0V1+e0mwVU9kI0TpQfuNqvnCuh9i1rMaVrt+Z69mWYmNtBtL6QTx/pe Cjz3oPwDSuudGYd2C4Hl/pgJkyi36AYHaPQ4jPWtWbmRewCPyKwZATmGLo2Du+IYSVg+iHSn 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:254741 Archived-At: Stefan Monnier writes: Hi Stefan, >> +(defun tramp-completion-handle-expand-file-name (filename &optional directory) >> + "Like `expand-file-name' for partial Tramp files." >> + (if (file-name-absolute-p filename) >> + filename >> + (concat (or directory default-directory "/") filename))) > > Hmm... shouldn't a "/" may need to be added if `directory` or > `default-directory` doesn't end with one (except in cases like `/ssh:`)? Rather not. We're speaking about the tramp-completion-file-name-handler, which is activated for file names matching "\\`\\(?:\\)?/\\(?:\\(?:\\(-\\|[[:alnum:]]\\{2,\\}\\)\\(?::\\)\\(?:\\([^/:|[:blank:]]+\\)\\(?:@\\)\\)?\\(\\(?:[%._[:alnum:]-]+\\|\\(?:\\[\\)\\(?:\\(?:[[:alnum:]]*:\\)+[.[:alnum:]]*\\)?\\(?:]\\)\\)\\(?:\\(?:#\\)\\(?:[[:digit:]]+\\)\\)?\\)?\\)\\(?:|\\)\\)*\\(?:\\(?:-\\|[[:alnum:]]+\\)\\(?:\\(?::\\)\\(?:[%._[:alnum:]-]+\\)?\\)?\\)?\\'". It looks complex, but in practice it is everything until "/method:user@host" without a trailing colon. No slash there. It's value is --8<---------------cut here---------------start------------->8--- (rx bos ;; `file-name-completion' uses absolute paths for matching. ;; This means that on W32 systems, something like ;; "/ssh:host:~/path" becomes "c:/ssh:host:~/path". See also ;; `tramp-drop-volume-letter'. (? (regexp tramp-volume-letter-regexp)) ;; We cannot use `tramp-prefix-regexp', because it starts with `bol'. (literal tramp-prefix-format) ;; Optional multi hops. (* (regexp tramp-remote-file-name-spec-regexp) (regexp tramp-postfix-hop-regexp)) ;; Last hop. (? (regexp tramp-completion-method-regexp) ;; Method separator, user name and host name. (? (regexp tramp-postfix-method-regexp) ;; This is a little bit lax, but it serves. (? (regexp tramp-host-regexp)))) eos) --8<---------------cut here---------------end--------------->8--- > Then again, maybe not. I don't understand enough of the details of when > `tramp-completion-file-name-handler` is used (IOW what is meant exactly by > "partial Tramp file name"). Exactly that. > I didn't remember this part of the design, but it sounds good and does > make changes to that part (like the proposed patch) "safer", so it's > probably OK to try it on `master`. There is no special design for it. Ordinary file name handler machinery. > I wonder how this patch interacts with `locate-dominating-file`. I'll check tomorrow. But since there isn't a slash in such filenames (except the leading one), I expect it shall work. Needs more testing, this case and other use cases. > Stefan Best regards, Michael.