unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Phil Hagelberg <phil@hagelb.org>
Cc: 27361@debbugs.gnu.org, npostavs@users.sourceforge.net
Subject: bug#27361: 24.4; eshell/echo silently ignores -n argument
Date: Mon, 19 Jun 2017 22:17:26 -0400	[thread overview]
Message-ID: <axh8zbjtc9.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <17r2yfe7zo.fsf@fencepost.gnu.org> (Glenn Morris's message of "Mon, 19 Jun 2017 21:57:31 -0400")


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)





  reply	other threads:[~2017-06-20  2:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 16:15 bug#27361: 24.4; eshell/echo silently ignores -n argument Phil Hagelberg
2017-06-19  4:11 ` npostavs
2017-06-19 15:22   ` Phil Hagelberg
2017-06-20  1:57     ` Glenn Morris
2017-06-20  2:17       ` Glenn Morris [this message]
2020-09-15 15:27         ` Lars Ingebrigtsen
2022-01-16  7:19           ` bug#27361: " Jim Porter
2022-01-20  9:36             ` Lars Ingebrigtsen
2022-01-21  1:27               ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=axh8zbjtc9.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=27361@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    --cc=phil@hagelb.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).