comparison lisp/eshell/em-hist.el @ 49266:f4d32be2d504

(eshell-save-history-on-exit): Renamed `eshell-ask-to-save-history' to `eshell-save-history-on-exit', because the former name is somewhat unrelated to the variables' possible values.
author John Wiegley <johnw@newartisans.com>
date Wed, 15 Jan 2003 16:06:49 +0000
parents 6eb625bead4f
children 695cf19ef79e d7ddb3e565de
comparison
equal deleted inserted replaced
49265:35062135291a 49266:f4d32be2d504
102 "*If non-nil, don't add input matching the last on the input ring. 102 "*If non-nil, don't add input matching the last on the input ring.
103 This mirrors the optional behavior of bash." 103 This mirrors the optional behavior of bash."
104 :type 'boolean 104 :type 'boolean
105 :group 'eshell-hist) 105 :group 'eshell-hist)
106 106
107 (defcustom eshell-ask-to-save-history t 107 (defcustom eshell-save-history-on-exit 'ask
108 "*Determine if history should be automatically saved. 108 "*Determine if history should be automatically saved.
109 History is always preserved after sanely exiting an Eshell buffer. 109 History is always preserved after sanely exiting an Eshell buffer.
110 However, when Emacs is being shut down, this variable determines 110 However, when Emacs is being shut down, this variable determines
111 whether to prompt the user. 111 whether to prompt the user.
112 If set to nil, it means never ask whether history should be saved. 112 If set to nil, it means never save history on termination of Emacs.
113 If set to t, always ask if any Eshell buffers are open at exit time. 113 If set to `ask', ask if any Eshell buffers are open at exit time.
114 If set to `always', history will always be saved, silently." 114 If set to t, history will always be saved, silently."
115 :type '(choice (const :tag "Never" nil) 115 :type '(choice (const :tag "Never" nil)
116 (const :tag "Ask" t) 116 (const :tag "Ask" ask)
117 (const :tag "Always save" always)) 117 (const :tag "Always save" t))
118 :group 'eshell-hist) 118 :group 'eshell-hist)
119 119
120 (defcustom eshell-input-filter 120 (defcustom eshell-input-filter
121 (function 121 (function
122 (lambda (str) 122 (lambda (str)
267 267
268 (make-local-variable 'eshell-history-index) 268 (make-local-variable 'eshell-history-index)
269 (make-local-variable 'eshell-save-history-index) 269 (make-local-variable 'eshell-save-history-index)
270 270
271 (if (minibuffer-window-active-p (selected-window)) 271 (if (minibuffer-window-active-p (selected-window))
272 (set (make-local-variable 'eshell-ask-to-save-history) nil) 272 (set (make-local-variable 'eshell-save-history-on-exit) nil)
273 (set (make-local-variable 'eshell-history-ring) nil) 273 (set (make-local-variable 'eshell-history-ring) nil)
274 (if eshell-history-file-name 274 (if eshell-history-file-name
275 (eshell-read-history nil t)) 275 (eshell-read-history nil t))
276 276
277 (add-hook 'eshell-exit-hook 'eshell-write-history nil t)) 277 (add-hook 'eshell-exit-hook 'eshell-write-history nil t))
294 (eshell-for buf (buffer-list) 294 (eshell-for buf (buffer-list)
295 (if (buffer-live-p buf) 295 (if (buffer-live-p buf)
296 (with-current-buffer buf 296 (with-current-buffer buf
297 (if (and eshell-mode 297 (if (and eshell-mode
298 eshell-history-file-name 298 eshell-history-file-name
299 eshell-ask-to-save-history 299 eshell-save-history-on-exit
300 (or (eq eshell-ask-to-save-history 'always) 300 (or (eq eshell-save-history-on-exit t)
301 (y-or-n-p 301 (y-or-n-p
302 (format "Save input history for Eshell buffer `%s'? " 302 (format "Save input history for Eshell buffer `%s'? "
303 (buffer-name buf))))) 303 (buffer-name buf)))))
304 (eshell-write-history)))))) 304 (eshell-write-history))))))
305 305