aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2007-06-05 15:59:15 +0000
committerChong Yidong2007-06-05 15:59:15 +0000
commitb49bf494d2860b79f694148d55df9326aff08d8f (patch)
tree390852a61efc0b4215f53c61d1e9d3a193e5b47b
parent27e165152b8365e566b30155e7e7cdf7b0a3c6ae (diff)
downloademacs-b49bf494d2860b79f694148d55df9326aff08d8f.tar.gz
emacs-b49bf494d2860b79f694148d55df9326aff08d8f.zip
(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).
-rw-r--r--lisp/bs.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/bs.el b/lisp/bs.el
index b1fa47100f0..5951d129d96 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -1221,10 +1221,13 @@ by buffer configuration `bs-cycle-configuration-name'."
1221 bs--cycle-list))) 1221 bs--cycle-list)))
1222 (next (car tupel)) 1222 (next (car tupel))
1223 (cycle-list (cdr tupel))) 1223 (cycle-list (cdr tupel)))
1224 (unless (window-dedicated-p (selected-window))
1225 ;; We don't want the frame iconified if the only window in the frame
1226 ;; happens to be dedicated; let's get the error from switch-to-buffer
1227 (bury-buffer))
1228 (switch-to-buffer next)
1224 (setq bs--cycle-list (append (cdr cycle-list) 1229 (setq bs--cycle-list (append (cdr cycle-list)
1225 (list (car cycle-list)))) 1230 (list (car cycle-list))))
1226 (bury-buffer)
1227 (switch-to-buffer next)
1228 (bs-message-without-log "Next buffers: %s" 1231 (bs-message-without-log "Next buffers: %s"
1229 (or (cdr bs--cycle-list) 1232 (or (cdr bs--cycle-list)
1230 "this buffer")))))) 1233 "this buffer"))))))
@@ -1251,9 +1254,9 @@ by buffer configuration `bs-cycle-configuration-name'."
1251 bs--cycle-list))) 1254 bs--cycle-list)))
1252 (prev-buffer (car tupel)) 1255 (prev-buffer (car tupel))
1253 (cycle-list (cdr tupel))) 1256 (cycle-list (cdr tupel)))
1257 (switch-to-buffer prev-buffer)
1254 (setq bs--cycle-list (append (last cycle-list) 1258 (setq bs--cycle-list (append (last cycle-list)
1255 (reverse (cdr (reverse cycle-list))))) 1259 (reverse (cdr (reverse cycle-list)))))
1256 (switch-to-buffer prev-buffer)
1257 (bs-message-without-log "Previous buffers: %s" 1260 (bs-message-without-log "Previous buffers: %s"
1258 (or (reverse (cdr bs--cycle-list)) 1261 (or (reverse (cdr bs--cycle-list))
1259 "this buffer")))))) 1262 "this buffer"))))))