]> git.eshelyaron.com Git - emacs.git/commit
Improve read/append behavior of eshell history command
authorLiu Hui <liuhui1610@gmail.com>
Tue, 7 Nov 2023 01:10:59 +0000 (09:10 +0800)
committerJim Porter <jporterbugs@gmail.com>
Sat, 11 Nov 2023 02:00:07 +0000 (18:00 -0800)
commit8b3969006fe6095178eea38df096d73bdd460a15
tree2dc101d82153f156ff8019bc03e5c717725e17e1
parent400a71b8f2c5a49dce4f542adfd2fdb59eb34243
Improve read/append behavior of eshell history command

* lisp/eshell/em-hist.el (eshell-hist--new-items): New variable.
(eshell-hist-initialize): Initialize 'eshell-hist--new-items' to 0.
(eshell/history): Change the behavior of 'history -a' to "append new
history in current buffer to history file".  Clarify the help text of
'history -r'.
(eshell-add-input-to-history): Increase counter of new history items.
(eshell-read-history): Respect 'eshell-hist-ignoredups' option.
(eshell-write-history): If the optional argument APPEND is non-nil,
appending new history items rather than the whole history.

* test/lisp/eshell/em-hist-tests.el (em-hist-test/history-append)
(em-hist-test/history-read): New tests (bug#66768).
lisp/eshell/em-hist.el
test/lisp/eshell/em-hist-tests.el