From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pierre Neidhardt Newsgroups: gmane.emacs.bugs Subject: bug#29157: 25.3; Eshell parsing fails sometimes, e.g. "date" and "sed" Date: Sun, 05 Nov 2017 15:16:33 +0100 Message-ID: <87lgjkoloe.fsf@gmail.com> References: <87tvy9rm5z.fsf@gmail.com> <87lgjk7rpd.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1509891433 23160 195.159.176.226 (5 Nov 2017 14:17:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Nov 2017 14:17:13 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.3.1 Cc: 29157@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 05 15:17:06 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 1eBLjV-0005mN-HY for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Nov 2017 15:17:05 +0100 Original-Received: from localhost ([::1]:44450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBLjc-0002h4-HR for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Nov 2017 09:17:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBLjW-0002gv-6E for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2017 09:17:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBLjS-00068T-Ru for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2017 09:17:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42677) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eBLjS-00067w-NG for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2017 09:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eBLjS-0007xZ-Gq for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2017 09:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pierre Neidhardt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Nov 2017 14:17: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.150989140230566 (code B ref 29157); Sun, 05 Nov 2017 14:17:02 +0000 Original-Received: (at 29157) by debbugs.gnu.org; 5 Nov 2017 14:16:42 +0000 Original-Received: from localhost ([127.0.0.1]:51358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBLj8-0007ww-E5 for submit@debbugs.gnu.org; Sun, 05 Nov 2017 09:16:42 -0500 Original-Received: from mail-wm0-f54.google.com ([74.125.82.54]:46220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBLj7-0007wk-Gw for 29157@debbugs.gnu.org; Sun, 05 Nov 2017 09:16:41 -0500 Original-Received: by mail-wm0-f54.google.com with SMTP id r68so9192109wmr.1 for <29157@debbugs.gnu.org>; Sun, 05 Nov 2017 06:16:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=UabzcNuNT2EPXdre+YLrS73O8jzhvzDJ5CUBJghhYRk=; b=KOSPnx7Cu8hGXjbEoAuc+uvjaUQnfQrOiohydUl9onEixYn0x3S2n65jqnXirYNGNl iVu/vxD+Ch4GbL3+9H4BkWC36TuIVaW2xjj+T1KC+DI/5bn8zAepgLNA9M5xK41CSY32 LN+PCCAMi9Sz1p+1dCNi4yR+NHiYw5BfaX72pLpY5gIPfjb56VQLosB2hAkbxIlwsHBq /atvkcMUefCjaUwt3W8MYM7LpCwGoAMrZtmaQ+YwqEe3BgFCYxYU9KZmJ2x5FYCmyhhb eS4zozpvoBx7u8N0PG8e7lUOjaO4lKmEKXrDRbsTfl7h4dVKtD7yJFoNz4GwyHrfWuGu zAyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=UabzcNuNT2EPXdre+YLrS73O8jzhvzDJ5CUBJghhYRk=; b=mOjM6kHHLWN4k28Qqh273ORpqUzy55z0XA2Q7oXgLzYMEhvhblszVoeITQ712kxBKd sr5KeryQO7zLZcn42Qf16c6ecdcb1l7QtsDftUi+u746zyGal+4bBOQxRfyJ48yWzJJ0 R+cd+iz6cD97vlA5c+fxoLNy5H1lr6i6n8KC3r7k5Kv7DmR5uBk5cUY90xQyaDxfdD5L EQMLOnosr09jbhKaPuEb6W8wr66l5KMW0Ribd9lDxuZaLgpbn7hnOzWjyPLSBXGWIRXp vdF1Qw35TmdrFjoT4drdUt68Bqb7aBhp377Y/mERUaXHK7T96wid5Zb17AcBKjfdS+8I teLw== X-Gm-Message-State: AJaThX6vKFxlHRq6zp1u3o1Ne54zW+0oHAikgWyxtiLkC5Fds0cInliw WSBHwoeqbxg3wNdaCNcSGaQqDzwQ X-Google-Smtp-Source: ABhQp+SRX58T9v6Nr6aaNJWOY1r610oSP1iH/QKLlMUyGH4JL8Q0pjBBG4hUP6y48fsmSCrrWayEpg== X-Received: by 10.28.131.2 with SMTP id f2mr2858232wmd.137.1509891395579; Sun, 05 Nov 2017 06:16:35 -0800 (PST) Original-Received: from dhiov23k ([197.0.145.22]) by smtp.gmail.com with ESMTPSA id w4sm10357206wrc.17.2017.11.05.06.16.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Nov 2017 06:16:34 -0800 (PST) In-reply-to: <87lgjk7rpd.fsf@users.sourceforge.net> 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:139460 Archived-At: Noam Postavsky writes: > Pierre Neidhardt writes: > >> - emacs -Q >> - M-x eshell >> >> > date +%Z >> Invalid time specification > > ~/src/emacs $ which date > eshell/date is an alias for ‘current-time-string’ in ‘em-unix.el’. > ~/src/emacs $ which *date > /bin/date > ~/src/emacs $ *date +%Z > EST Duh! That was stupid, sorry. Anyways, that might ring an alarm here: maybe eshell/date should not exist. What's the point of having it? I'm not sure. It is obviously less powerful than the system `date'. >> > echo $PATH | sed "s/[^o]foo[^o]/bar/g" >> Unknown predicate character ‘b’ > > M-x toggle-debug-on-error gives more hints about this. Apparently this > matches a "history reference": > > (defun eshell-history-reference (reference) > "Expand directory stack REFERENCE. > The syntax used here was taken from the Bash info manual. > Returns the resultant reference, or the same string REFERENCE if none > matched." > ;; `^string1^string2^' > ;; Quick Substitution. Repeat the last command, replacing > ;; STRING1 with STRING2. Equivalent to `!!:s/string1/string2/' > > Debugger entered--Lisp error: (error "Unknown predicate character ‘b’") > signal(error ("Unknown predicate character ‘b’")) > error("Unknown predicate character `%c'" 98) > eshell-parse-modifiers() > eshell-hist-parse-modifier("printf '<<%s>>\\n' \"s/[^o]foo/\"" ":s/o]foo[/o]/bar/g\"/") > eshell-history-reference("\"s/[^o]foo[^o]/bar/g\"") > eshell-expand-history-references(# 81) > run-hook-with-args(eshell-expand-history-references # 81) > eshell-send-input(nil) > funcall-interactively(eshell-send-input nil) > call-interactively(eshell-send-input nil nil) > command-execute(eshell-send-input) > > > My suggestion for this is just to stop adding > eshell-expand-history-references to eshell-expand-input-functions, and > maybe even deprecate eshell-expand-history-references. I find the > history expansion mechanism to be an annoyance in bash as well. > > --- i/lisp/eshell/em-hist.el > +++ w/lisp/eshell/em-hist.el > @@ -218,9 +218,6 @@ eshell-input-filter-initial-space > > (defun eshell-hist-initialize () > "Initialize the history management code for one Eshell buffer." > - (add-hook 'eshell-expand-input-functions > - 'eshell-expand-history-references nil t) > - > (when (eshell-using-module 'eshell-cmpl) > (add-hook 'pcomplete-try-first-hook > 'eshell-complete-history-reference nil t)) That does it for me. I did not even know this feature existed. I'd it proves more useful in an environment with poor selection / editing capabilities, i.e. a terminal shell. Emacs does not need that when you can fuzzy-search your history and modify your prompt with arbitrary bindings / Lisp code. -- Pierre Neidhardt There are more things in heaven and earth than any place else.