diff options
| author | Liu Hui | 2023-11-16 11:45:28 +0800 |
|---|---|---|
| committer | Sean Whitton | 2023-12-07 11:32:29 +0000 |
| commit | 3a7abc7e497e77ba9bc5a71f3836636675dffe6b (patch) | |
| tree | 204dc26cab928351231ebcd9e3669a324bdbdbf0 /doc | |
| parent | e4e1e268c8e9f7de6fe5d4b05beb595a1781c02c (diff) | |
| download | emacs-3a7abc7e497e77ba9bc5a71f3836636675dffe6b.tar.gz emacs-3a7abc7e497e77ba9bc5a71f3836636675dffe6b.zip | |
Add option eshell-history-append
* lisp/eshell/em-hist.el (eshell-history-append): New option.
(eshell--save-history): New function.
(eshell-hist-initialize):
(eshell-save-some-history): Replace eshell-write-history with
eshell--save-history, which respects the new option.
* doc/misc/eshell.texi (History): Document the change.
* etc/NEWS: Announce the change. (Bug#66700)
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/misc/eshell.texi | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index e8aa8cdc6a3..99a1491f1c3 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -1237,11 +1237,20 @@ command containing @code{foo}. The n-th argument of the last command | |||
| 1237 | beginning with @code{foo} is accessible by @code{!foo:n}. | 1237 | beginning with @code{foo} is accessible by @code{!foo:n}. |
| 1238 | 1238 | ||
| 1239 | @vindex eshell-history-file-name | 1239 | @vindex eshell-history-file-name |
| 1240 | The history ring is loaded from a file at the start of every session, | 1240 | @vindex eshell-history-append |
| 1241 | and written back to the file at the end of every session. The file path | 1241 | The history is loaded to the history ring from the file |
| 1242 | is specified in @code{eshell-history-file-name}. Unlike other shells, | 1242 | @code{eshell-history-file-name} at the start of every session, and |
| 1243 | such as Bash, Eshell can not be configured to keep a history ring of a | 1243 | saved to that file at the end of every session. The default history |
| 1244 | different size than that of the history file. | 1244 | saving behavior is to overwrite the history file with the whole |
| 1245 | history ring of the session. If @code{eshell-history-append} is | ||
| 1246 | non-@code{nil}, the history will instead be saved by appending new | ||
| 1247 | entries from the session to the history file, which could prevent | ||
| 1248 | potential history loss with multiple Eshell sessions. Unlike other | ||
| 1249 | shells, such as Bash, Eshell cannot currently be configured to control | ||
| 1250 | the size of the history file. In particular, when | ||
| 1251 | @code{eshell-history-append} is non-@code{nil}, the size of the file | ||
| 1252 | will keep increasing, and the recommended way to truncate the file is | ||
| 1253 | to run the @samp{history -w} command in an Eshell session. | ||
| 1245 | 1254 | ||
| 1246 | Since the default buffer navigation and searching key-bindings are | 1255 | Since the default buffer navigation and searching key-bindings are |
| 1247 | still present in the Eshell buffer, the commands for history | 1256 | still present in the Eshell buffer, the commands for history |