summaryrefslogtreecommitdiff
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-03-09 01:01:14 -0800
committerGlenn Morris <rgm@gnu.org>2011-03-09 01:01:14 -0800
commit0be6f4f1873153cdbdb84c36f460975a6c95829a (patch)
tree4abcc7dc552587b12608a251c7fa32640a5668b2 /lisp/shell.el
parent791cd3860e38e633cf301aced257a1eac89f2b1f (diff)
downloademacs-0be6f4f1873153cdbdb84c36f460975a6c95829a.tar.gz
emacs-0be6f4f1873153cdbdb84c36f460975a6c95829a.tar.bz2
emacs-0be6f4f1873153cdbdb84c36f460975a6c95829a.zip
* shell.el (shell-mode): Set comint-input-ring-size from HISTSIZE. (Bug#7889)
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el7
1 files changed, 6 insertions, 1 deletions
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")