all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Sebastian Wiesner <lunaryorn@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Compile Mode and "host" Emacs
Date: Tue, 29 Oct 2013 17:40:04 -0400	[thread overview]
Message-ID: <jwvr4b3hjff.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CALf2awSHCn=nZbnpguHKoic707PYqe-BthewmBMq+JQOi3dwSA@mail.gmail.com>

>> So, yes, you're probably out of luck.  If your script comes with some
>> Elisp package, you could have that package add whatever you need to
>> the environment, but without it, you're screwed.

> I am screwed then.  I presume there is no chance of having a new
> variable introduced for this purpose, or changing the value of the
> existing variables?

> See, even if we leave my use case aside, the values of $EMACS and
> $INSIDE_EMACS are generally not helpful.

$EMACS is useless, indeed: for some reason we used to set it to "t"
a long time ago, and a less-long time ago, someone complained that it
broke Makefile-style use where $EMACS is supposed to hold the command to
run Emacs.  So now, we only add "EMACS=t" if EMACS is not already defined.

From this point of view, it would be "natural" to set $EMACS not to "t"
but to (expand-file-name invocation-name invocation-directory).

But I'm afraid it would still break some of the use cases that are
broken by "t", so we'd still have to do it conditionally (i.e. only when
$EMACS is undefined).  Furthermore, it would also break some people's
.<foo>shrc where the test if $EMACS is "t" to detect if running in
M-x shell (look for «if ("$EMACS" == t) then» in
http://www.opensource.apple.com/source/emacs/emacs-51/emacs/info/efaq-2
for an example).

> Emacs tells subprocesses that they are running within Emacs by the
> mere presence of $INSIDE_EMACS, but it just doesn't tell them, *which*
> Emacs they are running inside.  Even if this information serves no
> useful purpose other than making some scripts more convenient, the
> current value of $INSIDE_EMACS serves even less purpose.  It is simply
> "t", which conveys absolutely no useful information.

I think this is a bug in compile.el: $INSIDE_EMACS should be of the form
"<version>,<context>", as is the case when the process is run by comint,
term, and tramp.  Patch welcome.  So, $INSIDE_EMACS should at least give
you the version number, tho not the actual file name.

> Is any harm done by changing these values to a more useful value?

I think it would break some people's setups, yes.  Maybe changing $EMACS
as suggested above could be considered if we have a good replacement
test for "$EMACS == t" that has the advantage of being more reliable
(e.g. something like "$TERM = emacs").  Still, I'm not sure it's worth
the trouble to break people's .fooshrc.

> My personal motivation for this feature is the Cask [1] project, which
> pretty much covers the 3rd use case "install and update packages from
> command line".  We had a number of reports from OS X people who

Why not make Cask an ELPA package?
[ Even better: a GNU ELP package ;-)  ]

Then you could easily add a CASK_EMACS envvar from the autoloaded code
of the package.  Also, it seems just natural for Cask to itself be an
ELPA package, doesn't it?


        Stefan



  reply	other threads:[~2013-10-29 21:40 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29  9:55 Compile Mode and "host" Emacs Sebastian Wiesner
2013-10-29 12:38 ` Nathan Trapuzzano
2013-10-29 12:50   ` Sebastian Wiesner
2013-10-29 12:54     ` Andreas Schwab
2013-10-29 13:11       ` Sebastian Wiesner
2013-10-29 13:53         ` Andreas Schwab
2013-10-29 14:04           ` Sebastian Wiesner
2013-10-29 15:28             ` Andreas Schwab
2013-10-29 15:52               ` Sebastian Wiesner
2013-10-29 16:02                 ` Michael Albinus
2013-10-29 16:12                 ` Andreas Schwab
2013-10-29 17:07                 ` Eli Zaretskii
2013-10-29 19:09                   ` Sebastian Wiesner
2013-10-29 19:57                     ` Eli Zaretskii
2013-10-29 20:22                       ` Óscar Fuentes
2013-10-29 20:27                         ` Eli Zaretskii
2013-10-29 15:59             ` David Engster
2013-10-29 17:00             ` Eli Zaretskii
2013-10-29 18:42               ` Sebastian Wiesner
2013-10-29 13:10     ` Nathan Trapuzzano
2013-10-29 13:18       ` Sebastian Wiesner
2013-10-29 13:31         ` Nathan Trapuzzano
2013-10-29 13:36           ` Sebastian Wiesner
2013-10-29 13:42             ` Nathan Trapuzzano
2013-10-29 13:55               ` Sebastian Wiesner
2013-10-29 13:58                 ` Nathan Trapuzzano
2013-10-29 14:07                   ` Sebastian Wiesner
2013-10-29 14:16                     ` Nathan Trapuzzano
2013-10-29 14:25                       ` Sebastian Wiesner
2013-10-29 14:27                         ` Nathan Trapuzzano
2013-10-30  4:43                         ` Stephen J. Turnbull
2013-10-30  7:23                           ` Jorgen Schaefer
2013-10-30  8:09                             ` Stephen J. Turnbull
2013-10-29 17:22         ` chad
2013-10-29 16:52 ` Stefan Monnier
2013-10-29 18:42   ` Sebastian Wiesner
2013-10-29 21:40     ` Stefan Monnier [this message]
2013-10-29 22:55       ` Xue Fuqiao

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

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

  git send-email \
    --in-reply-to=jwvr4b3hjff.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=lunaryorn@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.