aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
authorKenichi Handa2012-07-17 07:09:08 +0900
committerKenichi Handa2012-07-17 07:09:08 +0900
commit8c536f15bf95916d56bb50495d22b7da7e09fff9 (patch)
treeac6f8bf5103bdbd1d6a75f05def9bc7aa9e96547 /lisp/eshell
parent21a8caaa4af24f258e6c7f80c1fc913b00aee044 (diff)
parentc05cf3902ae658cc8bf413124245c9e1cdcca2d7 (diff)
downloademacs-8c536f15bf95916d56bb50495d22b7da7e09fff9.tar.gz
emacs-8c536f15bf95916d56bb50495d22b7da7e09fff9.zip
merge trunk
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/esh-mode.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 74320538fe9..9da3f8e2e79 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -193,11 +193,14 @@ This is used by `eshell-watch-for-password-prompt'."
193 :type '(choice (const nil) function) 193 :type '(choice (const nil) function)
194 :group 'eshell-mode) 194 :group 'eshell-mode)
195 195
196(defcustom eshell-status-in-modeline t 196(defcustom eshell-status-in-mode-line t
197 "If non-nil, let the user know a command is running in the modeline." 197 "If non-nil, let the user know a command is running in the mode line."
198 :type 'boolean 198 :type 'boolean
199 :group 'eshell-mode) 199 :group 'eshell-mode)
200 200
201(define-obsolete-variable-alias 'eshell-status-in-modeline
202 'eshell-status-in-mode-line "24.2")
203
201(defvar eshell-first-time-p t 204(defvar eshell-first-time-p t
202 "A variable which is non-nil the first time Eshell is loaded.") 205 "A variable which is non-nil the first time Eshell is loaded.")
203 206
@@ -314,14 +317,14 @@ and the hook `eshell-exit-hook'."
314 (setq eshell-mode-map (make-sparse-keymap)) 317 (setq eshell-mode-map (make-sparse-keymap))
315 (use-local-map eshell-mode-map) 318 (use-local-map eshell-mode-map)
316 319
317 (when eshell-status-in-modeline 320 (when eshell-status-in-mode-line
318 (make-local-variable 'eshell-command-running-string) 321 (make-local-variable 'eshell-command-running-string)
319 (let ((fmt (copy-sequence mode-line-format))) 322 (let ((fmt (copy-sequence mode-line-format)))
320 (make-local-variable 'mode-line-format) 323 (make-local-variable 'mode-line-format)
321 (setq mode-line-format fmt)) 324 (setq mode-line-format fmt))
322 (let ((modeline (memq 'mode-line-modified mode-line-format))) 325 (let ((mode-line-elt (memq 'mode-line-modified mode-line-format)))
323 (if modeline 326 (if mode-line-elt
324 (setcar modeline 'eshell-command-running-string)))) 327 (setcar mode-line-elt 'eshell-command-running-string))))
325 328
326 (define-key eshell-mode-map [return] 'eshell-send-input) 329 (define-key eshell-mode-map [return] 'eshell-send-input)
327 (define-key eshell-mode-map [(control ?m)] 'eshell-send-input) 330 (define-key eshell-mode-map [(control ?m)] 'eshell-send-input)
@@ -434,7 +437,7 @@ and the hook `eshell-exit-hook'."
434 (when eshell-scroll-show-maximum-output 437 (when eshell-scroll-show-maximum-output
435 (set (make-local-variable 'scroll-conservatively) 1000)) 438 (set (make-local-variable 'scroll-conservatively) 1000))
436 439
437 (when eshell-status-in-modeline 440 (when eshell-status-in-mode-line
438 (add-hook 'eshell-pre-command-hook 'eshell-command-started nil t) 441 (add-hook 'eshell-pre-command-hook 'eshell-command-started nil t)
439 (add-hook 'eshell-post-command-hook 'eshell-command-finished nil t)) 442 (add-hook 'eshell-post-command-hook 'eshell-command-finished nil t))
440 443
@@ -448,12 +451,12 @@ and the hook `eshell-exit-hook'."
448(put 'eshell-mode 'mode-class 'special) 451(put 'eshell-mode 'mode-class 'special)
449 452
450(defun eshell-command-started () 453(defun eshell-command-started ()
451 "Indicate in the modeline that a command has started." 454 "Indicate in the mode line that a command has started."
452 (setq eshell-command-running-string "**") 455 (setq eshell-command-running-string "**")
453 (force-mode-line-update)) 456 (force-mode-line-update))
454 457
455(defun eshell-command-finished () 458(defun eshell-command-finished ()
456 "Indicate in the modeline that a command has finished." 459 "Indicate in the mode line that a command has finished."
457 (setq eshell-command-running-string "--") 460 (setq eshell-command-running-string "--")
458 (force-mode-line-update)) 461 (force-mode-line-update))
459 462