From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: amd@gnu.org: eshell and external commands Date: Wed, 08 Aug 2007 18:55:08 -0400 Message-ID: <87zm11iqlv.fsf@stupidchicken.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1186613890 17170 80.91.229.12 (8 Aug 2007 22:58:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Aug 2007 22:58:10 +0000 (UTC) Cc: "Alfred M. Szmidt" , rms@gnu.org, emacs-devel@gnu.org To: John Wiegley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 09 00:58:07 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IIuTe-0003DM-Mf for ged-emacs-devel@m.gmane.org; Thu, 09 Aug 2007 00:58:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIuTe-0002pQ-9D for ged-emacs-devel@m.gmane.org; Wed, 08 Aug 2007 18:58:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IIuTa-0002pA-Oh for emacs-devel@gnu.org; Wed, 08 Aug 2007 18:58:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IIuTZ-0002ov-3c for emacs-devel@gnu.org; Wed, 08 Aug 2007 18:58:01 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IIuTZ-0002op-0r for emacs-devel@gnu.org; Wed, 08 Aug 2007 18:58:01 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IIuTT-0008Et-Ey; Wed, 08 Aug 2007 18:57:55 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 72FA34E376; Wed, 8 Aug 2007 18:55:08 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Sat\, 04 Aug 2007 23\:05\:56 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Detected-Kernel: Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:76210 Archived-At: > Often when executing a external command, eshell gets a bit confused. > For example, when doing `ls -B' (-B will cause eshell to call the > external ls) > > But, when inovoking the external command directly, /bin/ls -B, it > works as it should The bug arises in the part of eshell-send-input that chooses whether to use eshell-eval-command or eval to evaluate the command code. Normally, it uses the more lightweight `eval' if the command is to be invoked directly, but this loses if the "falling back on an external program" behavior is activated. When eshell-eval-command is used, it seems to set things up so that the (deferred) command output goes in the correct place. The following patch fixes this. However, maybe it is too drastic because it imposes the use of eshell-eval-command on *every* build-in command. What do you think? *** emacs/lisp/eshell/esh-mode.el.~1.28.2.1.~ 2007-08-08 18:44:33.000000000 -0400 --- emacs/lisp/eshell/esh-mode.el 2007-08-08 18:45:49.000000000 -0400 *************** *** 727,735 **** (run-hooks 'eshell-input-filter-functions) (and (catch 'eshell-terminal (ignore ! (if (eshell-invoke-directly cmd input) ! (eval cmd) ! (eshell-eval-command cmd input)))) (eshell-life-is-too-much))))) (quit (eshell-reset t) --- 727,733 ---- (run-hooks 'eshell-input-filter-functions) (and (catch 'eshell-terminal (ignore ! (eshell-eval-command cmd input))) (eshell-life-is-too-much))))) (quit (eshell-reset t)