From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Pierre Neidhardt <ambrevar@gmail.com>
Cc: 29157@debbugs.gnu.org
Subject: bug#29157: 25.3; Eshell parsing fails sometimes, e.g. "date" and "sed"
Date: Wed, 22 Nov 2017 22:13:24 -0500 [thread overview]
Message-ID: <87shd5znzf.fsf@users.sourceforge.net> (raw)
In-Reply-To: <87lgjkoloe.fsf@gmail.com> (Pierre Neidhardt's message of "Sun, 05 Nov 2017 15:16:33 +0100")
[-- Attachment #1: Type: text/plain, Size: 806 bytes --]
Pierre Neidhardt <ambrevar@gmail.com> 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).
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1803 bytes --]
From c2753c383e603acfe15f70ee0cb3c93e624c6c39 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
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)
+
\f
* 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
next prev parent reply other threads:[~2017-11-23 3:13 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-05 11:37 bug#29157: 25.3; Eshell parsing fails sometimes, e.g. "date" and "sed" Pierre Neidhardt
2017-11-05 13:58 ` Noam Postavsky
2017-11-05 14:16 ` Pierre Neidhardt
2017-11-23 3:13 ` Noam Postavsky [this message]
2017-11-23 6:55 ` Pierre Neidhardt
2017-11-23 12:59 ` Noam Postavsky
2017-11-23 16:26 ` Eli Zaretskii
2017-11-25 17:54 ` Pierre Neidhardt
2017-11-25 18:32 ` Michael Albinus
2017-11-25 18:35 ` Pierre Neidhardt
2017-11-25 18:50 ` Noam Postavsky
2017-11-25 19:50 ` Eli Zaretskii
2017-11-25 20:06 ` Noam Postavsky
2017-11-25 20:25 ` Eli Zaretskii
2017-11-25 21:41 ` Noam Postavsky
2017-11-26 3:35 ` Eli Zaretskii
2017-11-26 3:21 ` John Wiegley
2017-11-26 15:35 ` Eli Zaretskii
2017-11-26 21:44 ` John Wiegley
2017-11-25 19:29 ` Eli Zaretskii
2017-11-25 19:36 ` Pierre Neidhardt
2017-11-25 19:57 ` Eli Zaretskii
2017-11-26 9:17 ` Pierre Neidhardt
2017-11-26 15:53 ` Eli Zaretskii
2017-11-26 3:21 ` John Wiegley
2017-11-26 15:33 ` Eli Zaretskii
2017-11-26 21:45 ` John Wiegley
2017-11-27 3:32 ` Eli Zaretskii
2017-12-21 8:17 ` John Wiegley
2017-12-03 20:43 ` Noam Postavsky
2017-12-04 8:43 ` John Wiegley
2017-12-04 12:51 ` Noam Postavsky
2017-11-05 15:16 ` Andreas Schwab
2017-11-10 2:04 ` Noam Postavsky
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=87shd5znzf.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=29157@debbugs.gnu.org \
--cc=ambrevar@gmail.com \
/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).