GNU bug report logs - #39596
26.3; Export INSIDE_EMACS with Eshell

Previous Next

Package: emacs;

Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>

Date: Fri, 14 Feb 2020 07:18:02 UTC

Severity: minor

Tags: fixed, patch

Merged with 25496

Found in versions 25.1.91, 26.3

Fixed in version 28.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39596 in the body.
You can then email your comments to 39596 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#39596; Package emacs. (Fri, 14 Feb 2020 07:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Neidhardt <mail <at> ambrevar.xyz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 14 Feb 2020 07:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; Export INSIDE_EMACS with Eshell
Date: Fri, 14 Feb 2020 08:17:11 +0100
[Message part 1 (text/plain, inline)]
Eshell does not have INSIDE_EMACS in its environment (unlike M-x shell)
which I think is a bug as it breaks the behaviour of programs that make
provisions for Emacs being used as a shell.

See
https://lists.gnu.org/archive/html/guix-devel/2020-02/msg00029.html
for a discussion.

Would it be possible to export this variable with Eshell?  Thanks!


[Message part 2 (text/plain, inline)]
-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39596; Package emacs. (Tue, 18 Feb 2020 23:19:01 GMT) Full text and rfc822 format available.

Message #8 received at 39596 <at> debbugs.gnu.org (full text, mbox):

From: Federico Tedin <federicotedin <at> gmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 39596 <at> debbugs.gnu.org
Subject: Re: bug#39596: 26.3; Export INSIDE_EMACS with Eshell
Date: Wed, 19 Feb 2020 00:18:39 +0100
[Message part 1 (text/plain, inline)]
> Eshell does not have INSIDE_EMACS in its environment (unlike M-x shell)
> which I think is a bug as it breaks the behaviour of programs that make
> provisions for Emacs being used as a shell.
>
> See
> https://lists.gnu.org/archive/html/guix-devel/2020-02/msg00029.html
> for a discussion.
>
> Would it be possible to export this variable with Eshell?  Thanks!

I have added this feature to Eshell and created a patch, please check if
this works for you.

Additionally, I noticed that the doc string for
`eshell-variable-aliases-list' mentioned an `eshell-user-aliases-list',
variable but wasn't able to find it anywhere (neither using the Git
log), so I removed the mention.

[0001-Copy-INSIDE_EMACS-env-variable-to-subprocesses-in-Es.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39596; Package emacs. (Wed, 19 Feb 2020 07:41:02 GMT) Full text and rfc822 format available.

Message #11 received at 39596 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Federico Tedin <federicotedin <at> gmail.com>
Cc: 39596 <at> debbugs.gnu.org
Subject: Re: bug#39596: 26.3; Export INSIDE_EMACS with Eshell
Date: Wed, 19 Feb 2020 08:40:19 +0100
[Message part 1 (text/plain, inline)]
Thanks for looking at this, Federico!

Your patch looks good to me, just one comment below:

> --- a/lisp/eshell/em-dirs.el
> +++ b/lisp/eshell/em-dirs.el
> @@ -191,6 +191,9 @@ eshell-dirs-initialize
>  		        (unless (ring-empty-p eshell-last-dir-ring)
>  			  (expand-file-name
>  			   (ring-ref eshell-last-dir-ring 0))))
> +            t)
> +           ("INSIDE_EMACS" ,(lambda (_indices)
> +                              (format "%s,eshell" emacs-version))
>              t))))

Why did you unquote the lambda here?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39596; Package emacs. (Wed, 19 Feb 2020 16:23:01 GMT) Full text and rfc822 format available.

Message #14 received at 39596 <at> debbugs.gnu.org (full text, mbox):

From: Federico Tedin <federicotedin <at> gmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 39596 <at> debbugs.gnu.org
Subject: Re: bug#39596: 26.3; Export INSIDE_EMACS with Eshell
Date: Wed, 19 Feb 2020 17:22:18 +0100
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> Thanks for looking at this, Federico!
>
> Your patch looks good to me, just one comment below:
>
>> --- a/lisp/eshell/em-dirs.el
>> +++ b/lisp/eshell/em-dirs.el
>> @@ -191,6 +191,9 @@ eshell-dirs-initialize
>>  		        (unless (ring-empty-p eshell-last-dir-ring)
>>  			  (expand-file-name
>>  			   (ring-ref eshell-last-dir-ring 0))))
>> +            t)
>> +           ("INSIDE_EMACS" ,(lambda (_indices)
>> +                              (format "%s,eshell" emacs-version))
>>              t))))
>
> Why did you unquote the lambda here?

I need to unquote the lambda to get its value, right? Or maybe not, and
I'm misunderstanding how lambdas work. I did notice though that the
other lambdas in the list are unquoted.

- Fede




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39596; Package emacs. (Wed, 19 Feb 2020 16:31:01 GMT) Full text and rfc822 format available.

Message #17 received at 39596 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Federico Tedin <federicotedin <at> gmail.com>
Cc: 39596 <at> debbugs.gnu.org
Subject: Re: bug#39596: 26.3; Export INSIDE_EMACS with Eshell
Date: Wed, 19 Feb 2020 17:30:12 +0100
[Message part 1 (text/plain, inline)]
Federico Tedin <federicotedin <at> gmail.com> writes:

> I need to unquote the lambda to get its value, right? Or maybe not, and
> I'm misunderstanding how lambdas work. I did notice though that the
> other lambdas in the list are unquoted.

I asked because the other lambdas are not unquoted on Emacs 26.3.
If it changed upstream, no problem then! :)

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39596; Package emacs. (Wed, 19 Feb 2020 17:11:02 GMT) Full text and rfc822 format available.

Message #20 received at 39596 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Federico Tedin <federicotedin <at> gmail.com>
Cc: Pierre Neidhardt <mail <at> ambrevar.xyz>, 39596 <at> debbugs.gnu.org
Subject: Re: bug#39596: 26.3; Export INSIDE_EMACS with Eshell
Date: Wed, 19 Feb 2020 18:10:06 +0100
On Feb 19 2020, Federico Tedin wrote:

> Pierre Neidhardt <mail <at> ambrevar.xyz> writes:
>
>> Thanks for looking at this, Federico!
>>
>> Your patch looks good to me, just one comment below:
>>
>>> --- a/lisp/eshell/em-dirs.el
>>> +++ b/lisp/eshell/em-dirs.el
>>> @@ -191,6 +191,9 @@ eshell-dirs-initialize
>>>  		        (unless (ring-empty-p eshell-last-dir-ring)
>>>  			  (expand-file-name
>>>  			   (ring-ref eshell-last-dir-ring 0))))
>>> +            t)
>>> +           ("INSIDE_EMACS" ,(lambda (_indices)
>>> +                              (format "%s,eshell" emacs-version))
>>>              t))))
>>
>> Why did you unquote the lambda here?
>
> I need to unquote the lambda to get its value, right?

Unquoting allows it to be byte-compiled.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39596; Package emacs. (Wed, 19 Feb 2020 21:17:01 GMT) Full text and rfc822 format available.

Message #23 received at 39596 <at> debbugs.gnu.org (full text, mbox):

From: Federico Tedin <federicotedin <at> gmail.com>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Pierre Neidhardt <mail <at> ambrevar.xyz>, 39596 <at> debbugs.gnu.org
Subject: Re: bug#39596: 26.3; Export INSIDE_EMACS with Eshell
Date: Wed, 19 Feb 2020 22:16:05 +0100
Andreas Schwab <schwab <at> suse.de> writes:

> On Feb 19 2020, Federico Tedin wrote:
>
>> Pierre Neidhardt <mail <at> ambrevar.xyz> writes:
>>
>>> Thanks for looking at this, Federico!
>>>
>>> Your patch looks good to me, just one comment below:
>>>
>>>> --- a/lisp/eshell/em-dirs.el
>>>> +++ b/lisp/eshell/em-dirs.el
>>>> @@ -191,6 +191,9 @@ eshell-dirs-initialize
>>>>  		        (unless (ring-empty-p eshell-last-dir-ring)
>>>>  			  (expand-file-name
>>>>  			   (ring-ref eshell-last-dir-ring 0))))
>>>> +            t)
>>>> +           ("INSIDE_EMACS" ,(lambda (_indices)
>>>> +                              (format "%s,eshell" emacs-version))
>>>>              t))))
>>>
>>> Why did you unquote the lambda here?
>>
>> I need to unquote the lambda to get its value, right?
>
> Unquoting allows it to be byte-compiled.
>
> Andreas.

Wasn't aware of that, thanks.




Added tag(s) patch. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 24 Feb 2020 18:22:01 GMT) Full text and rfc822 format available.

Forcibly Merged 25496 39596. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 24 Feb 2020 18:22:01 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 02 Apr 2020 23:07:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 25496 <at> debbugs.gnu.org and Alex Hutcheson <alexhutcheson <at> google.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 02 Apr 2020 23:07:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 09 May 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.