unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Barzilay <eli@barzilay.org>
To: 20202@debbugs.gnu.org
Subject: bug#20202: 24.3; Comint mode sets a bad $EMACS
Date: Wed, 25 Mar 2015 17:44:51 -0400	[thread overview]
Message-ID: <21779.11347.198784.304481@home.barzilay.org> (raw)

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 <cyd@stupidchicken.com>
  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
after:

  commit 4b1aaa8b07cf2797b5a57e2a1fd88f3ec0aa41e2
  Author: Paul Eggert <eggert@twinsun.com>
  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
above.

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!





         reply	other threads:[~2015-03-25 21:44 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87oa9otixb.fsf@russet.org.uk>
     [not found] ` <5703E15B.7080601@cs.ucla.edu>
     [not found]   ` <87k2kcovt8.fsf@russet.org.uk>
     [not found]     ` <5704233B.4020103@cs.ucla.edu>
     [not found]       ` <8737qzso88.fsf@russet.org.uk>
     [not found]         ` <57045765.4000309@cs.ucla.edu>
     [not found]           ` <87r3ei8vz9.fsf@russet.org.uk>
     [not found]             ` <5705B246.10201@cs.ucla.edu>
     [not found]               ` <74bf15b3e1a5afeb41cf6b39d5247e8b.squirrel@cloud103.planethippo.com>
2016-04-07 14:57                 ` bug#20202: Considered Harmful 73d213: 'Comint, term, and compile new set Emacs' Paul Eggert
     [not found]               ` <c32b8d04f5c78203f06c4e48e03b37b0.squirrel@cloud103.planethippo.com>
2016-04-07 15:01                 ` Paul Eggert
2016-04-07 15:18                   ` Phillip Lord
2016-04-07 15:25                     ` Paul Eggert
2016-04-07 16:01                       ` Glenn Morris
2016-04-07 16:07                       ` Phillip Lord
2016-04-07 16:26                         ` bug#20484: " Paul Eggert
2016-04-07 19:55                           ` Phillip Lord
2016-04-07 22:20                             ` bug#20484: " Stefan Monnier
2016-04-08  7:05                               ` Eli Zaretskii
2016-04-08 13:09                               ` Phillip Lord
2016-04-08 20:50                                 ` Paul Eggert
2016-04-08 21:20                                   ` Phillip Lord
2016-04-08  7:03                             ` bug#20484: " Eli Zaretskii
2016-04-08  7:34                             ` Andreas Schwab
2016-04-08 13:12                               ` bug#20484: " Phillip Lord
2016-04-07 21:42                           ` Phillip Lord
2016-04-08  7:01                             ` Eli Zaretskii
2016-04-08 16:49                               ` bug#20202: " Stefan Monnier
2016-04-08 18:12                                 ` Phillip Lord
2016-04-07 16:51                       ` Stefan Monnier
2016-04-07 16:59                         ` bug#20202: " Eli Zaretskii
2016-04-07 18:58                           ` Stefan Monnier
2016-04-07 19:25                             ` Eli Zaretskii
2016-04-07 22:01                               ` Stefan Monnier
2016-04-08  7:00                                 ` bug#20202: " Eli Zaretskii
2016-04-08 15:32                                   ` Glenn Morris
2016-04-08 15:59                                     ` Eli Zaretskii
2015-05-01 23:36                                       ` bug#20484: 25.0.50; Directory tracking in ansi-term broken Jacob Oursland
2015-05-02  2:17                                         ` Glenn Morris
2015-05-02  2:43                                           ` Glenn Morris
2015-05-02 19:33                                             ` Jacob Oursland
2015-05-03  5:45                                               ` Stefan Monnier
2015-05-03  6:15                                                 ` Jacob Oursland
2015-05-03 16:29                                                 ` Richard Stallman
2015-05-03 17:36                                                   ` Jacob Oursland
2015-05-04  2:06                                                   ` Stefan Monnier
2015-05-04 16:15                                                     ` Richard Stallman
2015-05-03 17:57                                                 ` Glenn Morris
2015-05-03 19:09                                                   ` Jacob Oursland
2015-05-04  2:07                                                   ` Stefan Monnier
2016-03-23 22:15                                         ` Paul Eggert
2016-04-08 18:47                                         ` bug#20484: Bash 4.4-rc1 incompatibility with future Emacs $EMACS Paul Eggert
2016-04-09  2:24                                         ` bug#20484: bug#20202: Considered Harmful 73d213: 'Comint, term, and compile new set Emacs' Glenn Morris
2016-04-09  8:43                                           ` Phillip Lord
2016-04-09 13:43                                           ` bug#20202: " Stefan Monnier
2016-04-09 21:56                                             ` Phillip Lord
2016-04-09 23:40                                               ` bug#20202: " Paul Eggert
2016-04-10  0:08                                                 ` Stefan Monnier
2016-04-10  3:30                                                   ` Paul Eggert
2016-04-10 13:57                                                     ` Stefan Monnier
2016-04-11  5:50                                                       ` bug#20202: " Paul Eggert
2016-04-10  8:26                                                   ` bug#20484: " Phillip Lord
2016-04-10 13:59                                                     ` Stefan Monnier
2016-04-11 12:32                                                       ` bug#20484: " Phillip Lord
2016-04-10  8:25                                                 ` Phillip Lord
2015-03-25 21:44                                                   ` Eli Barzilay [this message]
2015-03-26  0:46                                                     ` bug#20202: 24.3; Comint mode sets a bad $EMACS Stefan Monnier
2015-03-28 15:27                                                       ` Eli Barzilay
2015-04-09 15:02                                                         ` Stefan Monnier
2016-04-10 12:18                                                     ` bug#20202: bug#20484: bug#20202: Considered Harmful 73d213: 'Comint, term, and compile new set Emacs' Markus Triska
2016-04-11 12:38                                                       ` Phillip Lord
2018-05-24 20:46                                                     ` bug#20202: EMACS=t Joy and Happiness Phillip Lord
2016-04-10  7:13                                               ` bug#20202: bug#20484: bug#20202: Considered Harmful 73d213: 'Comint, term, and compile new set Emacs' Michael Albinus
2016-04-10  8:51                                                 ` Phillip Lord
2016-04-10  9:31                                                   ` Michael Albinus
2016-04-08 16:46                                   ` Stefan Monnier
2016-04-08 17:12                                     ` Paul Eggert
2016-04-08 18:14                                       ` bug#20202: " Phillip Lord
2016-04-08 17:47                                     ` Phillip Lord
2016-04-08 13:15                               ` Phillip Lord
2016-04-08 13:40                                 ` Eli Zaretskii
2016-04-08 15:45                                   ` bug#20202: " Glenn Morris
2016-04-08 16:01                                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21779.11347.198784.304481@home.barzilay.org \
    --to=eli@barzilay.org \
    --cc=20202@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).