aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
authorKenichi Handa2012-08-16 21:25:17 +0900
committerKenichi Handa2012-08-16 21:25:17 +0900
commitd75ffb4ed0b2e72a9361a07d16a5c884a9459728 (patch)
tree8ac5a6a8ae033fef7fbc7fb7b09a703ef4b0ed5b /lisp/eshell
parent69c41c4070c86baac11a627e9c3d366420aeb7cc (diff)
parent250c8ab9b8f6322959fa3122db83944c30c3894b (diff)
downloademacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.tar.gz
emacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.zip
merge trunk
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/esh-ext.el23
-rw-r--r--lisp/eshell/esh-mode.el2
-rw-r--r--lisp/eshell/eshell.el27
3 files changed, 18 insertions, 34 deletions
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index 603da6f2e30..52df1587d5f 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -226,20 +226,15 @@ causing the user to wonder if anything's really going on..."
226Adds the given PATH to $PATH.") 226Adds the given PATH to $PATH.")
227 (if args 227 (if args
228 (progn 228 (progn
229 (if prepend 229 (setq eshell-path-env (getenv "PATH")
230 (setq args (nreverse args))) 230 args (mapconcat 'identity args path-separator)
231 (while args 231 eshell-path-env
232 (setenv "PATH" 232 (if prepend
233 (if prepend 233 (concat args path-separator eshell-path-env)
234 (concat (car args) path-separator 234 (concat eshell-path-env path-separator args)))
235 (getenv "PATH")) 235 (setenv "PATH" eshell-path-env))
236 (concat (getenv "PATH") path-separator 236 (dolist (dir (parse-colon-path (getenv "PATH")))
237 (car args)))) 237 (eshell-printn dir)))))
238 (setq args (cdr args))))
239 (let ((paths (parse-colon-path (getenv "PATH"))))
240 (while paths
241 (eshell-printn (car paths))
242 (setq paths (cdr paths)))))))
243 238
244(put 'eshell/addpath 'eshell-no-numeric-conversions t) 239(put 'eshell/addpath 'eshell-no-numeric-conversions t)
245 240
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 9da3f8e2e79..8a9107e5470 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -199,7 +199,7 @@ This is used by `eshell-watch-for-password-prompt'."
199 :group 'eshell-mode) 199 :group 'eshell-mode)
200 200
201(define-obsolete-variable-alias 'eshell-status-in-modeline 201(define-obsolete-variable-alias 'eshell-status-in-modeline
202 'eshell-status-in-mode-line "24.2") 202 'eshell-status-in-mode-line "24.3")
203 203
204(defvar eshell-first-time-p t 204(defvar eshell-first-time-p t
205 "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.")
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index a1717756696..c663de3f40d 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -241,37 +241,31 @@ shells such as bash, zsh, rc, 4dos."
241;; The following user options modify the behavior of Eshell overall. 241;; The following user options modify the behavior of Eshell overall.
242(defvar eshell-buffer-name) 242(defvar eshell-buffer-name)
243 243
244(defsubst eshell-add-to-window-buffer-names () 244(defun eshell-add-to-window-buffer-names ()
245 "Add `eshell-buffer-name' to `same-window-buffer-names'." 245 "Add `eshell-buffer-name' to `same-window-buffer-names'."
246 (add-to-list 'same-window-buffer-names eshell-buffer-name)) 246 (add-to-list 'same-window-buffer-names eshell-buffer-name))
247(make-obsolete 'eshell-add-to-window-buffer-names
248 "no longer needed." "24.3")
247 249
248(defsubst eshell-remove-from-window-buffer-names () 250(defun eshell-remove-from-window-buffer-names ()
249 "Remove `eshell-buffer-name' from `same-window-buffer-names'." 251 "Remove `eshell-buffer-name' from `same-window-buffer-names'."
250 (setq same-window-buffer-names 252 (setq same-window-buffer-names
251 (delete eshell-buffer-name same-window-buffer-names))) 253 (delete eshell-buffer-name same-window-buffer-names)))
254(make-obsolete 'eshell-remove-from-window-buffer-names
255 "no longer needed." "24.3")
252 256
253(defcustom eshell-load-hook nil 257(defcustom eshell-load-hook nil
254 "A hook run once Eshell has been loaded." 258 "A hook run once Eshell has been loaded."
255 :type 'hook 259 :type 'hook
256 :group 'eshell) 260 :group 'eshell)
257 261
258(defcustom eshell-unload-hook 262(defcustom eshell-unload-hook '(eshell-unload-all-modules)
259 '(eshell-remove-from-window-buffer-names
260 eshell-unload-all-modules)
261 "A hook run when Eshell is unloaded from memory." 263 "A hook run when Eshell is unloaded from memory."
262 :type 'hook 264 :type 'hook
263 :group 'eshell) 265 :group 'eshell)
264 266
265(defcustom eshell-buffer-name "*eshell*" 267(defcustom eshell-buffer-name "*eshell*"
266 "The basename used for Eshell buffers." 268 "The basename used for Eshell buffers."
267 :set (lambda (symbol value)
268 ;; remove the old value of `eshell-buffer-name', if present
269 (if (boundp 'eshell-buffer-name)
270 (eshell-remove-from-window-buffer-names))
271 (set symbol value)
272 ;; add the new value
273 (eshell-add-to-window-buffer-names)
274 value)
275 :type 'string 269 :type 'string
276 :group 'eshell) 270 :group 'eshell)
277 271
@@ -307,13 +301,8 @@ buffer selected (or created)."
307 (generate-new-buffer eshell-buffer-name)) 301 (generate-new-buffer eshell-buffer-name))
308 (t 302 (t
309 (get-buffer-create eshell-buffer-name))))) 303 (get-buffer-create eshell-buffer-name)))))
310 ;; Simply calling `pop-to-buffer' will not mimic the way that
311 ;; shell-mode buffers appear, since they always reuse the same
312 ;; window that that command was invoked from. To achieve this,
313 ;; it's necessary to add `eshell-buffer-name' to the variable
314 ;; `same-window-buffer-names', which is done when Eshell is loaded
315 (cl-assert (and buf (buffer-live-p buf))) 304 (cl-assert (and buf (buffer-live-p buf)))
316 (pop-to-buffer buf) 305 (pop-to-buffer-same-window buf)
317 (unless (eq major-mode 'eshell-mode) 306 (unless (eq major-mode 'eshell-mode)
318 (eshell-mode)) 307 (eshell-mode))
319 buf)) 308 buf))