From: Sebastian Wiesner <lunaryorn@gmail.com>
To: Nathan Trapuzzano <nbtrap@nbtrap.com>
Cc: emacs-devel@gnu.org
Subject: Re: Compile Mode and "host" Emacs
Date: Tue, 29 Oct 2013 14:18:28 +0100 [thread overview]
Message-ID: <CALf2awQZFWGY=0ZbV_mb3c1uuEBf_o1uTJ_71CLqFeObR8gKew@mail.gmail.com> (raw)
In-Reply-To: <874n80w7cl.fsf@nbtrap.com>
2013/10/29 Nathan Trapuzzano <nbtrap@nbtrap.com>:
> Sebastian Wiesner <lunaryorn@gmail.com> writes:
>
>> Uhm, you misunderstood me. I didn't ask how to get the path to the
>> Emacs executable within the running Emacs instance itself.
>>
>> Rather, I wanted to know how to get the path to the Emacs executable
>> **from within a running subprocess**, started by `M-x compile`.
>>
>> For instance, assume that I do "M-x compile RET foo.sh", then how can
>> I get the path to the Emacs executable **within foo.sh**.
>>
>> I have "$EMACS" and "$INSIDE_EMACS", but the values of these variables
>> are pretty much useless.
>
> I don't think there's any portable way.
That's unfortunate.
I cannot but wonder what (stupid?) rationale let to the design of
"$EMACS" and "$INSIDE_EMACS", if I have no chance to find out *what*
Emacs I am actually inside of…
> If you're running on Linux
I am not, nor could I guarantee that my users do.
> you know the process's direct parent is emacs
I can guarantee that neither.
> A better way would probably be to set some environment variable to the
> full path in your init file, and then using that from the compile
> process:
>
> ;;;; .emacs
>
> (setenv "EMACS_EXE_PATH"
> (file-truename (concat (file-name-as-directory
> invocation-directory)
> invocation-name)))
I am not in control of my users' configurations, nor can I reasonably
demand them to change their "init.el" just to support a single script.
Besides, if I tell them to change their "init.el", I might just as
well tell them to select the target Emacs via the corresponding option
of my script right away.
>
> Nathan
next prev parent reply other threads:[~2013-10-29 13:18 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 [this message]
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
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='CALf2awQZFWGY=0ZbV_mb3c1uuEBf_o1uTJ_71CLqFeObR8gKew@mail.gmail.com' \
--to=lunaryorn@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=nbtrap@nbtrap.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.