From 0be6f4f1873153cdbdb84c36f460975a6c95829a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 9 Mar 2011 01:01:14 -0800 Subject: [PATCH] * shell.el (shell-mode): Set comint-input-ring-size from HISTSIZE. (Bug#7889) --- lisp/ChangeLog | 3 +++ lisp/shell.el | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 253d47364f8..8b3b5b6801b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-03-09 Glenn Morris + * shell.el (shell-mode): + Set comint-input-ring-size from HISTSIZE. (Bug#7889) + * progmodes/gdb-mi.el (gdb): Improve 2010-12-08 change. Check for GDBHISTFILE, HISTSIZE, etc. (Bug#7889) 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") -- 2.39.5