aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2017-11-22 21:59:35 -0500
committerNoam Postavsky2017-12-03 15:39:02 -0500
commit1cdd0e8cd801aa1d6f04ab4d8e6097a46af8c951 (patch)
tree915614a8b3b96a53767a3fc2c38fa5d530c6ad76
parentcfa50d30f2876ca30158082e9a91d19e804a7e09 (diff)
downloademacs-1cdd0e8cd801aa1d6f04ab4d8e6097a46af8c951.tar.gz
emacs-1cdd0e8cd801aa1d6f04ab4d8e6097a46af8c951.zip
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.
-rw-r--r--etc/NEWS9
-rw-r--r--lisp/eshell/em-hist.el3
2 files changed, 9 insertions, 3 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 6b3e7fc244b..cbd50f02272 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -113,6 +113,15 @@ styles as configured by the variable 'completion-styles'.
113These macros are analogue to 'let' and 'let*', but create bindings that 113These macros are analogue to 'let' and 'let*', but create bindings that
114are evaluated lazily. 114are evaluated lazily.
115 115
116** Eshell
117
118---
119*** Expansion of history event designators is disabled by default.
120To restore the old behavior, use
121
122 (add-hook 'eshell-expand-input-functions
123 #'eshell-expand-history-references)
124
116 125
117* New Modes and Packages in Emacs 27.1 126* New Modes and Packages in Emacs 27.1
118 127
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index 8084c126530..df462a70587 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -218,9 +218,6 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil."
218 218
219(defun eshell-hist-initialize () 219(defun eshell-hist-initialize ()
220 "Initialize the history management code for one Eshell buffer." 220 "Initialize the history management code for one Eshell buffer."
221 (add-hook 'eshell-expand-input-functions
222 'eshell-expand-history-references nil t)
223
224 (when (eshell-using-module 'eshell-cmpl) 221 (when (eshell-using-module 'eshell-cmpl)
225 (add-hook 'pcomplete-try-first-hook 222 (add-hook 'pcomplete-try-first-hook
226 'eshell-complete-history-reference nil t)) 223 'eshell-complete-history-reference nil t))