summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorJoakim Verona <joakim@verona.se>2011-12-28 04:12:56 +0100
committerJoakim Verona <joakim@verona.se>2011-12-28 04:12:56 +0100
commitbb29f044aa967831cd664c54eba0de0c701436ce (patch)
tree1398cc9780bbae0fdad071a3a3765a571c3f6d7b /lisp/eshell
parent3c935a7e996701244d166f684119f0ff97e25496 (diff)
parent5e605a2e528955721fc6f2bd7b9f174c15075fb1 (diff)
downloademacs-bb29f044aa967831cd664c54eba0de0c701436ce.tar.gz
emacs-bb29f044aa967831cd664c54eba0de0c701436ce.tar.bz2
emacs-bb29f044aa967831cd664c54eba0de0c701436ce.zip
upstream i think
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/em-hist.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index db5e98062a9..5e44e541526 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -90,12 +90,14 @@
"If non-nil, name of the file to read/write input history.
See also `eshell-read-history' and `eshell-write-history'.
If it is nil, Eshell will use the value of HISTFILE."
- :type 'file
+ :type '(choice (const :tag "Use HISTFILE" nil)
+ file)
:group 'eshell-hist)
(defcustom eshell-history-size 128
"Size of the input history ring. If nil, use envvar HISTSIZE."
- :type 'integer
+ :type '(choice (const :tag "Use HISTSIZE" nil)
+ integer)
:group 'eshell-hist)
(defcustom eshell-hist-ignoredups nil
@@ -261,7 +263,13 @@ element, regardless of any text on the command line. In that case,
(make-local-variable 'eshell-history-size)
(or eshell-history-size
- (setq eshell-history-size (getenv "HISTSIZE")))
+ (let ((hsize (getenv "HISTSIZE")))
+ (setq eshell-history-size
+ (if (and (stringp hsize)
+ (integerp (setq hsize (string-to-number hsize)))
+ (> hsize 0))
+ hsize
+ 128))))
(make-local-variable 'eshell-history-file-name)
(or eshell-history-file-name