emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r106705: Restore Emacs 23 handling of


From: martin rudalics
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106705: Restore Emacs 23 handling of display-buffer's BUFFER-OR-NAME argument.
Date: Tue, 20 Dec 2011 08:45:20 +0100
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106705
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Tue 2011-12-20 08:45:20 +0100
message:
  Restore Emacs 23 handling of display-buffer's BUFFER-OR-NAME argument.
  
  * window.el (window-normalize-buffer-to-display): Remove.
  (display-buffer): Handle buffer-or-name argument as in Emacs 23.
modified:
  lisp/ChangeLog
  lisp/window.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-12-19 15:46:50 +0000
+++ b/lisp/ChangeLog    2011-12-20 07:45:20 +0000
@@ -1,3 +1,8 @@
+2011-12-20  Martin Rudalics  <address@hidden>
+
+       * window.el (window-normalize-buffer-to-display): Remove.
+       (display-buffer): Handle buffer-or-name argument as in Emacs 23.
+
 2011-12-19  Chong Yidong  <address@hidden>
 
        * vc/vc-dir.el (vc-dir-parent-marked-p, vc-dir-children-marked-p):

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2011-12-17 06:51:13 +0000
+++ b/lisp/window.el    2011-12-20 07:45:20 +0000
@@ -4526,19 +4526,6 @@
 The actual non-nil value of this variable will be copied to the
 `window-dedicated-p' flag.")
 
-(defun window-normalize-buffer-to-display (buffer-or-name)
-  "Normalize BUFFER-OR-NAME argument for buffer display functions.
-If BUFFER-OR-NAME is nil, return the current buffer.  Else, if a
-buffer specified by BUFFER-OR-NAME exists, return that buffer.
-If no such buffer exists, create a buffer with the name
-BUFFER-OR-NAME and return that buffer."
-  (if buffer-or-name
-      (or (get-buffer buffer-or-name)
-         (let ((buffer (get-buffer-create buffer-or-name)))
-           (set-buffer-major-mode buffer)
-           buffer))
-    (current-buffer)))
-
 (defconst display-buffer--action-function-custom-type
   '(choice :tag "Function"
           (const :tag "--" ignore) ; default for insertion
@@ -4640,7 +4627,7 @@
   "A `display-buffer' action for displaying in another frame.")
 (put 'display-buffer--other-frame-action 'risky-local-variable t)
 
-(defun display-buffer (&optional buffer-or-name action frame)
+(defun display-buffer (buffer-or-name &optional action frame)
   "Display BUFFER-OR-NAME in some window, without selecting it.
 BUFFER-OR-NAME must be a buffer or the name of an existing
 buffer.  Return the window chosen for displaying BUFFER-OR-NAME,
@@ -4688,7 +4675,9 @@
 `display-buffer-reuse-window'."
   (interactive (list (read-buffer "Display buffer: " (other-buffer))
                     (if current-prefix-arg t)))
-  (let ((buffer (window-normalize-buffer-to-display buffer-or-name))
+  (let ((buffer (if (bufferp buffer-or-name)
+                   buffer-or-name
+                 (get-buffer buffer-or-name)))
        ;; Handle the old form of the first argument.
        (inhibit-same-window (and action (not (listp action)))))
     (unless (listp action) (setq action nil))


reply via email to

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