From 0be6f4f1873153cdbdb84c36f460975a6c95829a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 9 Mar 2011 01:01:14 -0800 Subject: * shell.el (shell-mode): Set comint-input-ring-size from HISTSIZE. (Bug#7889) --- lisp/shell.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/shell.el') diff --git a/lisp/shell.el b/lisp/shell.el index 2f11cc6314c..bceea990baf 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -459,7 +459,12 @@ buffer." ;; shell-dependent assignments. (when (ring-empty-p comint-input-ring) (let ((shell (file-name-nondirectory (car - (process-command (get-buffer-process (current-buffer))))))) + (process-command (get-buffer-process (current-buffer)))))) + (hsize (getenv "HISTSIZE"))) + (and (stringp hsize) + (integerp (setq hsize (string-to-number hsize))) + (> hsize 0) + (set (make-local-variable 'comint-input-ring-size) hsize)) (setq comint-input-ring-file-name (or (getenv "HISTFILE") (cond ((string-equal shell "bash") "~/.bash_history") -- cgit v1.2.1