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: [PATCH] Buffer-local process environments Date: Sat, 28 Aug 2021 17:39:07 +0200 Message-ID: <87a6l1zihw.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> <874kflmzn3.fsf@gmail.com> <87wns9glm1.fsf@gmx.de> <87y2co4hto.fsf@gmail.com> <87v97reubc.fsf@gmx.de> <87lf4lkb1w.fsf_-_@gmail.com> <837dg5oidr.fsf@gnu.org> <83zgt1myf5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31699"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , michael.albinus@gmx.de, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 28 17:41:11 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 1mK0SE-00083z-Vm for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Aug 2021 17:41:10 +0200 Original-Received: from localhost ([::1]:42476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mK0SD-0000bZ-Jl for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Aug 2021 11:41:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mK0QK-0007FI-W0 for emacs-devel@gnu.org; Sat, 28 Aug 2021 11:39:13 -0400 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:40867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mK0QJ-0004av-B3; Sat, 28 Aug 2021 11:39:12 -0400 Original-Received: by mail-wr1-x42c.google.com with SMTP id t15so9082840wrg.7; Sat, 28 Aug 2021 08:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MaxrZaljcS0jetmQ4vcQ7boTqz3sZbAdjzzRRHu3UEQ=; b=T8e1/KMi6p+6quktBStf4gdKWbfff8sExu1qXZrTWkpOTBjHFVBqNbd+eEpkWdzYiR +vIuUfbeK28cuyD3MayibjYE/3z/mUcg2et63pDlX+gGM6wQDSP6AT0Q9Br7v4IN/1q4 sFepEbURhzJmyPyWKK6cI6cXgHInW+WTrJdhZEA385rJsF+dKV7LVNdOSq87wSjMm2c/ h+d9oskGADPdIH8wweZTESbxLrnqdyIUjl31pthKSrfYg14kL8z59sk4IGULLZOayCvW aP8Ojef2T9hgH/jx79pv5ZfGpCadZjU6vU4oyo0lTd5Gg8yQwsWzoCzjyZlzhtWsDnej Djww== 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:in-reply-to :message-id:user-agent:mime-version; bh=MaxrZaljcS0jetmQ4vcQ7boTqz3sZbAdjzzRRHu3UEQ=; b=PkpuYnMBpi/uO/FIQn85homSt1WuozKkkP/DuSmcYKuEPGdi37swbYEGz0qw1qpSWQ 6aMKkit64hmq3GvH6tOOal6sMw6+XTaqpe0YaD7G7ks/V6az9EyDiu30IUSi3H1pQa3q rqQpnq0mFuEjZwamffhxcsjLV0b9SNYUAsPqpbpMMa2nIM3cyyPrATAenVNRccWGr7ca p+dO1h/MzKKaBRUoNfAJ5AknDXPVjM1XQikY3cAwa3jQvg1M/vqqjDKRicdOB2avk/Oe 5MwNVKwVOyHruqywGiel9eI31t0z8EoEWQEgMPUuIL52zAJJddGMQoFa5Fb01PPq/grS TYkg== X-Gm-Message-State: AOAM532pV34ylAkLQqrPYZmCaya7fXfcKrgFkD4Lf6e6bdkehpj66G0S TjZlYrvXBykhuQi7uC+LPz0R+1KmCiT8uA== X-Google-Smtp-Source: ABdhPJwiba5p5UwintKoUjFt3wlzkfZzmQuO/5glRz52+dGT+eyPraHedtAcN55qofz+V5Ye20Z+7g== X-Received: by 2002:adf:82a8:: with SMTP id 37mr16907680wrc.123.1630165149033; Sat, 28 Aug 2021 08:39:09 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::ae3f]) by smtp.gmail.com with ESMTPSA id i68sm9922769wri.26.2021.08.28.08.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Aug 2021 08:39:08 -0700 (PDT) In-Reply-To: (Arthur Miller's message of "Sat, 28 Aug 2021 17:27:18 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=arstoffel@gmail.com; helo=mail-wr1-x42c.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:273331 Archived-At: > Now you make me confused again :). I want my process to use different env for > LANG and LC_TIME, but Emacs should continue to work with old values. Concretely > I want english date string, but my Emacs should continue to use swedish for it's > normal use. > > So if I let-bind, it will be reflected only localy in that let scope, and the > subprocess will inherit that local environment too? That is what I want, and why > I went via shell command. Forgive me if I am confused. I hope what you said > above is what I want :-). If it's a one-off thing, you can always do (let ((process-environment (cons "LANG=en" process-environemnt))) (process-launching-stuff)) Now, suppose you want to automate this within a certain project. Then you want to arrange for (setq-local process-environment (cons "LANG=en" process-environemnt)) to be called in every buffer of the project (there are packages out there to help doing this). This mostly works, but some commands get confused when `process-environment' has a buffer-local value. The patch is a fix for `compile'.