]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove some unnecessary bindings of same-window-* variables.
authorChong Yidong <cyd@gnu.org>
Fri, 10 Aug 2012 16:46:07 +0000 (00:46 +0800)
committerChong Yidong <cyd@gnu.org>
Fri, 10 Aug 2012 16:46:07 +0000 (00:46 +0800)
* 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.

lisp/ChangeLog
lisp/eshell/eshell.el
lisp/progmodes/python.el

index b6649d4b37db42dcadbf804a9a21392114c14bcb..bc270b8bdb25608fe1a68e84edf3f680c2856ae8 100644 (file)
@@ -1,3 +1,13 @@
+2012-08-10  Chong Yidong  <cyd@gnu.org>
+
+       * progmodes/python.el (python-shell-get-process-name): Don't mess
+       with same-window-buffer-names.
+
+       * 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.
+
 2012-08-10  Chong Yidong  <cyd@gnu.org>
 
        * bindings.el: Bind M-= back to count-words-region.
index a1717756696b5749bcf2a2ef4f52c99aa7798e52..2d5dc2acf0529b60d3779f8e06cf58587d29beb9 100644 (file)
@@ -241,37 +241,31 @@ 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'."
   (add-to-list 'same-window-buffer-names eshell-buffer-name))
+(make-obsolete 'eshell-add-to-window-buffer-names
+              "no longer needed." "24.2")
 
-(defsubst eshell-remove-from-window-buffer-names ()
+(defun eshell-remove-from-window-buffer-names ()
   "Remove `eshell-buffer-name' from `same-window-buffer-names'."
   (setq same-window-buffer-names
        (delete eshell-buffer-name same-window-buffer-names)))
+(make-obsolete 'eshell-remove-from-window-buffer-names
+              "no longer needed." "24.2")
 
 (defcustom eshell-load-hook nil
   "A hook run once Eshell has been loaded."
   :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 +301,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))
index 310bb8d3f669a2b11f5d7d37747e86d43a0bac57..f695d747483accda853976ea62df7a5cce00a35e 100644 (file)
@@ -1549,16 +1549,12 @@ virtualenv."
 If DEDICATED is t and the variable `buffer-file-name' is non-nil
 returns a string with the form
 `python-shell-buffer-name'[variable `buffer-file-name'] else
-returns the value of `python-shell-buffer-name'.  After
-calculating the process name adds the buffer name for the process
-in the `same-window-buffer-names' list."
+returns the value of `python-shell-buffer-name'."
   (let ((process-name
          (if (and dedicated
                   buffer-file-name)
              (format "%s[%s]" python-shell-buffer-name buffer-file-name)
            (format "%s" python-shell-buffer-name))))
-    (add-to-list 'same-window-buffer-names (purecopy
-                                            (format "*%s*" process-name)))
     process-name))
 
 (defun python-shell-internal-get-process-name ()