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.devel Subject: Re: Emacs syntax for filenames to mean "absolute location on the current remote host"? Date: Tue, 29 Aug 2023 09:30:45 +0200 Message-ID: <877cpeuwyi.fsf@gmx.de> References: <749b83b2-a8f8-76c5-83e8-2f4044476f74@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="8356"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Jim Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 29 09:31:43 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qatCQ-00022B-Ui for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Aug 2023 09:31:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qatBg-00054X-3R; Tue, 29 Aug 2023 03:30:56 -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 1qatBd-00054E-5Y for emacs-devel@gnu.org; Tue, 29 Aug 2023 03:30:53 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qatBa-0006yS-3B for emacs-devel@gnu.org; Tue, 29 Aug 2023 03:30:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1693294246; x=1693899046; i=michael.albinus@gmx.de; bh=GA+rFX9hLyKxMbBwKcdxFsGzGOfcWrp6WVhFmQwktew=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=MucJoCPaelGWA57svs4S6ifR41Egh7qLmO/fhdBoV+YVsWzrp7l9LMJEbu8b+LEzr+iR7mu cedJWdWvRwwQgJGanKDbbSQWnFjxOAw+Aipfw+sX8pkKlPjGSpxkDnAmmfjr6IEmrt6zraH5p IWHkf95363krpvAtwOMk9y/Ll21Ev0FgNXzPvnCDKIlvcvukHCDKvujipdiMK4t/YiH7EHkLm 9t0jnypFu5L3zRSKVhLFZaSAIQZMVV4PURE3S8zE4CAl9B7066afB36KAXWdJ0UDhEcXbWgRn ghav3xAvV3WH578Hr2g0d4VO6+obAXB1OG3m3PC6iCouQNI0hl1w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.16]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MaJ81-1qDbAR1Agf-00WEhO; Tue, 29 Aug 2023 09:30:46 +0200 In-Reply-To: <749b83b2-a8f8-76c5-83e8-2f4044476f74@gmail.com> (Jim Porter's message of "Mon, 28 Aug 2023 20:51:56 -0700") X-Provags-ID: V03:K1:yx4zIrwlqQYtJc0IRp9mNkH59AmJf705apZ+sGyRG4HRR2T4Kqe Ge6ITLAYdkhatGA1dLtVbxvsO/ej4jCOqWavGcotIVK3svki+ut5TO3CTlbdMlSfm+uGCUF a5PTWgnhi99GuULeTwg9FboJTCvxmWi+u3HcFVG/ZBh8rdSYhUwd4BsCWEN99uWg3hMh3cZ J+hBsGSE6P5i4jndUPpsg== UI-OutboundReport: notjunk:1;M01:P0:Cjudq5mNLP0=;84uB+31iijeaMLt7wyp54BNVWG2 2P5KRfmPSlo+aZSMV9zTe503Ou0Or7V3iy+3LJ72baqjLJ8gQ7sEFuHmwgk8Fk/8WLv9LsSxz LBiS5TEUj2whtQiXoJ7HKiVbXE7pvGUVOZdpVeVehRWDNyDHPj1jU13FiDJ8RWqbOcHzVZ/bR td8udosI24lnurl78bRSqUZwNpNOd+/qTLz4cA8H2vlABKX815GZl7zHWD9Lxw2BMr89DqEce gYmjya9q6LqpYD/CZAjsNDxocit2GK6UDVQPSIL+sWAAupuOcQlbEMI5YnC+3kks0ogTEzbKQ v0NseGMtOIGLW2Gu1bgqKpSzZgSa0TYBlqEM/QyyUvAJv4FRVI5wbGI5txKdowSyrCUuvQsiW CjqQmgxua6bWjOJvEcjbefuth1MIZAg9Oz7RNGFJwdVpztC8J4KBinjMtP65Gpik9PhUFYBkT nhdVwgSUVPGLU88EJGD23oND2DZNfreWSsxXYMp7+3X4IOQ9qgHFJtLS++YZA+k7VYIZPOng1 KNZGbHurdrakyulthE7pz/ebpVVlQNrCGp2IwLYw+EbWCFTyFE9vOCT/MaIz1wl8I1xX99F9Y +EM6WjIn4VLjZ4PiyuoPJ0HQueqPU/xSrkeIPE2XmTme1DxrfNfXU1gsS3rqQWjl5Q3lz7LST QGpmYpvICMsMmxc0ldUJ98TFJRMZ8UeOkspu8FtitAsKExXSLLeoOX4eLJrvbV3NckCOzqA9/ eFtytv75Q3Q4DUHvjG5avSVzoVd8wXwLQEuDwcJyNNPfwCd8AB5FLjJdihkLRbUvJJAQGaQg Received-SPF: pass client-ip=212.227.17.22; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309478 Archived-At: Jim Porter writes: Hi Jim, > In Emacs, is there a way of spelling a file name to mean "an absolute > name on the current remote host"? We have a way of spelling an > absolute name on the local host ("/foo/bar"), and an absolute name on > a specific remote ("/method:host:/foo/bar"), but I'm not aware of a > way to make a string that means the equivalent of: > > (concat (file-name-remote-p default-directory) "/foo/bar") > > Do we have a syntax for this? If not, could we add one? Maybe > something like "/.::/foo/bar"? That would be a remote file name with > the method of "." - i.e. "the current method" and no hostname (it > would be inferred from the current remote). Anything goes. However, if we go this way, I wouldn't mix this with Tramp's remote file name syntax, and the respective file name handler. We would need a new file name handler similar to file-name-non-special, which would be activated via "/.:/foo/bar" (a little bit shorter). > If you'd like to know why I'm asking, read on. But be warned: I'm > still trying to reason through all the logic here myself, so this may > be a bit confusing (it certainly is for me!). > > This is relevant for Eshell. In Eshell, you SSH into other hosts > simply by using "cd /ssh:user@host:~". This is very convenient, but it > produces some odd effects: when you're on a remote host like this, the > meaning of "/foo/bar" is ambiguous. If you pass that to a command, it > could mean: > > 1) "/foo/bar" on your local filesystem (when the command is an Emacs > Lisp function) > > 2) "/foo/bar" on "host" (when the command is an external process) Thinking about, it seems we need this *only* in Eshell. And then the need isn't such obvious. What if you declare, that in Eshell an absolute file name "/foo/bar" is always on "host"? Then it doesn't matter, whether a user writes "cd /foo/bar" or "*cd /foo/bar". This would cover most use cases in Eshell, and it is simpler to type than "cd /.:/foo/bar". In the few cases a user means the local absolute file name "/foo/bar", she still can type "cd /:/foo/bar". Best regards, Michael.