diff options
| author | Martin Rudalics | 2011-12-20 08:45:20 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2011-12-20 08:45:20 +0100 |
| commit | d45ba96b43300ffc391b5c8f4effe41472d31f6b (patch) | |
| tree | 2f3acd59b05bf0b8d6e721adab8ee2b1b7cc10a6 | |
| parent | 2edef1a0a6809d182d0003fe0413dfcb86ae47b6 (diff) | |
| download | emacs-d45ba96b43300ffc391b5c8f4effe41472d31f6b.tar.gz emacs-d45ba96b43300ffc391b5c8f4effe41472d31f6b.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/window.el | 19 |
2 files changed, 9 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7e583f2bbc6..01c03c2baf6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-12-20 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (window-normalize-buffer-to-display): Remove. | ||
| 4 | (display-buffer): Handle buffer-or-name argument as in Emacs 23. | ||
| 5 | |||
| 1 | 2011-12-19 Chong Yidong <cyd@gnu.org> | 6 | 2011-12-19 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * vc/vc-dir.el (vc-dir-parent-marked-p, vc-dir-children-marked-p): | 8 | * vc/vc-dir.el (vc-dir-parent-marked-p, vc-dir-children-marked-p): |
diff --git a/lisp/window.el b/lisp/window.el index 8fbc8b8ace4..16a38ca03c6 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -4526,19 +4526,6 @@ Return WINDOW." | |||
| 4526 | The actual non-nil value of this variable will be copied to the | 4526 | The actual non-nil value of this variable will be copied to the |
| 4527 | `window-dedicated-p' flag.") | 4527 | `window-dedicated-p' flag.") |
| 4528 | 4528 | ||
| 4529 | (defun window-normalize-buffer-to-display (buffer-or-name) | ||
| 4530 | "Normalize BUFFER-OR-NAME argument for buffer display functions. | ||
| 4531 | If BUFFER-OR-NAME is nil, return the current buffer. Else, if a | ||
| 4532 | buffer specified by BUFFER-OR-NAME exists, return that buffer. | ||
| 4533 | If no such buffer exists, create a buffer with the name | ||
| 4534 | BUFFER-OR-NAME and return that buffer." | ||
| 4535 | (if buffer-or-name | ||
| 4536 | (or (get-buffer buffer-or-name) | ||
| 4537 | (let ((buffer (get-buffer-create buffer-or-name))) | ||
| 4538 | (set-buffer-major-mode buffer) | ||
| 4539 | buffer)) | ||
| 4540 | (current-buffer))) | ||
| 4541 | |||
| 4542 | (defconst display-buffer--action-function-custom-type | 4529 | (defconst display-buffer--action-function-custom-type |
| 4543 | '(choice :tag "Function" | 4530 | '(choice :tag "Function" |
| 4544 | (const :tag "--" ignore) ; default for insertion | 4531 | (const :tag "--" ignore) ; default for insertion |
| @@ -4640,7 +4627,7 @@ specified, e.g. by the user options `display-buffer-alist' or | |||
| 4640 | "A `display-buffer' action for displaying in another frame.") | 4627 | "A `display-buffer' action for displaying in another frame.") |
| 4641 | (put 'display-buffer--other-frame-action 'risky-local-variable t) | 4628 | (put 'display-buffer--other-frame-action 'risky-local-variable t) |
| 4642 | 4629 | ||
| 4643 | (defun display-buffer (&optional buffer-or-name action frame) | 4630 | (defun display-buffer (buffer-or-name &optional action frame) |
| 4644 | "Display BUFFER-OR-NAME in some window, without selecting it. | 4631 | "Display BUFFER-OR-NAME in some window, without selecting it. |
| 4645 | BUFFER-OR-NAME must be a buffer or the name of an existing | 4632 | BUFFER-OR-NAME must be a buffer or the name of an existing |
| 4646 | buffer. Return the window chosen for displaying BUFFER-OR-NAME, | 4633 | buffer. Return the window chosen for displaying BUFFER-OR-NAME, |
| @@ -4688,7 +4675,9 @@ search for a window that is already displaying the buffer. See | |||
| 4688 | `display-buffer-reuse-window'." | 4675 | `display-buffer-reuse-window'." |
| 4689 | (interactive (list (read-buffer "Display buffer: " (other-buffer)) | 4676 | (interactive (list (read-buffer "Display buffer: " (other-buffer)) |
| 4690 | (if current-prefix-arg t))) | 4677 | (if current-prefix-arg t))) |
| 4691 | (let ((buffer (window-normalize-buffer-to-display buffer-or-name)) | 4678 | (let ((buffer (if (bufferp buffer-or-name) |
| 4679 | buffer-or-name | ||
| 4680 | (get-buffer buffer-or-name))) | ||
| 4692 | ;; Handle the old form of the first argument. | 4681 | ;; Handle the old form of the first argument. |
| 4693 | (inhibit-same-window (and action (not (listp action))))) | 4682 | (inhibit-same-window (and action (not (listp action))))) |
| 4694 | (unless (listp action) (setq action nil)) | 4683 | (unless (listp action) (setq action nil)) |