X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/a464a6c73acf27b0d633d428919a36bc16a9d442..ab422c4d6899b1442cb6954c1829c1fb656b006c:/lisp/eshell/eshell.el diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index a171775669..a76adb1fd9 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -1,6 +1,6 @@ ;;; eshell.el --- the Emacs command shell -;; Copyright (C) 1999-2012 Free Software Foundation, Inc. +;; Copyright (C) 1999-2013 Free Software Foundation, Inc. ;; Author: John Wiegley ;; Version: 2.4.2 @@ -241,12 +241,14 @@ shells such as bash, zsh, rc, 4dos." ;; The following user options modify the behavior of Eshell overall. (defvar eshell-buffer-name) -(defsubst eshell-add-to-window-buffer-names () +(defun eshell-add-to-window-buffer-names () "Add `eshell-buffer-name' to `same-window-buffer-names'." + (declare (obsolete nil "24.3")) (add-to-list 'same-window-buffer-names eshell-buffer-name)) -(defsubst eshell-remove-from-window-buffer-names () +(defun eshell-remove-from-window-buffer-names () "Remove `eshell-buffer-name' from `same-window-buffer-names'." + (declare (obsolete nil "24.3")) (setq same-window-buffer-names (delete eshell-buffer-name same-window-buffer-names))) @@ -255,23 +257,13 @@ shells such as bash, zsh, rc, 4dos." :type 'hook :group 'eshell) -(defcustom eshell-unload-hook - '(eshell-remove-from-window-buffer-names - eshell-unload-all-modules) +(defcustom eshell-unload-hook '(eshell-unload-all-modules) "A hook run when Eshell is unloaded from memory." :type 'hook :group 'eshell) (defcustom eshell-buffer-name "*eshell*" "The basename used for Eshell buffers." - :set (lambda (symbol value) - ;; remove the old value of `eshell-buffer-name', if present - (if (boundp 'eshell-buffer-name) - (eshell-remove-from-window-buffer-names)) - (set symbol value) - ;; add the new value - (eshell-add-to-window-buffer-names) - value) :type 'string :group 'eshell) @@ -307,13 +299,8 @@ buffer selected (or created)." (generate-new-buffer eshell-buffer-name)) (t (get-buffer-create eshell-buffer-name))))) - ;; Simply calling `pop-to-buffer' will not mimic the way that - ;; shell-mode buffers appear, since they always reuse the same - ;; window that that command was invoked from. To achieve this, - ;; it's necessary to add `eshell-buffer-name' to the variable - ;; `same-window-buffer-names', which is done when Eshell is loaded (cl-assert (and buf (buffer-live-p buf))) - (pop-to-buffer buf) + (pop-to-buffer-same-window buf) (unless (eq major-mode 'eshell-mode) (eshell-mode)) buf))