aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/eshell
diff options
context:
space:
mode:
authorChong Yidong2012-08-11 00:46:07 +0800
committerChong Yidong2012-08-11 00:46:07 +0800
commit1530c98e56d331a21ba7ef2c940d1441442ac798 (patch)
tree5503314233c9961630b0198516a2b9516d8027f8 /lisp/eshell
parente1293765d95660fc7f2cf0fcb28026d1efa592df (diff)
downloademacs-1530c98e56d331a21ba7ef2c940d1441442ac798.tar.gz
emacs-1530c98e56d331a21ba7ef2c940d1441442ac798.zip
Remove some unnecessary bindings of same-window-* variables.
* lisp/progmodes/python.el (python-shell-get-process-name): Don't mess with same-window-buffer-names. * lisp/eshell/eshell.el (eshell-add-to-window-buffer-names) (eshell-remove-from-window-buffer-names): Make obsolete. (eshell-buffer-name, eshell-unload-hook): Don't use them. (eshell): Just use pop-to-buffer-same-window instead.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/eshell.el27
1 files changed, 8 insertions, 19 deletions
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index a1717756696..2d5dc2acf05 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.2")
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.2")
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))