From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Barzilay Newsgroups: gmane.emacs.bugs Subject: bug#20202: 24.3; Comint mode sets a bad $EMACS Date: Wed, 25 Mar 2015 17:44:51 -0400 Message-ID: <21779.11347.198784.304481@home.barzilay.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1427319987 11440 80.91.229.3 (25 Mar 2015 21:46:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Mar 2015 21:46:27 +0000 (UTC) To: 20202@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 25 22:46:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Yat7q-0003SQ-Cr for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Mar 2015 22:46:10 +0100 Original-Received: from localhost ([::1]:41481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yat7p-0006iJ-NU for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Mar 2015 17:46:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yat7m-0006hl-MK for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 17:46:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yat7i-0004PW-KZ for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 17:46:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yat7i-0004PP-HH for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 17:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Yat7i-0002KN-BX for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 17:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Barzilay Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Mar 2015 21:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20202 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14273199128866 (code B ref -1); Wed, 25 Mar 2015 21:46:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Mar 2015 21:45:12 +0000 Original-Received: from localhost ([127.0.0.1]:36661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yat6t-0002Iv-Bk for submit@debbugs.gnu.org; Wed, 25 Mar 2015 17:45:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57755) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yat6p-0002IS-Rq for submit@debbugs.gnu.org; Wed, 25 Mar 2015 17:45:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yat6j-0003wv-9C for submit@debbugs.gnu.org; Wed, 25 Mar 2015 17:45:02 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yat6j-0003wr-62 for submit@debbugs.gnu.org; Wed, 25 Mar 2015 17:45:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yat6h-0006Xz-Mx for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 17:45:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yat6c-0003rC-Kd for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 17:44:59 -0400 Original-Received: from mail-qg0-f48.google.com ([209.85.192.48]:34946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yat6c-0003nj-Fb for bug-gnu-emacs@gnu.org; Wed, 25 Mar 2015 17:44:54 -0400 Original-Received: by qgh3 with SMTP id 3so53742838qgh.2 for ; Wed, 25 Mar 2015 14:44:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:subject; bh=WGE//PPic/AhsiyN+ryjz6rwuiQ90Qd+uXXG1wv7LrA=; b=FtVj8tvY63PdOWKkyvkUNJ5VViGLv87ZfzxsXZ1Rh1qP4/C/Q0wdcVVwNPm1zGZpLT pZpL8W8GyxCNKvieNadZ4tS+qDgKp1GDpxW2dX5WxwHs9kacVz3Q9DHhxu1WzY2DMME1 f00/2cFc5QpeG9XfqzGtejSgaHOYe4N/zNkXDxZtWUbPmJL8BXUzC8A/H+p75wg47Qp0 1chlBm9Gxj4BM7f8a3lHxOiCGXmPiSVda2HVY/y9i11tguwnK1npBfo4IpqwaxA75ugw qgs5s6i+kGUP+yVeUS8nUvf12nqIUtmtJxyTCwaJKYmkE6DlUJgawzPRaBaxFDPpheOi cXiw== X-Gm-Message-State: ALoCoQkrA/PG66g7LLagKs/enGKDmO8CUOGiL8tZvwqGsAF/Bb9BmtC8gofmo7UeXkS+gPQPRuFN X-Received: by 10.141.18.146 with SMTP id u140mr14357937qhd.48.1427319893260; Wed, 25 Mar 2015 14:44:53 -0700 (PDT) Original-Received: from home.barzilay.org (c-24-60-254-179.hsd1.ma.comcast.net. [24.60.254.179]) by mx.google.com with ESMTPSA id d49sm1519180qge.19.2015.03.25.14.44.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2015 14:44:52 -0700 (PDT) X-Mailer: VM 8.2.0a under 24.3.1 (x86_64-redhat-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100932 Archived-At: I was surprised to see that compiling some random Emacs code via a Makefile fails when running inside Emacs with an obscure /bin/sh: t: command not found I found this setting in comint.el: (unless (getenv "EMACS") (list "EMACS=t")) And that would obviously break such Makefile uses (and IIUC, $EMACS is a popular choice for specifying which emacs binary to use). It looks like this was done in this commit: commit cfefbbf4404963cdf042fb794e0456503aa8b591 Author: Chong Yidong Date: 2006-11-18 21:01:33 +0000 (comint-exec-1): Set EMACS and INSIDE_EMACS to t. Before this commit, EMACS was set with (concat "EMACS=" invocation-directory invocation-name) which doesn't look like a good idea either (if you happen to use some other Emacs version, you still expect the shell to be a plain shell), but it at least didn't break it. But this change was done shortly after: commit 4b1aaa8b07cf2797b5a57e2a1fd88f3ec0aa41e2 Author: Paul Eggert Date: 2006-09-12 16:43:25 +0000 * etc/NEWS: In terminal-oriented subshells, the EMACS environment variable now defaults to Emacs's absolute file name, instead of to "t". and before that (all the way to the initial comint version in git), it was always "t". It looks like this was intended as a way to tell if you're running inside emacs, which was superseded by $INSIDE_EMACS -- misc.texi says (It also sets the @env{EMACS} environment variable to @code{t}, if that environment variable is not already defined. However, this environment variable is deprecated; programs that use it should switch to using @env{INSIDE_EMACS} instead.) and the changelog dates this to the same date as the first commit above. So, since it has been deprecated for almost 8 years, it looks fine to remove it. If not, then setting it back to the running Emacs would work too, but better to not do such an unexpected change, so something like "EMACS=emacs" is probably going to be unobtrusive. Or if there's some motivation behind intentionally making it some string that is not an executable, then "EMACS=some-descriptive-text" would be better. As a sidenote, misc/efaq.texi uses $EMACS still. (But for tcsh, so not that anyone should care...) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life!