diff options
| author | Stefan Monnier | 2011-11-07 21:57:59 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2011-11-07 21:57:59 -0500 |
| commit | 0a9f9ab528d1b73d033e2cd93e89e6f42e6ad132 (patch) | |
| tree | d402346e474433e4c1703f2d929f8a22f825a824 | |
| parent | a769dd157dfa40b365600e043b56172036110254 (diff) | |
| download | emacs-0a9f9ab528d1b73d033e2cd93e89e6f42e6ad132.tar.gz emacs-0a9f9ab528d1b73d033e2cd93e89e6f42e6ad132.zip | |
* lisp/window.el: Make special-display like display-buffer-alist.
(display-buffer--special-action): New function, morphed
from display-buffer--special.
(display-buffer): Use it to handle special-display-buffers at higher
priority (just after display-buffer-alist).
(display-buffer-fallback-action, display-buffer--other-frame-action)
(pop-to-buffer-same-window): Remove display-buffer--special.
Fixes: debbugs:9532
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/window.el | 22 |
2 files changed, 21 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2802116dee4..28e3f79ba6e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-11-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * window.el: Make special-display like display-buffer-alist (bug#9532). | ||
| 4 | (display-buffer--special-action): New function, morphed | ||
| 5 | from display-buffer--special. | ||
| 6 | (display-buffer): Use it to handle special-display-buffers at higher | ||
| 7 | priority (just after display-buffer-alist). | ||
| 8 | (display-buffer-fallback-action, display-buffer--other-frame-action) | ||
| 9 | (pop-to-buffer-same-window): Remove display-buffer--special. | ||
| 10 | |||
| 1 | 2011-11-07 Glenn Morris <rgm@gnu.org> | 11 | 2011-11-07 Glenn Morris <rgm@gnu.org> |
| 2 | 12 | ||
| 3 | * calendar/cal-menu.el (cal-menu-set-date-title): | 13 | * calendar/cal-menu.el (cal-menu-set-date-title): |
diff --git a/lisp/window.el b/lisp/window.el index 2f4988b8b39..931d265ebab 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -4625,9 +4625,8 @@ See `display-buffer' for details." | |||
| 4625 | :group 'windows) | 4625 | :group 'windows) |
| 4626 | 4626 | ||
| 4627 | (defconst display-buffer-fallback-action | 4627 | (defconst display-buffer-fallback-action |
| 4628 | '((display-buffer--maybe-same-window | 4628 | '((display-buffer--maybe-same-window ;FIXME: why isn't this redundant? |
| 4629 | display-buffer-reuse-window | 4629 | display-buffer-reuse-window |
| 4630 | display-buffer--special | ||
| 4631 | display-buffer--maybe-pop-up-frame-or-window | 4630 | display-buffer--maybe-pop-up-frame-or-window |
| 4632 | display-buffer-use-some-window | 4631 | display-buffer-use-some-window |
| 4633 | ;; If all else fails, pop up a new frame. | 4632 | ;; If all else fails, pop up a new frame. |
| @@ -4658,7 +4657,6 @@ specified, e.g. by the user options `display-buffer-alist' or | |||
| 4658 | 4657 | ||
| 4659 | (defvar display-buffer--other-frame-action | 4658 | (defvar display-buffer--other-frame-action |
| 4660 | '((display-buffer-reuse-window | 4659 | '((display-buffer-reuse-window |
| 4661 | display-buffer--special | ||
| 4662 | display-buffer-pop-up-frame) | 4660 | display-buffer-pop-up-frame) |
| 4663 | (reusable-frames . 0) | 4661 | (reusable-frames . 0) |
| 4664 | (inhibit-same-window . t)) | 4662 | (inhibit-same-window . t)) |
| @@ -4724,6 +4722,7 @@ search for a window that is already displaying the buffer. See | |||
| 4724 | (let* ((user-action | 4722 | (let* ((user-action |
| 4725 | (display-buffer-assq-regexp (buffer-name buffer) | 4723 | (display-buffer-assq-regexp (buffer-name buffer) |
| 4726 | display-buffer-alist)) | 4724 | display-buffer-alist)) |
| 4725 | (special-action (display-buffer--special-action buffer)) | ||
| 4727 | ;; Extra actions from the arguments to this function: | 4726 | ;; Extra actions from the arguments to this function: |
| 4728 | (extra-action | 4727 | (extra-action |
| 4729 | (cons nil (append (if inhibit-same-window | 4728 | (cons nil (append (if inhibit-same-window |
| @@ -4732,7 +4731,7 @@ search for a window that is already displaying the buffer. See | |||
| 4732 | `((reusable-frames . ,frame)))))) | 4731 | `((reusable-frames . ,frame)))))) |
| 4733 | ;; Construct action function list and action alist. | 4732 | ;; Construct action function list and action alist. |
| 4734 | (actions (list display-buffer-overriding-action | 4733 | (actions (list display-buffer-overriding-action |
| 4735 | user-action action extra-action | 4734 | user-action special-action action extra-action |
| 4736 | display-buffer-base-action | 4735 | display-buffer-base-action |
| 4737 | display-buffer-fallback-action)) | 4736 | display-buffer-fallback-action)) |
| 4738 | (functions (apply 'append | 4737 | (functions (apply 'append |
| @@ -4815,7 +4814,7 @@ terminal if either of those variables is non-nil." | |||
| 4815 | (display-buffer-record-window 'reuse window buffer) | 4814 | (display-buffer-record-window 'reuse window buffer) |
| 4816 | (window--display-buffer-1 window)))) | 4815 | (window--display-buffer-1 window)))) |
| 4817 | 4816 | ||
| 4818 | (defun display-buffer--special (buffer alist) | 4817 | (defun display-buffer--special-action (buffer) |
| 4819 | "Try to display BUFFER using `special-display-function'. | 4818 | "Try to display BUFFER using `special-display-function'. |
| 4820 | Call `special-display-p' on BUFFER's name, and if that returns | 4819 | Call `special-display-p' on BUFFER's name, and if that returns |
| 4821 | non-nil, call `special-display-function' on BUFFER." | 4820 | non-nil, call `special-display-function' on BUFFER." |
| @@ -4824,8 +4823,10 @@ non-nil, call `special-display-function' on BUFFER." | |||
| 4824 | ;; parameters to pass to `special-display-function'. | 4823 | ;; parameters to pass to `special-display-function'. |
| 4825 | (let ((pars (special-display-p (buffer-name buffer)))) | 4824 | (let ((pars (special-display-p (buffer-name buffer)))) |
| 4826 | (when pars | 4825 | (when pars |
| 4827 | (funcall special-display-function | 4826 | (list (list #'display-buffer-reuse-window |
| 4828 | buffer (if (listp pars) pars)))))) | 4827 | `(lambda (buffer _alist) |
| 4828 | (funcall special-display-function | ||
| 4829 | buffer ',(if (listp pars) pars))))))))) | ||
| 4829 | 4830 | ||
| 4830 | (defun display-buffer-pop-up-frame (buffer alist) | 4831 | (defun display-buffer-pop-up-frame (buffer alist) |
| 4831 | "Display BUFFER in a new frame. | 4832 | "Display BUFFER in a new frame. |
| @@ -4973,8 +4974,7 @@ the buffer. | |||
| 4973 | NORECORD, if non-nil means do not put this buffer at the front of | 4974 | NORECORD, if non-nil means do not put this buffer at the front of |
| 4974 | the list of recently selected ones." | 4975 | the list of recently selected ones." |
| 4975 | (pop-to-buffer buffer | 4976 | (pop-to-buffer buffer |
| 4976 | '((display-buffer--special | 4977 | '(display-buffer-same-window |
| 4977 | display-buffer-same-window) | ||
| 4978 | (inhibit-same-window . nil)) | 4978 | (inhibit-same-window . nil)) |
| 4979 | norecord)) | 4979 | norecord)) |
| 4980 | 4980 | ||
| @@ -5438,8 +5438,8 @@ by `recenter-positions'." | |||
| 5438 | 5438 | ||
| 5439 | ;;; Scrolling commands. | 5439 | ;;; Scrolling commands. |
| 5440 | 5440 | ||
| 5441 | ;;; Scrolling commands which does not signal errors at top/bottom | 5441 | ;;; Scrolling commands which do not signal errors at top/bottom |
| 5442 | ;;; of buffer at first key-press (instead moves to top/bottom | 5442 | ;;; of buffer at first key-press (instead move to top/bottom |
| 5443 | ;;; of buffer). | 5443 | ;;; of buffer). |
| 5444 | 5444 | ||
| 5445 | (defcustom scroll-error-top-bottom nil | 5445 | (defcustom scroll-error-top-bottom nil |