From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#18960: 24.4; Eshell history substitution causes error Date: Tue, 09 Dec 2014 17:16:21 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1418163449 29060 80.91.229.3 (9 Dec 2014 22:17:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Dec 2014 22:17:29 +0000 (UTC) Cc: 18960@debbugs.gnu.org, Emanuel Evans To: Samer Masterson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 09 23:17:22 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XyT5t-0000Lv-0W for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Dec 2014 23:17:21 +0100 Original-Received: from localhost ([::1]:42721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyT5s-0008Jw-FL for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Dec 2014 17:17:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyT5i-0008Ie-6k for bug-gnu-emacs@gnu.org; Tue, 09 Dec 2014 17:17:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyT5a-0000EI-53 for bug-gnu-emacs@gnu.org; Tue, 09 Dec 2014 17:17:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyT5a-0000E6-1G for bug-gnu-emacs@gnu.org; Tue, 09 Dec 2014 17:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XyT5Z-0008Ty-Lc for bug-gnu-emacs@gnu.org; Tue, 09 Dec 2014 17:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Dec 2014 22:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18960 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18960-submit@debbugs.gnu.org id=B18960.141816338632551 (code B ref 18960); Tue, 09 Dec 2014 22:17:01 +0000 Original-Received: (at 18960) by debbugs.gnu.org; 9 Dec 2014 22:16:26 +0000 Original-Received: from localhost ([127.0.0.1]:60006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XyT4z-0008Sw-N6 for submit@debbugs.gnu.org; Tue, 09 Dec 2014 17:16:25 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:6118) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XyT4y-0008Sn-6q for 18960@debbugs.gnu.org; Tue, 09 Dec 2014 17:16:25 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwPAOwQflQXW5Ml/2dsb2JhbABSCYMHg2CFWsUdBAICgSQXAQEBAQEBfIQDAQEDAVYjBQsLDiYSFBgNJIhKCdZZAQEBAQYBAQEBHpAUWweESAWLAZIxhlGNJIQZIYJ3AQEB X-IPAS-Result: AjwPAOwQflQXW5Ml/2dsb2JhbABSCYMHg2CFWsUdBAICgSQXAQEBAQEBfIQDAQEDAVYjBQsLDiYSFBgNJIhKCdZZAQEBAQYBAQEBHpAUWweESAWLAZIxhlGNJIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="100014612" Original-Received: from 23-91-147-37.cpe.pppoe.ca (HELO pastel.home) ([23.91.147.37]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Dec 2014 17:16:21 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 11D8772BD; Tue, 9 Dec 2014 17:16:21 -0500 (EST) In-Reply-To: (Samer Masterson's message of "Mon, 8 Dec 2014 03:54:46 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97110 Archived-At: > Modified lisp/eshell/em-hist.el > diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el > index b721b5d..e7e9a1e 100644 > --- a/lisp/eshell/em-hist.el > +++ b/lisp/eshell/em-hist.el > @@ -724,7 +724,7 @@ matched." > (setq nth (eshell-hist-word-reference nth))) > (unless (numberp mth) > (setq mth (eshell-hist-word-reference mth))) > - (cons (mapconcat 'identity (eshell-sublist textargs nth mth) "") > + (cons (mapconcat 'identity (eshell-sublist textargs nth mth) " ") > end)))) Can you explain why this is needed? > @@ -737,7 +737,7 @@ matched." > (goto-char (point-min)) > (let ((modifiers (cdr (eshell-parse-modifiers)))) > (dolist (mod modifiers) > - (setq hist (funcall mod hist))) > + (setq hist (car (funcall mod (list hist))))) > hist)) > (delete-region here (point))))) The docstring of eshell-parse-modifiers says: Parse value modifiers and predicates at point. If ALLOW-PREDS is non-nil, predicates will be parsed as well. Return a cons cell of the form (PRED-FUNC-LIST . MOD-FUNC-LIST) NEW-STRING is STRING minus any modifiers. PRED-FUNC-LIST is a list of predicate functions. MOD-FUNC-LIST is a list of result modifier functions. PRED-FUNCS take a filename and return t if the test succeeds; MOD-FUNCS take any string and preform a modification, returning the resultant string. If I read this right, `mod' (which is one of MOD-FUNCS) should take a string and return a string, IIUC. So, maybe the right fix is not to change this code but to change the functions returned by `eshell-parse-modifiers'. Stefan