From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#27361: 24.4; eshell/echo silently ignores -n argument Date: Mon, 19 Jun 2017 22:17:26 -0400 Message-ID: References: <87tw3ilf4i.fsf@hagelb.org> <87fuewr4zt.fsf@users.sourceforge.net> <871sqgroft.fsf@hagelb.org> <17r2yfe7zo.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1497925090 2806 195.159.176.226 (20 Jun 2017 02:18:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Jun 2017 02:18:10 +0000 (UTC) User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cc: 27361@debbugs.gnu.org, npostavs@users.sourceforge.net To: Phil Hagelberg Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 20 04:18:05 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dN8k0-0000Nw-En for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Jun 2017 04:18:04 +0200 Original-Received: from localhost ([::1]:45911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN8k5-0006pT-MU for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Jun 2017 22:18:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN8jz-0006pO-NF for bug-gnu-emacs@gnu.org; Mon, 19 Jun 2017 22:18:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dN8jy-0001dy-Qf for bug-gnu-emacs@gnu.org; Mon, 19 Jun 2017 22:18:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54130) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dN8jy-0001dg-Md for bug-gnu-emacs@gnu.org; Mon, 19 Jun 2017 22:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dN8jy-0008EV-IL for bug-gnu-emacs@gnu.org; Mon, 19 Jun 2017 22:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Jun 2017 02:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27361-submit@debbugs.gnu.org id=B27361.149792505731614 (code B ref 27361); Tue, 20 Jun 2017 02:18:02 +0000 Original-Received: (at 27361) by debbugs.gnu.org; 20 Jun 2017 02:17:37 +0000 Original-Received: from localhost ([127.0.0.1]:56807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dN8jZ-0008Dp-AQ for submit@debbugs.gnu.org; Mon, 19 Jun 2017 22:17:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dN8jY-0008De-4U for 27361@debbugs.gnu.org; Mon, 19 Jun 2017 22:17:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dN8jS-0001Ie-8f for 27361@debbugs.gnu.org; Mon, 19 Jun 2017 22:17:31 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN8jO-0001Gl-Lz; Mon, 19 Jun 2017 22:17:26 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1dN8jO-0005tB-6G; Mon, 19 Jun 2017 22:17:26 -0400 X-Spook: Mexico MS13 Riot enigma Hazardous CBP Colombia X-Ran: UI!C&$/i@l#)hd@]R32wC\N|UjNnj02x6|J85}j+j2dFs)=$BNj53x&\|yczu3<*=19b*] X-Hue: cyan X-Attribution: GM In-Reply-To: <17r2yfe7zo.fsf@fencepost.gnu.org> (Glenn Morris's message of "Mon, 19 Jun 2017 21:57:31 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:133781 Archived-At: It seems easy to get the behaviour that you want, for the eshell-plain-echo-behavior case, which is the only relevant one. At the same time, we can fix eshell/printnl for that case, to avoid the doubled newlines that it currently gives. I don't know how to explain in --help what -n means though. :) --- a/lisp/eshell/em-basic.el +++ b/lisp/eshell/em-basic.el @@ -88,7 +88,8 @@ eshell-echo It returns a formatted value that should be passed to `eshell-print' or `eshell-printn' for display." (if eshell-plain-echo-behavior - (concat (apply 'eshell-flatten-and-stringify args) "\n") + (concat (apply 'eshell-flatten-and-stringify args) + (unless output-newline "\n")) (let ((value (cond ((= (length args) 0) "") @@ -126,7 +127,8 @@ eshell/printnl "Print out each of the arguments, separated by newlines." (let ((elems (eshell-flatten-list args))) (while elems - (eshell-printn (eshell-echo (list (car elems)))) + (eshell-printn (eshell-echo (list (car elems)) + eshell-plain-echo-behavior)) (setq elems (cdr elems))))) (defun eshell/listify (&rest args)