From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#29157: 25.3; Eshell parsing fails sometimes, e.g. "date" and "sed" Date: Thu, 23 Nov 2017 07:59:10 -0500 Message-ID: <87po89ywv5.fsf@users.sourceforge.net> References: <87tvy9rm5z.fsf@gmail.com> <87lgjk7rpd.fsf@users.sourceforge.net> <87lgjkoloe.fsf@gmail.com> <87shd5znzf.fsf@users.sourceforge.net> <87po891o1t.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1511442161 25114 195.159.176.226 (23 Nov 2017 13:02:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 23 Nov 2017 13:02:41 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 29157@debbugs.gnu.org To: Pierre Neidhardt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 23 14:02:33 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 1eHr97-0005cC-Ar for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Nov 2017 14:02:25 +0100 Original-Received: from localhost ([::1]:44198 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHr9E-0006Mu-Ft for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Nov 2017 08:02:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHr6t-0004K6-HB for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 08:00:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHr6o-0008Kd-Lz for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 08:00:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44789) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHr6o-0008KG-Hi for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 08:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eHr6o-0002V7-8a for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2017 08:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Nov 2017 13:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29157 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29157-submit@debbugs.gnu.org id=B29157.15114419629532 (code B ref 29157); Thu, 23 Nov 2017 13:00:02 +0000 Original-Received: (at 29157) by debbugs.gnu.org; 23 Nov 2017 12:59:22 +0000 Original-Received: from localhost ([127.0.0.1]:53470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHr6A-0002Tg-5Z for submit@debbugs.gnu.org; Thu, 23 Nov 2017 07:59:22 -0500 Original-Received: from mail-it0-f54.google.com ([209.85.214.54]:43906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHr68-0002TQ-Fm for 29157@debbugs.gnu.org; Thu, 23 Nov 2017 07:59:20 -0500 Original-Received: by mail-it0-f54.google.com with SMTP id m191so10021554itg.2 for <29157@debbugs.gnu.org>; Thu, 23 Nov 2017 04:59:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=uGpf6o0ydkKJhS/oXnizxLfU3/g64kMjCc+6QkEVlEw=; b=ROODpmEf0osH9rIeDl1ksUJ5/Ekw7zo0PckIn4sXQcuLmr4ACZB1/pZ2USCMthiViC UJ6Z0uVGltsE2ioRArsnj1ZfzqdrXrRFYCOO7e5hfb6k249Xpr0LYhJmnu4gQcs91JJo mWiSzOpD7q1gHMHrMnP4ngosLqO8Xa1oL4ic/QqBPvD6xSyJvWfr1mCljjZgrX5/rDzl 3XN90resKJ7jIrzgHGChlwuFEhYAt/J6HhZ0j/zqP7gQBetiBrKaGDb5dLJJGxbYOK4L oYYq5sJTGd397iPGFZHoJK2H00T/LCvYdzT+TRlQtkvc8snme+yzp5sQreBscY1uscRJ CjSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=uGpf6o0ydkKJhS/oXnizxLfU3/g64kMjCc+6QkEVlEw=; b=PDtE7xid+2Q3XXptuovNExQ4jK3UgP382fS0ec7WmT4jy9+D1twhfO5NKWvvd/EOfN OIXijL7/8NvcI40scWIxbkWJCwGYuW5iFXugkRy580o7YxFFnw4WJgrhtdwi8qMjgHKG fDEJcPHhROlt87fAcSudrjRdyOyqEaMWV20hhicTMtwG7EUeU5GlWcOSfQQfbk6P1KOA SfAuMmpHWQqoBQf9rRrYymHM1GpEh9uMN54uhFF+u7n/a7ZKBD1rfmHdFhYjNpZztbsT KpwIxW9Pls9BFZs4aVFcej2vy08XI/cz9SvLINTOVaH95Aox6njKxqFlus6AgodV72/l uqhg== X-Gm-Message-State: AJaThX4d8allzmtCETP3D+vW/HHKNLRrrf94qO9tFr7MD2byt6ykaZv5 8P4QltSzEtCgOq8ux+Qwt43jOQ== X-Google-Smtp-Source: AGs4zMaiEMvvdzJ360x4NAkJOVG5uhHTg468hprVl6UiuUCbn6cCTuxTAyr07f7KsQG6QmHL2fD+iw== X-Received: by 10.36.83.137 with SMTP id n131mr12344943itb.82.1511441954358; Thu, 23 Nov 2017 04:59:14 -0800 (PST) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 139sm2819659itm.2.2017.11.23.04.59.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Nov 2017 04:59:12 -0800 (PST) In-Reply-To: <87po891o1t.fsf@gmail.com> (Pierre Neidhardt's message of "Thu, 23 Nov 2017 07:55:58 +0100") 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:140264 Archived-At: --=-=-= Content-Type: text/plain Pierre Neidhardt writes: > Disabling eshell/date makes Eshell less portable on one system at least, > that is Windows. But what does "portability" mean in this context? Are > the coreutils meant to be part of Eshell? Why? Supporting `date' but not > its arguments does not make up for actual portability I believe. Case > in point: I got fooled. > > Let's take the case of BSD vs. GNU: bash or zsh do not wrap around `ls', > so the behaviour will not be the same on BSD and GNU. Why should Eshell > be any different? Eshell isn't exactly the same as bash or zsh. You can use M-x shell if you prefer them. We could fallback to the external command if given arguments. This is being done currently for other commands like eshell/rm (for unrecognized arguments, that is). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-eshell-date-use-external-date-for-any-arguments-Bug-.patch Content-Description: patch >From ab25f638ccff0ebec36b78f9b47092fe9fb103b3 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 23 Nov 2017 07:51:13 -0500 Subject: [PATCH] eshell/date: use external date for any arguments (Bug#29157) * lisp/eshell/em-unix.el (eshell/date): Throw `eshell-external' if given any arguments. (eshell-unix-initialize): Add "date" to `eshell-complex-commands'. --- lisp/eshell/em-unix.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index c486d2c51d..342a045d42 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -148,13 +148,18 @@ eshell-unix-initialize (make-local-variable 'eshell-complex-commands) (setq eshell-complex-commands (append '("grep" "egrep" "fgrep" "agrep" "glimpse" "locate" - "cat" "time" "cp" "mv" "make" "du" "diff") + "cat" "date" "time" "cp" "mv" "make" "du" "diff") eshell-complex-commands))) -(defalias 'eshell/date 'current-time-string) (defalias 'eshell/basename 'file-name-nondirectory) (defalias 'eshell/dirname 'file-name-directory) +(defun eshell/date (&rest args) + (when args + (throw 'eshell-external + (eshell-external-command "date" args))) + (current-time-string)) + (defvar em-interactive) (defvar em-preview) (defvar em-recursive) -- 2.11.0 --=-=-=--