From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: Optimal emacs shell for coding Date: Wed, 13 Aug 2008 13:21:00 +0200 Message-ID: <873al9upnn.fsf@tux.homenetwork> References: <577bf477-6877-4cab-b4c3-fb72b995a095@i20g2000prf.googlegroups.com> <66bf7b7c-8e2b-4266-812a-6531c93f9399@v1g2000pra.googlegroups.com> <87skta4py4.fsf@lion.rapttech.com.au> <48A17CAA.2060505@gmail.com> <48A1D923.1030001@gmail.com> <48A1DE3D.7070704@gmail.com> <87k5el497r.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218626683 8180 80.91.229.12 (13 Aug 2008 11:24:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2008 11:24:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 13 13:25:35 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KTETu-0003Ub-Ij for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Aug 2008 13:25:34 +0200 Original-Received: from localhost ([127.0.0.1]:57906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTESy-0001Nv-3p for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Aug 2008 07:24:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTESQ-0001Kl-QM for help-gnu-emacs@gnu.org; Wed, 13 Aug 2008 07:24:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTESP-0001JH-Qt for help-gnu-emacs@gnu.org; Wed, 13 Aug 2008 07:24:01 -0400 Original-Received: from [199.232.76.173] (port=33317 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTESP-0001J8-9P for help-gnu-emacs@gnu.org; Wed, 13 Aug 2008 07:24:01 -0400 Original-Received: from ug-out-1314.google.com ([66.249.92.174]:40307) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTESP-0008MO-3d for help-gnu-emacs@gnu.org; Wed, 13 Aug 2008 07:24:01 -0400 Original-Received: by ug-out-1314.google.com with SMTP id l31so76685ugc.48 for ; Wed, 13 Aug 2008 04:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=aRHQdZNiJ50YWd4yUabad+FDapX8Fvq1dwSinutWDzQ=; b=E6elcGLEmAtnHdjfNh6qNODTNllKd40ulM5bfvF5WMl1AjfAeTk5t/3U5Yw6CgvSho 84A54SGXGylnxBEFvGIC4zTadu3cuOLJBDrdcQ3pLgMxojn/CWQWgJcUr4UyAaiUTQMC G+zJNIrfJeDWY2dU1lQJrCTkuQ+ZS/9lCQFRI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; b=t3cBYK430/lw/N1DsTq0KTtKzDeFAVI9WLbnY2G5CSoLXvUAOqaZZrh9lxjXOtXyUm NGbbxW37cJMv1Gbtk1gO1y0MSX7Gfr+Xd/v0UAuWInYbRk6a8fc6W27ydJ2rV0RYvVH4 LdcRmj9kQkmcgw6YQ83gNOxrMti9XtV6pmmMw= Original-Received: by 10.66.232.10 with SMTP id e10mr483764ugh.71.1218626639813; Wed, 13 Aug 2008 04:23:59 -0700 (PDT) Original-Received: from tux.homenetwork ( [77.197.77.211]) by mx.google.com with ESMTPS id t38sm653726ugc.83.2008.08.13.04.23.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 13 Aug 2008 04:23:58 -0700 (PDT) In-Reply-To: <87k5el497r.fsf@lion.rapttech.com.au> (Tim X.'s message of "Wed, 13 Aug 2008 18:20:40 +1000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:56553 Archived-At: Tim X writes: > Eli Zaretskii writes: > >>> Date: Tue, 12 Aug 2008 21:02:21 +0200 >>> From: "Lennart Borgman (gmail)" >>> CC: help-gnu-emacs@gnu.org >>> >>> Eli Zaretskii wrote: >>> >> Date: Tue, 12 Aug 2008 20:40:35 +0200 >>> >> From: "Lennart Borgman (gmail)" >>> >> CC: help-gnu-emacs@gnu.org >>> >> >>> >> Eli Zaretskii wrote: >>> >>>> Date: Tue, 12 Aug 2008 14:06:02 +0200 >>> >>>> From: "Lennart Borgman (gmail)" >>> >>>> CC: help-gnu-emacs@gnu.org >>> >>>> >>> >>>> If you look carefully at the output you can see that what is not handled >>> >>>> is the parameters to "ls". If you try "ls -1" it will work. >>> >>> What "parameters to ls"? "ls" was invoked without any parameters. >>> >> If you from a shell do >>> >> >>> >> ls | grep >>> >> >>> >> then normally ls implicitly gets the -1 parameter >>> > >>> > No, it doesn't. Please try and see for yourself (I just did). >>> >>> >>> We are miscommunicating. >> >> Maybe you are; I am not ;-) >> >>> I am saying that if I from a shell outside of Emacs do >>> >>> ls >>> >>> than I get several files listed on each row while the output from >>> >>> ls | grep some-file >>> >>> implies that ls got the implicit argument -1 when used in the pipe. >> >> And I'm saying that you are wrong: -1 is not implied in a pipeline >> from the shell prompt, either. Please try that and see for yourself. >> I tried that both on GNU/Linux and in a Windows command prompt window, >> and GNU `ls' does not imply -1 in either case. >> > Exactly. An you can do another test. Just do > > ls | less > > all the files are on one line each. this is standard behavior for ls if > you pipe or redirect it away from a tty. It only formats multi-column > output if the output device is a tty, unless you provide the switch to > force single column output. Note also that usually, the number of > columns is a function of the longest filename and the display width. The > concept of 'width' has no meaning with respect to stdout or when > redirecting via | or > etc. > > Note that this is 'normal' behavior - if programs output multiple items > per line, it would screw up programs that you pipe into. > > Tim Sorry, i insert again this reply here, i think i did a mistake and reply on another topic. As Lennart said you call ls with -1 arg or you can always call ls with this arg setting it like that: ,---- | (setq eshell-ls-initial-args '(-1)) `---- now when you call for example "ls | wc -l" , you will have the good number of lines. It would be cool to have a function to call in some hook to call ls -1 only if there is a "|" after ls, this function do that but i need a hook to call it: ,---- | (defun eshell-set-ls () | (let ((com-line | (eshell-parse-arguments (re-search-backward "ls") (line-end-position)))) | (if (equal (nth 1 com-line) '(eshell-operator "|")) | (setq eshell-ls-initial-args '(-1)) | (setq eshell-ls-initial-args nil)))) `---- -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France