From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Wiesner Newsgroups: gmane.emacs.devel Subject: Re: Compile Mode and "host" Emacs Date: Tue, 29 Oct 2013 13:50:10 +0100 Message-ID: References: <874n80l0b3.fsf@nbtrap.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1383051013 4392 80.91.229.3 (29 Oct 2013 12:50:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Oct 2013 12:50:13 +0000 (UTC) Cc: emacs-devel@gnu.org To: Nathan Trapuzzano Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 29 13:50:16 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vb8kS-0003sj-Hw for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2013 13:50:16 +0100 Original-Received: from localhost ([::1]:46934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vb8kR-000370-R7 for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2013 08:50:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vb8kO-00034e-GX for emacs-devel@gnu.org; Tue, 29 Oct 2013 08:50:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vb8kN-0000oB-9f for emacs-devel@gnu.org; Tue, 29 Oct 2013 08:50:12 -0400 Original-Received: from mail-qa0-x235.google.com ([2607:f8b0:400d:c00::235]:59356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vb8kN-0000ny-67 for emacs-devel@gnu.org; Tue, 29 Oct 2013 08:50:11 -0400 Original-Received: by mail-qa0-f53.google.com with SMTP id k15so2884348qaq.12 for ; Tue, 29 Oct 2013 05:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JfkddfPDd/dXLhrWVIv+Ik4/CuOJEjUxux65u5ukHws=; b=mb6Pt5Ag2Uy0Hz5z1z01rZGdnmP61Be8gbJlEEtdsvLQadvFe6vov0EdNu4H7fbyA6 fnuAAIvru6nnhz1y3TIasqzf0PVDqIKJ6srWRfkl7yw6HEGoDZzJLn/+nqi8IshPmAun PwEo3X3H4P1NjaygcX7gWxwgDUwBvt6fYOTUNJRWASSPYIPEMCB2VNzj0+O9mrUYgy7A P9TBEKqd0W4v/lddFwdSRxT9fOvYRHpqTC+EJzufLcDTS+qCetUyGbbShkc/VFtSABri AEypoXyBN6xlOCWHPHbzjycHi8yisZMX1R3VmzRUbGFpCksU/JYps266bvyUF1N0xfrL gfOA== X-Received: by 10.224.67.66 with SMTP id q2mr335745qai.122.1383051010741; Tue, 29 Oct 2013 05:50:10 -0700 (PDT) Original-Received: by 10.224.78.11 with HTTP; Tue, 29 Oct 2013 05:50:10 -0700 (PDT) In-Reply-To: <874n80l0b3.fsf@nbtrap.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c00::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164619 Archived-At: 2013/10/29 Nathan Trapuzzano : > Your best bet is probably: > > (concat (file-name-as-directory invocation-directory) invocation-name) > > You can wrap that in (file-truename ...) if you want the true name. 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. > > Nathan > > Sebastian Wiesner writes: > >> Hello, >> >> how can a compilation process obtain the path to the Emacs executable >> which started it? >> >> I know that Emacs sets $EMACS and $INSIDE_EMACS in the environment of >> compile processes, but the values of these variables aren't exactly >> helpful and I didn't see any other environment variables in the >> compile code. So apparently environment variables can't help me. >> >> Is there any way to find out the path to the "host" Emacs executable? >> Preferably with not too much trickery? >> >> Sincerely, >> Sebastian Wiesner