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: Wed, 22 Nov 2017 22:13:24 -0500 Message-ID: <87shd5znzf.fsf@users.sourceforge.net> References: <87tvy9rm5z.fsf@gmail.com> <87lgjk7rpd.fsf@users.sourceforge.net> <87lgjkoloe.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1511406860 32683 195.159.176.226 (23 Nov 2017 03:14:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 23 Nov 2017 03:14:20 +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 04:14:16 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 1eHhxn-0007aQ-H7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Nov 2017 04:14:07 +0100 Original-Received: from localhost ([::1]:42321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHhxu-00032L-Mm for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Nov 2017 22:14:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHhxo-00032G-21 for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 22:14:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHhxk-0004tG-PO for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 22:14:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHhxk-0004sf-KM for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 22:14:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eHhxi-00033g-9J for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 22:14: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 03:14: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.151140681511709 (code B ref 29157); Thu, 23 Nov 2017 03:14:02 +0000 Original-Received: (at 29157) by debbugs.gnu.org; 23 Nov 2017 03:13:35 +0000 Original-Received: from localhost ([127.0.0.1]:53253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHhxG-00032n-MW for submit@debbugs.gnu.org; Wed, 22 Nov 2017 22:13:34 -0500 Original-Received: from mail-it0-f42.google.com ([209.85.214.42]:43920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHhxE-00032Z-Up for 29157@debbugs.gnu.org; Wed, 22 Nov 2017 22:13:33 -0500 Original-Received: by mail-it0-f42.google.com with SMTP id m191so8564809itg.2 for <29157@debbugs.gnu.org>; Wed, 22 Nov 2017 19:13:32 -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=2J5kLsVCJENaSr6F7R/r/ifphspwNu569y7/Yik7Vhw=; b=gXLWjhxE1uUDuiFILOExDkDOXjjK/Gu0FNJMTWyHdq4NHe9ivRdB4JYxL09wtd4Okh +sxD+iV/uXsd1Q4lOvD+J3c0rdo8Z7lsNyxgX6Kdk4hFKwDtsTXpExS0r1zFam2fSdAQ CodZ8NpDVhTSkTpepGSE9gX8xfEtJM6ncmuuSxp0wh83p4/9NLRce14Vj9Hk3DxvEHd7 JLkv8gwZO14LfiplhKLeMOuLONtlaF4u6pO98G9vySKhKGA0ZtlX0+bWe4SRVxUZSVpf 2+kzqcgQzki/imF28aePfnblDmIpK4lyVBSW09G4XeoisO+Fc5KCzgD5fPC6YH8Rv9+g CJpQ== 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=2J5kLsVCJENaSr6F7R/r/ifphspwNu569y7/Yik7Vhw=; b=T1KcdAq93Ev2vqWza/vScZvN0vwBiw5jLJz7mud5KpMNfbRu0kykZuzi9RJOdIuKpF 05rIzEa2R1PSWM9jzCjic0uW+lNyzzQWUo+kVCYP/WwG0sS7+jV8tUj/t7RnsOQuTCOU 5BTpTYVMlKDbaFMyuM8IMCUSbXJUAft+AEgo6xUKpR7g3Kr+h+ijHKymgnYkKNeEkaqk G4NOnb5M00V2X+ocfBy4tdoqUYqqfcQ46R86sUiUzUuM5r6UXdQkS8a+Tgga/SkBHCMU q/bLSMY3qEutXEhB+3wXRF8BOb1kXKNIncs0JydZq80sRPHMpyqYPqtFTsLn4XBEPn1f A0UA== X-Gm-Message-State: AJaThX4kcopl0XbSjUcjwwHNEYxOOxkSPQLdRk7n87cQU162iixiBkhd dZChNgIm8rqd78fAsn3vw/7DvQ== X-Google-Smtp-Source: AGs4zMays+tIs/e4y9lFxnVM7zmQT7CUe90/0GjVItXHcyXbWb7qaV93K0ndkCZjmGonQEF6w8Pm8A== X-Received: by 10.36.245.133 with SMTP id k127mr9735884ith.136.1511406807107; Wed, 22 Nov 2017 19:13:27 -0800 (PST) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id y133sm2723750itf.7.2017.11.22.19.13.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Nov 2017 19:13:25 -0800 (PST) In-Reply-To: <87lgjkoloe.fsf@gmail.com> (Pierre Neidhardt's message of "Sun, 05 Nov 2017 15:16:33 +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:140260 Archived-At: --=-=-= Content-Type: text/plain Pierre Neidhardt writes: > 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'. Eshell has lots of commands like that. I guess it makes it more portable? > 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. I agree. Although the expansion in this case is arguably a bug (as Andreas pointed out), I don't have much interest in fixing it. I propose just to disable it by default (in master). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Disable-history-expansion-in-eshell-Bug-29157.patch Content-Description: patch >From c2753c383e603acfe15f70ee0cb3c93e624c6c39 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 22 Nov 2017 21:59:35 -0500 Subject: [PATCH] Disable history expansion in eshell (Bug#29157) History expansion is not so useful since interactive history commands are already provided. It can produce surprising errors when the user is not aware of the history designator syntax. * lisp/eshell/em-hist.el (eshell-hist-initialize): Don't add eshell-expand-history-references to eshell-expand-input-functions. * etc/NEWS: Announce it. --- etc/NEWS | 9 +++++++++ lisp/eshell/em-hist.el | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index c47ca42d27..5a01b912ec 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -109,6 +109,15 @@ Snake and Pong are more playable on HiDPI displays. *** Completing filenames in the minibuffer via 'C-TAB' now uses the styles as configured by the variable 'completion-styles'. +** Eshell + +--- +*** Expansion of history event designators is disabled by default. +To restore the old behavior, use + + (add-hook 'eshell-expand-input-functions + #'eshell-expand-history-references) + * New Modes and Packages in Emacs 27.1 diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 8084c12653..df462a7058 100644 --- a/lisp/eshell/em-hist.el +++ b/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)) -- 2.11.0 --=-=-=--