From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: INSIDE_EMACS and Tramp Date: Mon, 13 Apr 2020 11:07:43 +0200 Message-ID: <87lfmzg3ds.fsf@gmx.de> References: <20200402230535.10490.95720@vcs0.savannah.gnu.org> <20200402230536.E0A3F20CDD@vcs0.savannah.gnu.org> <87lfndarwh.fsf_-_@gmx.de> <87blo78exg.fsf@gmx.de> <871rp357s1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="76643"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Federico Tedin Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 13 11:12:47 2020 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 1jNv95-000JrZ-1M for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Apr 2020 11:12:47 +0200 Original-Received: from localhost ([::1]:41938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNv93-0004kn-Py for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Apr 2020 05:12:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45496) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNv4G-0002kB-7F for emacs-devel@gnu.org; Mon, 13 Apr 2020 05:07:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNv4F-0008SR-4N for emacs-devel@gnu.org; Mon, 13 Apr 2020 05:07:48 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:54029) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNv4E-0008Rv-Nj for emacs-devel@gnu.org; Mon, 13 Apr 2020 05:07:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1586768864; bh=enmMygkq/Fej9JBC+6PcZiT9Nm35BziRrDFix/XY0Ws=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=jjGgPTH/sjYNeaTJyy5ykqihersXTdGsJgr7vyG7nx7k5e9RiCcxNgx/uxIfx0OY7 FmFKrPvKy6eInTWDD/ZPZVKItSZvmWn1AWj7vSSEnAPtcIcCBE3+8dRcjjpWR3XkqO eDbBwLpNPz5IOoGnpiv7SEdIdCDuU0X1iHRiDnjY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([79.140.119.11]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MdebB-1ip8HR2Zrl-00ZdfU; Mon, 13 Apr 2020 11:07:44 +0200 In-Reply-To: <871rp357s1.fsf@gmail.com> (Federico Tedin's message of "Sat, 04 Apr 2020 22:13:18 +0200") X-Provags-ID: V03:K1:M/YJwvWoJQHAwNg9n/nzUrDi71ZIRm8+C1jesD3TqfHc6cjptgS i6IQvFITvAPI+RD0mjclCp5KqrXawq4Fc292bRiNUKAgDt4mcf5WV/h9qEGnhkAbmq+yKF1 6Kpwh1xutBSJy5gD22U1L4/H4bQGIT1drZ/aKEV+zJ6uRCkAJ+3RuB00uSvUbY+h+cEK+LA Ez5Beky4VE6v8yQwAygWg== X-UI-Out-Filterresults: notjunk:1;V03:K0:wUA38qAPCfY=:EuzTw29XHy53CCl7ZIjCYW ljhvdIjtuhm9vMRBKkilXp+9N8sDpptWONzYFAnSOoJXdxc0g0qR9e6B45vATTVwURwqsWgL5 DSqv0YA46yBR6+xJ6Kz/dCfNXKbKRtI1gXEt0ysbbtkfsprMam6BJPCAduKXbiYpTRLF5LGqj TrzvYoQ6QhVsUeYdX69QA6chVmQjH5vgIOkNlkPiNzsfdm4IcjWmlXxXpoHg3oYC/iGn9OYnm RBJRrLhCNqOQodOwi8VnJqRaJN4kLu56KPq6KM535wdHbgl3qhPwv8iOrBVGvj1IhA/gI2wLP Z4oY7IJpPbFI8x2uJTDZuXponP+X6ZtwXxF4fdGFM3ATo4GLvLaiMxLNMx+gTlXbwEnYLq09e 1WdDeNF1HQubBf96SvyuCq9uHf/K5MJ46qCqw4xN2DFnGwsNwpHZQHWMuwRWJ/5sGDryNMUBQ OjYdlu8Nw7cE4UJToBQiijwIPc0ajSPEeoOTRcOObsvU+pvkDA3f4u4cOxqv0kdmb6I3s/UNi sHDeahX/77ovEWBzL/l93vf1e24fww2AgJ/stbxSFf0tJTsoThdtsS7nBlgBE/vGDB2ukPuGk s7frbwmz3bOPufNdw07ePRahnt3rFYMuZ6RCj9wy9ArU7hPWLhJjeCSES1gKQJc8IrJmm3dZC u7s+Ac6+1IKCm11THxY3NLSEsxgal9i9DPvWyAe29Ozc12C+TitJElqwZXUdgFFwuPHo/t/PB 4RFOqWz4aLyTqlT6Rg2/5/UhxehNj4SE31ib+DgwNDccfVIIOo3eFk/ununz7PygqqNVGPFl X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:246903 Archived-At: Federico Tedin writes: Hi Federico, > Aah OK, so then this mechanism for generating the value for INSIDE_EMACS > needs to be more general. How about something like: > > (defvar inside-emacs-extras nil) > > (defun inside-emacs (&optional context) > (mapconcat #'identity `(,emacs-version > ,@(when context (list context)) > ,@inside-emacs-extras) > ",")) > > So in Eshell we would call (inside-emacs "eshell"), and Tramp could > optionally add "tramp:2.5.0-pre" to inside-emacs-extras sometime before > the function is called. Other parts of Emacs could add extras as well > (and at some point remove them, I suppose). Do you think something like > this would make sense given how Tramp works internally? I don't believe a global variable would fly. In Eshell, for example, this variable must be changed whenever the default-directory is changed (being a local or a remote file name). Tramp is not involved, when you change the default-directory. Instead, there might be a hook which is called whenever your inside-emacs function is applied. Something like this: =2D-8<---------------cut here---------------start------------->8--- (defvar inside-emacs-hook nil) (defun inside-emacs (&optional context) (mapconcat #'identity (delq nil `(,emacs-version ,@(when (stringp context) (list context)) ,(run-hook 'inside-emacs-hook))) ",")) (add-hook 'inside-emacs-hook (lambda () (when (file-remote-p default-directory) '("tramp:2.5.0-pre")))) =2D-8<---------------cut here---------------end--------------->8--- The add-hook call would be implemented in Tramp itself. Best regards, Michael.