From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: Re: Buffer-local process environments Date: Sun, 02 May 2021 08:13:36 +0200 Message-ID: <874kflmzn3.fsf@gmail.com> References: <87eeets6jf.fsf@gmail.com> <8735v99f4i.fsf@gmail.com> <87y2d1xada.fsf@gmx.de> <877dkkcjrj.fsf@gmail.com> <87tunoyzzd.fsf@gmx.de> <87eeerby1n.fsf@gmail.com> <87a6pfepo6.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="31593"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 02 08:15:05 2021 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 1ld5Nh-00088V-HY for ged-emacs-devel@m.gmane-mx.org; Sun, 02 May 2021 08:15:05 +0200 Original-Received: from localhost ([::1]:45272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ld5Ng-0005o0-JQ for ged-emacs-devel@m.gmane-mx.org; Sun, 02 May 2021 02:15:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ld5MN-0005Ji-Ck for emacs-devel@gnu.org; Sun, 02 May 2021 02:13:43 -0400 Original-Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]:35404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ld5MJ-0007OX-Mc for emacs-devel@gnu.org; Sun, 02 May 2021 02:13:43 -0400 Original-Received: by mail-ej1-x631.google.com with SMTP id m12so3185526eja.2 for ; Sat, 01 May 2021 23:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:message-id:user-agent :mime-version; bh=nWvD8umiDh/WO1Fk3I/vXScfTEaEMzOFZPTJpgpHwoE=; b=BpG1b1f+n5BVWEotWpNeW0ZvgkfzYVGYJvoOFwQbbqvAJkZLkY2+pO/rKQCdtJuNm4 Hvs3+GbLu3hYjpznnhO9ja4L6glfEbX3Z6wsVyOD7ROK1fKV/zlDEF0C+8IfwAUSbF+a gCV7CoS1rm219+8Q7MQcC2IaQl/xAh3+NJaYM7+IBuCIqI+6L1mXXBUCHTVruo44kEa5 P03b33FMBF5EJOb0fcO8q5lcorlK0KeP2HedAIiPSmyX1OuHb+IY082Ol9r2zLhSFB2g yr6UhbRiuZ3SH9tF8eXrxw74ESxjt/5CNnbY/u5l3odgT25t4M5zZGf7FxMqit9kw8XB NNpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :user-agent:mime-version; bh=nWvD8umiDh/WO1Fk3I/vXScfTEaEMzOFZPTJpgpHwoE=; b=fSjWhnDRj3mnivvHaINwV+g09ikb6FbfXNUadvTuxzOXbjentmCOUNugy/jZg+f8cW oOO1SVC/fo+c0VeFDHyHfesP9UoEPfu+8SJsXmCP8C9VM3otgqmoUdSf/EK6KMrIQikT nYNCydCIubdhKR4hGD+ZWMca8bfSEK2wARl+4tyjiDMCvSYYTDMNMGH+2uu0SNSMvo7h uF23v0hkO0VFhXIxpjwl5cYnv71uxpdKmdZP84WihpwXIgQlpk8etXl+FoD8Zf6x11qQ CRnIScAbPGOaq3MBbjetK9PsjsmNZl5Y1LiZmsEB/p0JRB0Uk0MTCkH8Ii9KsnGrMg3d o7pg== X-Gm-Message-State: AOAM532yZEDuLann6eO6OWugPleByExjTJUgRfzE0y5u5gby907rd6gc Q6NZyRr/iuaxX7tACysR4b+42jMXA7x2ig== X-Google-Smtp-Source: ABdhPJzkxF4Up9aGiAN4ZvqTfH5Bv3w8S0UkyHFsRKtmHJ3aDc0pYszHBJ0jSp3h88hgSOaTdNivJA== X-Received: by 2002:a17:906:f283:: with SMTP id gu3mr11307250ejb.91.1619936018104; Sat, 01 May 2021 23:13:38 -0700 (PDT) Original-Received: from ars3 ([2a02:908:2211:8540::68a]) by smtp.gmail.com with ESMTPSA id zm17sm1281828ejb.94.2021.05.01.23.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 May 2021 23:13:37 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=arstoffel@gmail.com; helo=mail-ej1-x631.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.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:268745 Archived-At: > Honestly, the hack we have now is already annoying, at least to me. I > would prefer to have something more solid to apply. Hi Michael, I can only think of two alternatives: 1. Introduce a whitelist of variables that can be exported to a remote. Then drop entirely the current hack and just check whether `process-environment' contains any exportable variables. For flexibility, you can allow whitelisting a variable name (any value), or a specific VAR=VALUE pair. The whitelist can be set globally or dynamically. So, for instance, the vc files could just append "BZR_LOG", "HGPLAIN" and whatnot globally to this list and never worry again. Obviously, this will break third-party code, but the fix is quite easy. Nobody could bash you for that. 2. Introduce a blacklist of variables that are never exported to a remote. This can be done by extending `tramp-remote-process-environment' to follow the same convention of `process-environment' that an entry of the form VAR, without the =VALUE, means removing the variable. So, for instance, entries "PATH" and "TERM" should be added to the default value of `tramp-remote-process-environment'. This would solve the unintuitive (if not buggy) behavior I pointed out a few messages back in this thread. As another example, python.el would append "PYTHONPATH" and "PYTHONHOME" globally to `tramp-remote-process-environment', since these variables hold directory names. This option is fully backwards compatible, but keeps the hack you said you don't like anyway. It's also conceivable do to both things, but instead of enforcing 1., just give a warning. Then eventually you could get rid of the hack without breaking other packages.