diff options
| author | Noam Postavsky | 2017-11-22 21:59:35 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2017-12-03 15:39:02 -0500 |
| commit | 1cdd0e8cd801aa1d6f04ab4d8e6097a46af8c951 (patch) | |
| tree | 915614a8b3b96a53767a3fc2c38fa5d530c6ad76 | |
| parent | cfa50d30f2876ca30158082e9a91d19e804a7e09 (diff) | |
| download | emacs-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/NEWS | 9 | ||||
| -rw-r--r-- | lisp/eshell/em-hist.el | 3 |
2 files changed, 9 insertions, 3 deletions
| @@ -113,6 +113,15 @@ styles as configured by the variable 'completion-styles'. | |||
| 113 | These macros are analogue to 'let' and 'let*', but create bindings that | 113 | These macros are analogue to 'let' and 'let*', but create bindings that |
| 114 | are evaluated lazily. | 114 | are evaluated lazily. |
| 115 | 115 | ||
| 116 | ** Eshell | ||
| 117 | |||
| 118 | --- | ||
| 119 | *** Expansion of history event designators is disabled by default. | ||
| 120 | To 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)) |