From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ONmhONfCT2CrXgAA0tVLHw (envelope-from ) for ; Mon, 15 Mar 2021 20:25:59 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cFJKNNfCT2BvTwAAbx9fmQ (envelope-from ) for ; Mon, 15 Mar 2021 20:25:59 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 572941C5BA for ; Mon, 15 Mar 2021 21:25:59 +0100 (CET) Received: from localhost ([::1]:41792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLtmn-0005zY-J0 for larch@yhetil.org; Mon, 15 Mar 2021 16:25:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLtdO-0004cq-Js for emacs-orgmode@gnu.org; Mon, 15 Mar 2021 16:16:14 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:33366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLtdL-0007vi-A4 for emacs-orgmode@gnu.org; Mon, 15 Mar 2021 16:16:14 -0400 Received: by mail-pj1-x1035.google.com with SMTP id lr1-20020a17090b4b81b02900ea0a3f38c1so2479717pjb.0 for ; Mon, 15 Mar 2021 13:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=y4+f3Q79UnSQ+8GU1529yMsj9JgoNFYNrUIhCFijE/k=; b=eekT/tHo8YsEIgTH/t11mY6X4kQXoWMEOg/fyUzZUKMD6nW6xyCvDpRpk5Z2c23m6B OzRkoyB7m43wc1YmbAc2rGlX3VxZQf22pZ/Y+Qv2KGSfMRp8pAw+XDCGu8HpebPeXjRr 5nO8pM7IdWeg7skDaheTCpE/ITyUq2UUfj5yBJUK87U9mufWd+y/W0Q5C0ziEE8U3XNi ozY0H3yVa+nVg8aQCM+Fa5jvriQ6sOZb+k4y9fmUBTOOESihCU+ShFbMwbnEhngN5ek8 bfz+49Ocd20uqS4+Of7dOPVC4Kr4nsOOXIkmK+/Qbpx65ZMhrT1R21kMd8zevaq6m9sm 5Djg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=y4+f3Q79UnSQ+8GU1529yMsj9JgoNFYNrUIhCFijE/k=; b=P7Raq8A82D/1Tlzqoz4pfoMq5Vs3ToXAY1yyZ7Bc2VxKZ9+cQrgfda+osr7uo/iGUF rYAwgHiq+Kq/AkMwB2TmbIp+HY0np6bwbBozkccVAmMLIAXMtsowW2lBepoPt6N0La20 NUSQ64tedmcWaV7N8mMOPabOSuGhwMcZQ/f1H1HLOjBBbbzl3XSfT5+js4LX7faI/V7s jdJuv5h3c2DkGC0V1M15af8iTSpeL+D0axGVjY+ols0SqiKdUJ4sQ9aXlCA2WyiiSrmB Dvo0c6Ust0p4TW0OrwS0yj+Fb2JZMwV0hkRejEivwI3N5gLqhgRESwLFpEs6MR8Kv7Dj GNWQ== X-Gm-Message-State: AOAM533jwaPPZd4Pt0W0G8Hx7bOoCzuTk8cVuEojJa5ZGNgqIkktpB2a tQX5qx7frcG41nXBpXDEmOe11PuUnuw= X-Google-Smtp-Source: ABdhPJyJSPN7swgojudtsCVGBKteohc6QLfvtOFXkKBNUkF+KJzEZ8X0vBwN5jn9QwvPfVQKyDMkxQ== X-Received: by 2002:a17:902:e986:b029:e6:bffd:f465 with SMTP id f6-20020a170902e986b02900e6bffdf465mr145389plb.35.1615839368059; Mon, 15 Mar 2021 13:16:08 -0700 (PDT) Received: from tim-desktop (220-235-13-251.dyn.iinet.net.au. [220.235.13.251]) by smtp.gmail.com with ESMTPSA id u12sm14142355pfn.123.2021.03.15.13.16.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 13:16:07 -0700 (PDT) References: <87a6r5l5bh.fsf@gmail.com> <87ft0x2hbe.fsf@gmail.com> User-agent: mu4e 1.5.10; emacs 27.1.91 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: How to get shell source blocks to read my profile? Date: Tue, 16 Mar 2021 06:53:11 +1100 In-reply-to: Message-ID: <87czw02mws.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x1035.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-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615839959; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=y4+f3Q79UnSQ+8GU1529yMsj9JgoNFYNrUIhCFijE/k=; b=uOdZEGpW/WOu/LpJ3trowY9gz2kxJ0MjiLuI5z1h1DTOD+kUjPQEOkViTKCcJjnnohSNh+ wNzjFjudsEb9LlMMQPGCINrqTyJGOyUx8UtSa+pyaliIxa+2jv90N0lMUu01C6DFCsDKfa pb+Ks58v5jIfQkyAtCOJV4Re8tPa22+LFfhrAyjiLkwncj3wrxoJk6MsnN7Rn/SPpTzxck kw9dBNm1xsN4c4X57zJ4T4QVTS119GSpwjbRnwIdXfoT9leUltlGdFgOakLoGC4mKs0fv7 6Q30iMYhhrwIBykN/LunOWsIAA1VGId9HgtZ0vSMsKSztWwcIcYE/Z9KBsDn3w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615839959; a=rsa-sha256; cv=none; b=FOIz+cVes/1xKaQswViEcsvV6JlY1pXDYZm9DbdftKvFfRHzBSRvgdhPGayPvSOhG1zkJ4 LPtUH3A6KqacqA1HDv1HHBC/VLxixXysf6iW4GX1BLN8vagtZty+tVlv/2Gf/olBFu/5XY 0L822RdrWhI7IPt//xt5xklMMzxEVLgtyT+gA5a67UGHbGWkVduLv4eOm8aeB/qNtuLKCq /qbKSEYi5zuxlYAbHJTi4Sa1upXGqZfnxOTWq7JYGW+GviZ29A2rtQIzNYHmsS7q3Cc0Tm /N62lDS/B+cfGoK1xBzLyhWeiprUyMdaRC8T/OiqqBEM5LEO2uTmFH6tirFE/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="eekT/tHo"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.10 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b="eekT/tHo"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 572941C5BA X-Spam-Score: -2.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: SbTHf9Cohh6w George Mauer writes: > Thanks a lot! The interactive/non-interactive was indeed the core issue. Extra frustrating because it seems like supplying `--rcfile` does nothing if you > *do* use `-c` but *don't* use `-i`...ah ad-hoc cli design. > It certainly can seem rather ad hoc. However, it actually makes sense on some levels. If you use -c your telling the shell to execute a command and then exit. By definition, this is non-interactive. This is covered in the manual. Where it becomes confusing is when your mixing in different options as some override others. So, provided you include -i with -c, it will be forced into interactive i.e. -i overrides the non-interactive status added with -c. If you add -s, telling the shell to read input from stdin, you also override non-interactive status. The other possible solution to your situation is to ensure Emacs runs inside an environment which has all your exported variables i.e. inside your login shell environment. There are a few ways to do this, but probably the easiest is to create a script which opens a login shell, then calls Emacs (may need to use open - not sure) and Emacs will inherit your environment. Advantage is that processes you then spawn from within Emacs will also inherit that environment. You then add this script as the executable in the dock rather than calling Emacs directly. One thing to watch out for is that if your also using oh-my-zsh, it setups up some aliases with the name emacs which actually call emacsclient. This can be confusing as it means running just 'emacs' in the shell will run the alias and not actually run Emacs directly. Things can be even more confusing as there are also multiple ways to install Emacs on the mac and they are all slightly different with respect to how they setup things. What I find hardest with writing shell stuff is that I simply don't seem to do it much anymore. My brain cache is just too small and when I find it necessary to write a shell script again, all that knowledge has been flushed! Once upon a time, many moons ago, I could write shell scripts that used sed, awk, cut, uniq etc without even needing to look at the man pages. These days, I have to check the bash man page just to remember what the expr operators are! -- Tim Cross