emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r109555: Remove some unnecessary bind


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109555: Remove some unnecessary bindings of same-window-* variables.
Date: Sat, 11 Aug 2012 00:46:07 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109555
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-08-11 00:46:07 +0800
message:
  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.
modified:
  lisp/ChangeLog
  lisp/eshell/eshell.el
  lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-08-10 16:02:48 +0000
+++ b/lisp/ChangeLog    2012-08-10 16:46:07 +0000
@@ -1,5 +1,15 @@
 2012-08-10  Chong Yidong  <address@hidden>
 
+       * 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  <address@hidden>
+
        * bindings.el: Bind M-= back to count-words-region.
 
        * simple.el (count-words-region): Accept a prefix arg for acting

=== modified file 'lisp/eshell/eshell.el'
--- a/lisp/eshell/eshell.el     2012-07-11 23:13:41 +0000
+++ b/lisp/eshell/eshell.el     2012-08-10 16:46:07 +0000
@@ -241,37 +241,31 @@
 ;; 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 @@
                    (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))

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2012-08-09 04:08:29 +0000
+++ b/lisp/progmodes/python.el  2012-08-10 16:46:07 +0000
@@ -1549,16 +1549,12 @@
 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 ()


reply via email to

[Prev in Thread] Current Thread [Next in Thread]