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 14:11:13 +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 1383052278 20044 80.91.229.3 (29 Oct 2013 13:11:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Oct 2013 13:11:18 +0000 (UTC) Cc: Nathan Trapuzzano , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 29 14:11:23 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 1Vb94t-0003Ck-M7 for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2013 14:11:23 +0100 Original-Received: from localhost ([::1]:47078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vb94r-0001TU-Hl for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2013 09:11:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vb94l-0001Oa-LV for emacs-devel@gnu.org; Tue, 29 Oct 2013 09:11:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vb94k-0007cM-EO for emacs-devel@gnu.org; Tue, 29 Oct 2013 09:11:15 -0400 Original-Received: from mail-qe0-x22d.google.com ([2607:f8b0:400d:c02::22d]:49756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vb94k-0007c7-6J for emacs-devel@gnu.org; Tue, 29 Oct 2013 09:11:14 -0400 Original-Received: by mail-qe0-f45.google.com with SMTP id 8so4917297qea.32 for ; Tue, 29 Oct 2013 06:11:13 -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=c7//C4YfrI7vhp7leeY1FyAKAywRYTQk9nBsdIqrD64=; b=lcj0xlfMAvg1nf8wco7nntjLnhhxjQ3l/eNsHVg4ZMrCDnJZZHvEO3hAPea60DiBg6 hHStlOliaIoQBDl593GDKsuOuzaeR6fEBPBDS1svbeP2V2btweppnHtrEeddeMAvIbr5 wgMckM36usiPJrirUcyDqCBr1aKDy/ypfxg/xDT+4uT+/gB409GtvZCTR8Eqsf3MrJNz jfk3AbZjaboZfFBinXeDlc1FTDvV4CYwLTF0l3lE+4Zk8O4MHCRnjq8K0xY9vRiJYmJ4 3mrBGh9Ea7btgciqxpchri9cddc+pKB3ygmSoysPdJb2xOs74PLm88YiOHlukPN28zs2 Y23Q== X-Received: by 10.49.50.7 with SMTP id y7mr35803976qen.45.1383052273890; Tue, 29 Oct 2013 06:11:13 -0700 (PDT) Original-Received: by 10.224.78.11 with HTTP; Tue, 29 Oct 2013 06:11:13 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c02::22d 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:164621 Archived-At: 2013/10/29 Andreas Schwab : > Sebastian Wiesner writes: > >> 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**. > > Why do you need that? What is the difference to running it outside > Emacs? Oh, come on, can we please just assume that I *have* a valid use case? Is it so hard not to challenge a question, and just *answer* it? But since you will insist: I want to interact with the running Emacs, obviously. More precisely, in my "build" script I want to evaluate some expressions, and probably a complete Emacs Lisp script. Now, it's not quite uncommon to have multiple Emacs versions installed. To give the user the freedom of choice in this case, I provide an option to select the target Emacs. Currently I just use the default `emacs` executable, if the user didn't select a different version. When running outside Emacs, I have no other choice, but when running from inside Emacs, I could really use a more clever default, namely the Emacs, that was used to start the script. It's not quite an essential feature, but really convenient, if you use a "non-default" Emacs, that is, an Emacs, which is not available as "emacs" in "$PATH". Which is, by the way, a common case on OS X, if Emacs is installed from a pre-build App bundle. In such cases, "emacs" still points to the OS X system Emacs (a horribly dated version 22), but the user actually uses a more recent version from an App bundle, started from the graphical user interface of OS X. > > Andreas. > > -- > Andreas Schwab, SUSE Labs, schwab@suse.de > GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 > "And now for something completely different."