diff options
| author | Brian Leung | 2021-01-11 16:42:03 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-01-11 16:42:03 +0100 |
| commit | d0d5e40a5d90eac440d82fb34e7b470c8d07c004 (patch) | |
| tree | 78271eca4b8e4f89b619ce94a1bcfb55d45cbc2e /lisp/shell.el | |
| parent | 26ed7c734557043827f02629dbba00031358e64a (diff) | |
| download | emacs-d0d5e40a5d90eac440d82fb34e7b470c8d07c004.tar.gz emacs-d0d5e40a5d90eac440d82fb34e7b470c8d07c004.zip | |
Make comint-read-input-ring skip uninteresting text in .zsh_history
* lisp/comint.el (comint-read-input-ring): Simplify (bug#45606).
* lisp/shell.el (shell-mode): Add "~/.zsh_history".
* lisp/comint.el (comint-read-input-ring): Bind
`comint-input-ring-file-prefix' in anticipation of a buffer switch.
* lisp/comint.el (comint-read-input-ring): Skip the separator.
Because re-search-backward moves point to the beginning of the match,
and since we don't want the separator appearing in the output, we skip
over it.
This is required to properly detect instances of the value that zsh
uses for `comint-input-ring-file-prefix'; if the
`comint-input-ring-file-prefix' is ':potato', the subsequent
invocation `looking-at' sees '\n:potato' for all entries after the one
at the very beginning of the history file.
Diffstat (limited to 'lisp/shell.el')
| -rw-r--r-- | lisp/shell.el | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index c179dd24d3f..0f866158fe3 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -603,6 +603,7 @@ buffer." | |||
| 603 | (or hfile | 603 | (or hfile |
| 604 | (cond ((string-equal shell "bash") "~/.bash_history") | 604 | (cond ((string-equal shell "bash") "~/.bash_history") |
| 605 | ((string-equal shell "ksh") "~/.sh_history") | 605 | ((string-equal shell "ksh") "~/.sh_history") |
| 606 | ((string-equal shell "zsh") "~/.zsh_history") | ||
| 606 | (t "~/.history"))))) | 607 | (t "~/.history"))))) |
| 607 | (if (or (equal comint-input-ring-file-name "") | 608 | (if (or (equal comint-input-ring-file-name "") |
| 608 | (equal (file-truename comint-input-ring-file-name) | 609 | (equal (file-truename comint-input-ring-file-name) |