]> git.eshelyaron.com Git - emacs.git/commitdiff
(bs-cycle-previous): Don't modify the cycle list until `switch-to-buffer' has
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 25 May 2007 10:14:51 +0000 (10:14 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 25 May 2007 10:14:51 +0000 (10:14 +0000)
returned succesfully.
(bs-cycle-next): Ditto.  Also, don't bury the buffer when the window is
dedicated (it could iconify the frame).

lisp/ChangeLog
lisp/bs.el

index be975f67e990534d10e34870ffb0b9a1c59a0a5f..560b0480810502024bac5643075910222a370c3c 100644 (file)
@@ -1,3 +1,10 @@
+2007-05-25  Juanma Barranquero  <lekktu@gmail.com>
+
+       * bs.el (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).
+
 2007-05-25  Miles Bader  <miles@fencepost.gnu.org>
 
        * vc-hooks.el (vc-find-root): Fix file attribute test.
index b1fa47100f02572367d71ceb4e5c252c87a1ca9e..5951d129d9695c65d321bb7ec520f7c8d418fb22 100644 (file)
@@ -1221,10 +1221,13 @@ by buffer configuration `bs-cycle-configuration-name'."
                                        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 @@ by buffer configuration `bs-cycle-configuration-name'."
                                            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"))))))