From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2I0VArkBUGBtaAAA0tVLHw (envelope-from ) for ; Tue, 16 Mar 2021 00:54:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kK9oObgBUGB/EgAAB5/wlQ (envelope-from ) for ; Tue, 16 Mar 2021 00:54:16 +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 872E31016F for ; Tue, 16 Mar 2021 01:54:15 +0100 (CET) Received: from localhost ([::1]:42722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLxyQ-0002UG-Bt for larch@yhetil.org; Mon, 15 Mar 2021 20:54:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLxxz-0002U6-0N for emacs-orgmode@gnu.org; Mon, 15 Mar 2021 20:53:47 -0400 Received: from fossa.birch.relay.mailchannels.net ([23.83.209.62]:50318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLxxw-0006vu-PF for emacs-orgmode@gnu.org; Mon, 15 Mar 2021 20:53:46 -0400 X-Sender-Id: a2hosting|x-authuser|steve@stevenharris.info Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CFCC1342AC0 for ; Tue, 16 Mar 2021 00:53:01 +0000 (UTC) Received: from mi3-ss8.a2hosting.com (100-96-133-30.trex.outbound.svc.cluster.local [100.96.133.30]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 45DC83429CB for ; Tue, 16 Mar 2021 00:53:00 +0000 (UTC) X-Sender-Id: a2hosting|x-authuser|steve@stevenharris.info Received: from mi3-ss8.a2hosting.com (mi3-ss8.a2hosting.com [68.66.200.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.133.30 (trex/6.1.1); Tue, 16 Mar 2021 00:53:01 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|steve@stevenharris.info X-MailChannels-Auth-Id: a2hosting X-Cooing-Invention: 3743fcfc09972b0c_1615855981500_551730334 X-MC-Loop-Signature: 1615855981499:4093242832 X-MC-Ingress-Time: 1615855981499 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stevenharris.info; s=default; h=Content-Type:Cc:To:Subject:Message-ID:Date: From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=f3V/OXZA4ISi/u/UNVozzJ1CaOpzKpRXV417Zm/st0E=; b=J5wiglOi5ayrY458KXPX01tS6 we/9C6ObidR/mRfwIPLB9Fm5LIg+UaOSY9gUZ80UzIja4wPSdCd8be8YdQo3c2dRdh2DRM4gJzp+q s0nRIol21zZp1cZtZZfwYyoibRb4eDT9jBV4y8QqLEa89l3lkuS7T+1pHgPB1KMELokkXL7CLO92Y wyrAHS0NfasiHfF0TQIB8LCc6bRPMD7x6FATxuzHp32vz3UcOd0uOtMa+wEALtmBzZ7bBam+Bi5xq Z/qYps9UdJ8Z3wSz8R08m2Pvc/87BldE/fslegB7Z/Nrbu3YdX6MgQhJiJRlz88UQbNb9QPBoWMFW 9xVepEhsw==; Received: from mail-wr1-f42.google.com ([209.85.221.42]:44948) by mi3-ss8.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lLxxD-0001RT-CA for emacs-orgmode@gnu.org; Mon, 15 Mar 2021 20:52:59 -0400 Received: by mail-wr1-f42.google.com with SMTP id t9so6591634wrn.11 for ; Mon, 15 Mar 2021 17:52:59 -0700 (PDT) X-Gm-Message-State: AOAM532gunVUicXDz2btq/cpzZ0/zhM+s6h6kHOLe5laizGkfiOou4p5 ukHyyU77aMHsv16KbjTukShU0byZzHmtNby4EQ0= X-Google-Smtp-Source: ABdhPJz+c21qTCwQ5m5jK9VELZSi0/JS9jGDGAhhVFqlv9RFoDSfIkkEr3J0iJLukgILhM8urqYoaPyHuyfKNwfK+4A= X-Received: by 2002:a5d:42ca:: with SMTP id t10mr2089369wrr.274.1615855978703; Mon, 15 Mar 2021 17:52:58 -0700 (PDT) MIME-Version: 1.0 References: <87a6r5l5bh.fsf@gmail.com> <87ft0x2hbe.fsf@gmail.com> <87czw02mws.fsf@gmail.com> In-Reply-To: <87czw02mws.fsf@gmail.com> From: Steven Harris Date: Tue, 16 Mar 2021 11:52:47 +1100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: How to get shell source blocks to read my profile? To: Tim Cross Content-Type: multipart/alternative; boundary="0000000000009e6fa605bd9cc94f" X-AuthUser: steve@stevenharris.info Received-SPF: permerror client-ip=23.83.209.62; envelope-from=steve@stevenharris.info; helo=fossa.birch.relay.mailchannels.net 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_FAIL=0.001, SPF_HELO_NONE=0.001 autolearn=no 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: , Cc: emacs-orgmode 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=1615856056; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=f3V/OXZA4ISi/u/UNVozzJ1CaOpzKpRXV417Zm/st0E=; b=u3k0kKiwpFkRAwDEPjTNbU1UK6KnH9G17gmcFF+6f9I1dEn+V8luZZ26nSmheveGN75XiP mNobwHIjlUoyy7sKyBvoxl9icBKAlp/VuIZGCS1FvYiQjxaa774B8mA61YfRplmbR5A90h zEC3fnBfROEhBfXu4cSC+HNh82+adFbtlpbozzvlEhAxHYSYTb0Zipt1OOidJI2xvF7Zw7 fE97POsR8uyLqHcBUw3eDDdp37uQZS6O2S0eoYZ702Qsfj1n/2xt37N0pf5VLYrinGvolm p5mt+Kh8B4+STHg3XBBmzQ3TVDh6FbFQzhhDDvc0NS6fvv3UQrQom3y2gPlAYg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615856056; a=rsa-sha256; cv=none; b=cGYp1w3vUUvW9BNyunPdjpBu1eBZFy0tZcYwD9jy+EfRVVcXWYmp3500s/IEVRParK5q4s MTBGpLHluyG0tyKQUzn4MUSZMf5cVKTTreHzqs3KqZ2gNg3oi8ZaUCWnNsNUyJO6LoTzd1 g1+pFSxC7CyXiZbXdcjwmhJTTokz1QIfy9Dkd5i8qD14ovb5tKE5BkzUP+CYywiWCH5Dqh vKvHDf7PIKCS/3MdRbngy+7G9ycv7Rrrq58/2GSU8AL0CAH/Eu7MXKNlfMqgeI68mhlx8j e2hEOF2FB/0o7Mql2MB1IGLKSsWZoFaz+JKq9CAudyVv1Jvd4Ayv+NWKdKl2xA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=stevenharris.info header.s=default header.b=J5wiglOi; dmarc=none; 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: -0.40 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=stevenharris.info header.s=default header.b=J5wiglOi; dmarc=none; 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: 872E31016F X-Spam-Score: -0.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: aIiYArC0gnT+ --0000000000009e6fa605bd9cc94f Content-Type: text/plain; charset="UTF-8" Well on my mac Emacs is launched by Ruby. I remember having to allow ruby to do that two years ago when I set this up. But thanks for sharing your expertise. I've been a unixy admin for 20 years and didn't know a lot of that. Cheers Steven. On Tue, 16 Mar 2021 at 07:34, Tim Cross wrote: > > 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 > > --0000000000009e6fa605bd9cc94f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Well on my mac Emacs is launched by Ruby.=C2=A0 I rem= ember having to allow ruby to do that two years ago when I set this up.

But thanks for sharing your expertise.=C2=A0 I've= been a unixy admin for 20 years and didn't know a lot of that.

Cheers

Steven.
On Tue, = 16 Mar 2021 at 07:34, Tim Cross <theophilusx@gmail.com> wrote:

George Mauer <gmau= er@gmail.com> writes:

> Thanks a lot! The interactive/non-interactive was indeed the core issu= e. Extra frustrating because it seems like supplying `--rcfile` does nothin= g 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 see= m
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

--0000000000009e6fa605bd9cc94f--