unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20202: 24.3; Comint mode sets a bad $EMACS
@ 2015-03-25 21:44 Eli Barzilay
  2018-05-24 20:46 ` bug#20202: EMACS=t Joy and Happiness Phillip Lord
  0 siblings, 1 reply; 34+ messages in thread
From: Eli Barzilay @ 2015-03-25 21:44 UTC (permalink / raw)
  To: 20202

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!





^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2018-06-14 20:54 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87tvqw4w8s.fsf@russet.org.uk>
2018-05-24 20:52 ` bug#20202: EMACS=t Joy and Happiness Stefan Monnier
2018-05-24 22:03 ` Paul Eggert
2018-05-24 22:03 ` bug#20484: " Paul Eggert
     [not found] ` <6443412a-5803-d9c0-1ef3-ece7f49c43e1@cs.ucla.edu>
2018-05-25  2:25   ` bug#20202: " Van L
2018-05-25  6:11     ` Ricardo Wurmus
2018-05-25  6:11     ` bug#20484: " Ricardo Wurmus
2018-05-25 17:59     ` bug#20202: " Paul Eggert
2018-05-25 17:59     ` bug#20484: " Paul Eggert
2018-05-25  6:16   ` Eli Zaretskii
2018-05-25  6:16   ` bug#20202: " Eli Zaretskii
     [not found]   ` <83sh6g9s5r.fsf@gnu.org>
2018-05-25  7:28     ` bug#20484: " Van L
2018-05-25  7:28     ` bug#20202: " Van L
     [not found]     ` <ACB7DB0F-7E7E-405C-8F23-1B05F85E2134@scratch.space>
2018-05-25  8:02       ` Eli Zaretskii
2018-05-25  8:02       ` bug#20484: " Eli Zaretskii
2018-05-25 22:34   ` Phillip Lord
2018-05-25 20:36 ` bug#20202: " Paul Eggert
2018-05-25 20:36 ` bug#20484: " Paul Eggert
     [not found] ` <85133880-5ae1-223a-50e6-4646adbf8052@cs.ucla.edu>
2018-05-25 22:49   ` bug#20202: " Phillip Lord
2018-05-26  7:20   ` bug#20484: " Eli Zaretskii
2018-05-26 20:54     ` Paul Eggert
2018-05-26 20:54     ` bug#20202: " Paul Eggert
     [not found]     ` <e81387b2-4135-573c-c839-cf0972bfd56c@cs.ucla.edu>
2018-05-31 21:07       ` Phillip Lord
2018-05-31 23:45         ` Paul Eggert
2018-05-31 23:45         ` bug#20484: " Paul Eggert
     [not found]         ` <4ce6b85e-d600-872d-2a78-d9203d8c8259@cs.ucla.edu>
2018-06-01  1:56           ` Stefan Monnier
2018-06-01  1:56           ` bug#20202: " Stefan Monnier
2018-06-01  7:04           ` Eli Zaretskii
2018-06-01  7:04           ` bug#20484: " Eli Zaretskii
     [not found]           ` <836033gf7d.fsf@gnu.org>
2018-06-01 14:08             ` bug#20202: " Paul Eggert
2018-06-01 14:08             ` bug#20484: " Paul Eggert
     [not found]             ` <9010057b-aa05-9074-49f1-aeab26cfc7cb@cs.ucla.edu>
2018-06-01 14:14               ` Eli Zaretskii
2018-06-14 20:54                 ` Paul Eggert
2018-06-14 20:54                 ` bug#20202: " Paul Eggert
2015-03-25 21:44 bug#20202: 24.3; Comint mode sets a bad $EMACS Eli Barzilay
2018-05-24 20:46 ` bug#20202: EMACS=t Joy and Happiness Phillip Lord

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).