summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2012-08-31 18:51:49 +0200
committerMartin Rudalics <rudalics@gmx.at>2012-08-31 18:51:49 +0200
commit862382df3db08238c471025bfdd26ec33fd7a387 (patch)
tree61dca34dbcd6031dfdf868f1d9f73cffe5d1376d /lisp
parent7b2fbe3b46bf422f9fb9b21d001de58a4f904abd (diff)
downloademacs-862382df3db08238c471025bfdd26ec33fd7a387.tar.gz
Consider frame's buffer predicate in switch-to-prev-/next-buffer.
* window.el (switch-to-prev-buffer, switch-to-next-buffer): Consider frame's buffer predicate when choosing the buffer. (Bug#12081)
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/window.el8
2 files changed, 14 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3034d7f6adf..ce4493d4c76 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-31 Alp Aker <alp.tekin.aker@gmail.com>
+
+ * window.el (switch-to-prev-buffer, switch-to-next-buffer):
+ Consider frame's buffer predicate when choosing the buffer.
+ (Bug#12081)
+
2012-08-30 Richard Stallman <rms@gnu.org>
* simple.el (special-mode-map): Delete binding for `z'.
diff --git a/lisp/window.el b/lisp/window.el
index 8f410ea3d4d..c72093334d8 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2979,6 +2979,7 @@ shall not be switched to in future invocations of this command."
(old-buffer (window-buffer window))
;; Save this since it's destroyed by `set-window-buffer'.
(next-buffers (window-next-buffers window))
+ (pred (frame-parameter frame 'buffer-predicate))
entry buffer new-buffer killed-buffers visible)
(when (window-dedicated-p window)
(error "Window %s is dedicated to buffer %s" window old-buffer))
@@ -2991,6 +2992,7 @@ shall not be switched to in future invocations of this command."
(or (buffer-live-p buffer)
(not (setq killed-buffers
(cons buffer killed-buffers))))
+ (or (null pred) (funcall pred buffer))
(not (eq buffer old-buffer))
(or bury-or-kill (not (memq buffer next-buffers))))
(if (and (not switch-to-visible-buffer)
@@ -3013,6 +3015,7 @@ shall not be switched to in future invocations of this command."
(when (and (buffer-live-p buffer)
(not (eq buffer old-buffer))
(not (eq (aref (buffer-name buffer) 0) ?\s))
+ (or (null pred) (funcall pred buffer))
(or bury-or-kill (not (memq buffer next-buffers))))
(if (get-buffer-window buffer frame)
;; Try to avoid showing a buffer visible in some other window.
@@ -3031,6 +3034,7 @@ shall not be switched to in future invocations of this command."
(not (setq killed-buffers
(cons buffer killed-buffers))))
(not (eq buffer old-buffer))
+ (or (null pred) (funcall pred buffer))
(setq entry (assq buffer (window-prev-buffers window))))
(setq new-buffer buffer)
(set-window-buffer-start-and-point
@@ -3075,6 +3079,7 @@ found."
(frame (window-frame window))
(old-buffer (window-buffer window))
(next-buffers (window-next-buffers window))
+ (pred (frame-parameter frame 'buffer-predicate))
buffer new-buffer entry killed-buffers visible)
(when (window-dedicated-p window)
(error "Window %s is dedicated to buffer %s" window old-buffer))
@@ -3086,6 +3091,7 @@ found."
(not (setq killed-buffers
(cons buffer killed-buffers))))
(not (eq buffer old-buffer))
+ (or (null pred) (funcall pred buffer))
(setq entry (assq buffer (window-prev-buffers window))))
(setq new-buffer buffer)
(set-window-buffer-start-and-point
@@ -3096,6 +3102,7 @@ found."
(dolist (buffer (buffer-list frame))
(when (and (buffer-live-p buffer) (not (eq buffer old-buffer))
(not (eq (aref (buffer-name buffer) 0) ?\s))
+ (or (null pred) (funcall pred buffer))
(not (assq buffer (window-prev-buffers window))))
(if (get-buffer-window buffer frame)
;; Try to avoid showing a buffer visible in some other window.
@@ -3110,6 +3117,7 @@ found."
(or (buffer-live-p buffer)
(not (setq killed-buffers
(cons buffer killed-buffers))))
+ (or (null pred) (funcall pred buffer))
(not (eq buffer old-buffer)))
(if (and (not switch-to-visible-buffer)
(get-buffer-window buffer frame))