207 |
|
|
208 |
(defun eshell-hist-initialize () |
(defun eshell-hist-initialize () |
209 |
"Initialize the history management code for one Eshell buffer." |
"Initialize the history management code for one Eshell buffer." |
|
(make-local-hook 'eshell-expand-input-functions) |
|
210 |
(add-hook 'eshell-expand-input-functions |
(add-hook 'eshell-expand-input-functions |
211 |
'eshell-expand-history-references nil t) |
'eshell-expand-history-references nil t) |
212 |
|
|
213 |
(when (eshell-using-module 'eshell-cmpl) |
(when (eshell-using-module 'eshell-cmpl) |
|
(make-local-hook 'pcomplete-try-first-hook) |
|
214 |
(add-hook 'pcomplete-try-first-hook |
(add-hook 'pcomplete-try-first-hook |
215 |
'eshell-complete-history-reference nil t)) |
'eshell-complete-history-reference nil t)) |
216 |
|
|
222 |
(append rebind-alist eshell-hist-rebind-keys-alist)) |
(append rebind-alist eshell-hist-rebind-keys-alist)) |
223 |
(set (make-local-variable 'search-invisible) t) |
(set (make-local-variable 'search-invisible) t) |
224 |
(set (make-local-variable 'search-exit-option) t) |
(set (make-local-variable 'search-exit-option) t) |
|
(make-local-hook 'isearch-mode-hook) |
|
225 |
(add-hook 'isearch-mode-hook |
(add-hook 'isearch-mode-hook |
226 |
(function |
(function |
227 |
(lambda () |
(lambda () |
228 |
(if (>= (point) eshell-last-output-end) |
(if (>= (point) eshell-last-output-end) |
229 |
(setq overriding-terminal-local-map |
(setq overriding-terminal-local-map |
230 |
eshell-isearch-map)))) nil t) |
eshell-isearch-map)))) nil t) |
|
(make-local-hook 'isearch-mode-end-hook) |
|
231 |
(add-hook 'isearch-mode-end-hook |
(add-hook 'isearch-mode-end-hook |
232 |
(function |
(function |
233 |
(lambda () |
(lambda () |
274 |
(if eshell-history-file-name |
(if eshell-history-file-name |
275 |
(eshell-read-history nil t)) |
(eshell-read-history nil t)) |
276 |
|
|
|
(make-local-hook 'eshell-exit-hook) |
|
277 |
(add-hook 'eshell-exit-hook 'eshell-write-history nil t)) |
(add-hook 'eshell-exit-hook 'eshell-write-history nil t)) |
278 |
|
|
279 |
(unless eshell-history-ring |
(unless eshell-history-ring |
280 |
(setq eshell-history-ring (make-ring eshell-history-size))) |
(setq eshell-history-ring (make-ring eshell-history-size))) |
281 |
|
|
|
(make-local-hook 'eshell-exit-hook) |
|
282 |
(add-hook 'eshell-exit-hook 'eshell-write-history nil t) |
(add-hook 'eshell-exit-hook 'eshell-write-history nil t) |
283 |
|
|
284 |
(add-hook 'kill-emacs-hook 'eshell-save-some-history) |
(add-hook 'kill-emacs-hook 'eshell-save-some-history) |