[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#20202: closed (24.3; Comint mode sets a bad $EMACS

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#20202: closed (24.3; Comint mode sets a bad $EMACS)
Date: Sat, 26 May 2018 20:55:02 +0000

Your message dated Sat, 26 May 2018 13:54:46 -0700
with message-id <address@hidden>
and subject line Re: EMACS=t Joy and Happiness
has caused the debbugs.gnu.org bug report #20202,
regarding 24.3; Comint mode sets a bad $EMACS
to be marked as done.

(If you believe you have received this mail in error, please contact

20202: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20202
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3; Comint mode sets a bad $EMACS Date: Wed, 25 Mar 2015 17:44:51 -0400
I was surprised to see that compiling some random Emacs code via a
Makefile fails when running inside Emacs with an obscure

  /bin/sh: t: command not found

I found this setting in comint.el:

          (unless (getenv "EMACS")
            (list "EMACS=t"))

And that would obviously break such Makefile uses (and IIUC, $EMACS is
a popular choice for specifying which emacs binary to use).

It looks like this was done in this commit:

  commit cfefbbf4404963cdf042fb794e0456503aa8b591
  Author: Chong Yidong <address@hidden>
  Date:   2006-11-18 21:01:33 +0000

    (comint-exec-1): Set EMACS and INSIDE_EMACS to t.

Before this commit, EMACS was set with

    (concat "EMACS=" invocation-directory invocation-name)

which doesn't look like a good idea either (if you happen to use some
other Emacs version, you still expect the shell to be a plain shell),
but it at least didn't break it.  But this change was done shortly

  commit 4b1aaa8b07cf2797b5a57e2a1fd88f3ec0aa41e2
  Author: Paul Eggert <address@hidden>
  Date:   2006-09-12 16:43:25 +0000

    * etc/NEWS: In terminal-oriented subshells, the EMACS environment
    variable now defaults to Emacs's absolute file name, instead of
    to "t".

and before that (all the way to the initial comint version in git), it
was always "t".  It looks like this was intended as a way to tell if
you're running inside emacs, which was superseded by $INSIDE_EMACS --
misc.texi says

  (It also sets the @env{EMACS} environment variable to @code{t}, if
  that environment variable is not already defined.  However, this
  environment variable is deprecated; programs that use it should
  switch to using @env{INSIDE_EMACS} instead.)

and the changelog dates this to the same date as the first commit

So, since it has been deprecated for almost 8 years, it looks fine to
remove it.  If not, then setting it back to the running Emacs would
work too, but better to not do such an unexpected change, so something
like "EMACS=emacs" is probably going to be unobtrusive.

Or if there's some motivation behind intentionally making it some
string that is not an executable, then "EMACS=some-descriptive-text"
would be better.

As a sidenote, misc/efaq.texi uses $EMACS still.  (But for tcsh, so
not that anyone should care...)

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

--- End Message ---
--- Begin Message --- Subject: Re: EMACS=t Joy and Happiness Date: Sat, 26 May 2018 13:54:46 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
Eli Zaretskii wrote:

I like it because it is future proof, and makes our burden of
remembering this issue easier.


You're welcome. Stefan privately emailed me some helpful comments that improved the patch (thanks!), and I installed the attached into master. In the hope that this has laid Bug#20202 to rest (at least on modern GNU systems running Bash 4.4 or later), I'm boldly closing the bug report.

Attachment: 0001-Don-t-set-EMACS-t-if-Bash-is-4.4-or-newer.txt
Description: Text document

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]