]> git.eshelyaron.com Git - emacs.git/commit
Make eshell history expansion more like bash (Bug#29821)
authorJay Kamat <jaygkamat@gmail.com>
Fri, 22 Dec 2017 23:34:44 +0000 (15:34 -0800)
committerNoam Postavsky <npostavs@gmail.com>
Fri, 5 Jan 2018 14:29:00 +0000 (09:29 -0500)
commit933d8fc0b70452f8a266e761231e58a759a7c80a
tree255939a4a1f1e651559dedda47964f2f192dc725
parent1cc7bc0f63ab118fda55aa40fa4b571a7c94393e
Make eshell history expansion more like bash (Bug#29821)

- Prevent expansion of quick substitutions when the initial "^" is not
  at start of line (Bug#29157).
- Allow spaces inside substitutions, so "^foo bar^baz" works.
- Allow trailing characters after substitution, so "^foo^bar^trailing"
  works.
- Throw an error when substitution does not match.

* lisp/eshell/em-hist.el (eshell-expand-history-references): Expand
history substitution before other types of expansions, and expand them
with the whole line.
(eshell-history-substitution): New function to expand only
substitutions, taking in the entire typed line rather than individual
arguments.
lisp/eshell/em-hist.el
lisp/eshell/em-pred.el