changeset 81070:2d6076fafa6b

(bs-cycle-previous): Don't modify the cycle list until `switch-to-buffer' has returned succesfully. (bs-cycle-next): Ditto. Also, don't bury the buffer when the window is dedicated (it could iconify the frame).
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 25 May 2007 10:13:22 +0000
parents b3bd944f9137
children 5b3b1e543897
files lisp/bs.el
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/bs.el	Fri May 25 04:55:49 2007 +0000
+++ b/lisp/bs.el	Fri May 25 10:13:22 2007 +0000
@@ -1221,10 +1221,13 @@
 					bs--cycle-list)))
 	     (next (car tupel))
 	     (cycle-list (cdr tupel)))
+	(unless (window-dedicated-p (selected-window))
+	  ;; We don't want the frame iconified if the only window in the frame
+	  ;; happens to be dedicated; let's get the error from switch-to-buffer
+	  (bury-buffer))
+	(switch-to-buffer next)
 	(setq bs--cycle-list (append (cdr cycle-list)
 				     (list (car cycle-list))))
-	(bury-buffer)
-	(switch-to-buffer next)
 	(bs-message-without-log "Next buffers: %s"
 				(or (cdr bs--cycle-list)
 				    "this buffer"))))))
@@ -1251,9 +1254,9 @@
 					    bs--cycle-list)))
 	     (prev-buffer (car tupel))
 	     (cycle-list (cdr tupel)))
+	(switch-to-buffer prev-buffer)
 	(setq bs--cycle-list (append (last cycle-list)
 				     (reverse (cdr (reverse cycle-list)))))
-	(switch-to-buffer prev-buffer)
 	(bs-message-without-log "Previous buffers: %s"
 				(or (reverse (cdr bs--cycle-list))
 				    "this buffer"))))))