From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Compile Mode and "host" Emacs Date: Tue, 29 Oct 2013 21:57:09 +0200 Message-ID: <83iowfetpm.fsf@gnu.org> References: <874n80l0b3.fsf@nbtrap.com> <83sivkdn09.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1383076644 9322 80.91.229.3 (29 Oct 2013 19:57:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Oct 2013 19:57:24 +0000 (UTC) Cc: schwab@suse.de, nbtrap@nbtrap.com, emacs-devel@gnu.org To: Sebastian Wiesner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 29 20:57:28 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 1VbFPn-000077-O8 for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2013 20:57:23 +0100 Original-Received: from localhost ([::1]:49147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbFPn-0006IQ-9z for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2013 15:57:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbFPe-0006IF-MV for emacs-devel@gnu.org; Tue, 29 Oct 2013 15:57:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbFPZ-0004j2-NY for emacs-devel@gnu.org; Tue, 29 Oct 2013 15:57:14 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:33021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbFPZ-0004iw-FK for emacs-devel@gnu.org; Tue, 29 Oct 2013 15:57:09 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MVG001004PWAP00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Tue, 29 Oct 2013 21:57:07 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MVG001JW4R69X10@a-mtaout20.012.net.il>; Tue, 29 Oct 2013 21:57:07 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 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:164653 Archived-At: > Date: Tue, 29 Oct 2013 20:09:04 +0100 > From: Sebastian Wiesner > Cc: schwab@suse.de, nbtrap@nbtrap.com, emacs-devel@gnu.org > > 2013/10/29 Eli Zaretskii : > >> Date: Tue, 29 Oct 2013 16:52:42 +0100 > >> From: Sebastian Wiesner > >> Cc: Nathan Trapuzzano , emacs-devel@gnu.org > >> > >> I would have preferred to have my question answered and my problem > >> solved rather than seeing my question arrogantly dismissed as "not > >> useful", and being lectured upon what my problem actually is. > > > > Perhaps if you explained in more details what is your problem, the > > issue would become more clear, and you could get more focused replies. > > As things stand, you only described in very general terms what you > > want to do, and on that level, Andreas is right: the OOB tool to > > communicate with Emacs is emacsclient. Providing more details might > > clarify whether emacsclient fits the bill or not, and why, and if it > > doesn't, what might fit the bill. > > "emacsclient" runs code in a running Emacs. I don't want a use the > running session, but rather a fresh session, but using the same Emacs. Ah, but you could use emacsclient to provide the absolute file name of the running Emacs, like this: emacsclient --eval "(concat invocation-directory invocation-name)" and then use the result to invoke a fresh instance of the same binary. > An Emacs Lisp developer runs her ERT tests in a fresh Emacs session. > She has a Makefile with a "test" target, and a bunch of different > Emacs versions installed (e.g. Emacs 23.4, Emacs 24.2, Emacs 24.3, > three different Emacs trunk builds), to test her package against all > supported Emacs versions. When developing her package, she has > different Emacs versions running in parallel to try how different > Emacs versions behave. She wants "M-x compile RET make test" to use > the Emacs version she is currently in, and she does not want to > remember to explicitly specify the target version in each Emacs > session with "make EMACS=emacs23.4 test". No need to remember, there could be a specialized command to automatically add the EMACS=whatever part. > She also byte-compiles her libraries in a fresh Emacs session to make > sure that they cause no warnings (e.g. assignment to free variables, > unused lexical variables, undefined functions, whatever). For this > purpose, she has a "compile" target in her Makefile, and she also > wants to compile against the very she is currently in. Same-same. > A Emacs Lisp has written a little script to update all her installed > packages from the command line. As she uses a lot of packages and > updates only once in a while, updates take long, and she wants to > continue working meanwhile. Thus, she calls her update script via > "M-x compile", watches the compile buffer for progress, and calls > "package-initialize" once the update is done, to make her Emacs use > the new packages. Obviously, she wants to install packages for the > Emacs she is currently using, and not the one, which is in "$PATH". > She has a few systems, where these are actually different: A Fedora > system at work, where she has no root privileges. She installed Emacs > trunk from source, and added it to the Gnome 3 menu. Also an OS X > system at home, where she installed Emacs 24.3 as App Bundle, by just > dragging it into the "/Applications" folder. In both cases, the > "emacs" in $PATH is different from the Emacs she uses and starts from > the GUI. She does not want this Emacs to be used in her script, > because it would break in both cases, because the system "emacs" is > outdated. > > I hope these use cases make my intend a little more clear. They are all the same use case, and I can see at least 2 solutions, outlined above. One that uses custom commands which wrap "M-x compile", the other that uses emacsclient to glean the file name of the running binary.