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.devel Subject: Re: Emacs syntax for filenames to mean "absolute location on the current remote host"? Date: Fri, 1 Sep 2023 10:36:56 -0700 Message-ID: <0585b415-4b54-95c3-4454-9317d7a79c61@gmail.com> References: <749b83b2-a8f8-76c5-83e8-2f4044476f74@gmail.com> <877cpeuwyi.fsf@gmx.de> <3ba84988-49d4-1a9f-471b-0436658c6ee2@gmail.com> <87o7injouu.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28430"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 01 19:37:47 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 1qc85a-0007H4-Kd for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Sep 2023 19:37:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc84w-0003Az-K9; Fri, 01 Sep 2023 13:37:06 -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 1qc84u-00034M-DV for emacs-devel@gnu.org; Fri, 01 Sep 2023 13:37:04 -0400 Original-Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qc84o-0005Cv-Sg for emacs-devel@gnu.org; Fri, 01 Sep 2023 13:37:04 -0400 Original-Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-26934bc3059so144691a91.1 for ; Fri, 01 Sep 2023 10:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693589815; x=1694194615; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=7QGhCrkFpnseEOhvfn0Fz9LoFWFkmO0cj4FloxeszSk=; b=FCX1+NFgTpQ2nYDQI3uJdIpDmV0OW7YJPKQp5C57/6cvRBrdFCOt9v07p4zQsMgQ/R xG9rD+QBL2ow8Mh7ZhdCTqFlND6qClLYzcgxL1WCegm3FOg6WhneWBVq9JgJ6c1r4rMu iafpW3i0YWzQ6+vcvqc4vmml5CEAvxU9eQh74m6cE//FE/U8vZVbc6mnWHBwJ24dXX0z Fm72dPSInpnHkU98shCanh+Hh2blBzRYNfL3VLrYDk+Re0DJa8/MRkijBytyWYYySk3J AwjAlP+00ihnoL4cfl+amub/6KVgNPqnnSAstP5ytqaKCNorajoqwFeiLcJ2ZeN4t6CW c0WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693589815; x=1694194615; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7QGhCrkFpnseEOhvfn0Fz9LoFWFkmO0cj4FloxeszSk=; b=AAP29eJanHwZ2SO7yDeQEEnC/wkHAv7kaV8uLoBKis8S32WIl5ifzM2rytP1Fk2dEm M/J4oAlb8kH2vu4xWHm7JwPo9fyzDqL+y+PVpTaxcbZiaOlPdFrd5qr31/01CLAIFVDy gGvCpMQlg5bMVNRkImbb1Ec3ysyM2V5geelf7gLNj4CjAWZYqL0n891UeWZM21DOGQzB czZEgNg+YoS/Kw1pMCL4aMTl4AlmR3Ie4EWNkKDf2u+FswKICHi70flFqTxl47RyuE/J Sttz7mOZaB7EogUeFqmb41VukcAmYTsdUhGR5g5MFGCfWrE5uujNWutX0FMLTUK0Iulz t9lQ== X-Gm-Message-State: AOJu0YzyLmbkHkyLvSxaVvdbxyQ0jY8b/K+mpmXZeO9goUKUovLTbRBX gUAzfQ7od17MNndSz/bGveI= X-Google-Smtp-Source: AGHT+IHAELQ/3bapM6/GQSaRjfWVZj92aPGkB5PAaJJsi3rMZKmQs82AVQCKfgC+sThaAKEq+ZUibg== X-Received: by 2002:a17:90a:8689:b0:26d:23c3:9f30 with SMTP id p9-20020a17090a868900b0026d23c39f30mr4328496pjn.14.1693589815448; Fri, 01 Sep 2023 10:36:55 -0700 (PDT) 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 l194-20020a633ecb000000b0054fe7736ac1sm3066614pga.76.2023.09.01.10.36.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Sep 2023 10:36:55 -0700 (PDT) Content-Language: en-US In-Reply-To: <87o7injouu.fsf@gmx.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=jporterbugs@gmail.com; helo=mail-pj1-x1031.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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:309825 Archived-At: On 8/31/2023 6:58 AM, Michael Albinus wrote: > Jim Porter writes: > >> The one edge case I'm not quite sure what to do about is: how should >> we spell "the user's home directory on localhost"? Using "/:~" *could* >> work (in that Eshell could recognize it and do the right thing), but >> it's also the way that you spell "the file named ~" elsewhere in >> Emacs. (Eshell would spell that \~ or '~'). Maybe that's not such a >> big deal though: we can just document this corner case and hope users >> don't get *too* confused. > > IIUC, "~" in a file name means always the home directory when it is the > first character (of the local part in remote file names), or it comes > after a slash like in "/~". See (info "(elisp) File Name Expansion") The main thing I'm worried about is this: if we say that in Eshell, "/foo/bar" is relative to the current remote host, then the same should be true for "~": it would refer to your remote homedir when applicable. Then we'd want a way to refer to your *local* homedir no matter where you are. If we use "/:/foo/bar" to refer to the always-local "/foo/bar", then we might say "/:~" means your local homedir. But the Emacs manual says: > ‘/:’ can also prevent ‘~’ from being treated as a special character for a user’s home directory. So according to that rule, "/:~" would mean "the file named tilde in the current directory". I *think* what we'd want to do is to say, "Eshell's quoted file names work slightly differently from quoted filenames elsewhere in Emacs. Since Eshell expands tildes in file names on its own, '/:~' always means your local home directory. If you want to refer to a file whose name is tilde, you can use Eshell's escape sequences (etc, etc)." I'll try to put together a patch that does this, and then people can try it out and see if it makes sense.