]> code.delx.au - gnu-emacs/blobdiff - lisp/bs.el
upstream
[gnu-emacs] / lisp / bs.el
index 6965af1368ce7d0499501f3174c0508280d480af..2e0089d153f3bbfe914d5f08eb6cdd05c050fa20 100644 (file)
@@ -1,6 +1,6 @@
 ;;; bs.el --- menu for selecting and displaying buffers -*- lexical-binding: t -*-
 
-;; Copyright (C) 1998-2011  Free Software Foundation, Inc.
+;; Copyright (C) 1998-2012  Free Software Foundation, Inc.
 ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Keywords: convenience
@@ -25,7 +25,7 @@
 ;; Version: 1.17
 ;; X-URL: http://www.geekware.de/software/emacs
 ;;
-;; The bs-package contains a main function bs-show for poping up a
+;; The bs-package contains a main function bs-show for popping up a
 ;; buffer in a way similar to `list-buffers' and `electric-buffer-list':
 ;; The new buffer offers a Buffer Selection Menu for manipulating
 ;; the buffer list and buffers.
@@ -865,7 +865,7 @@ the status of buffer on current line."
 (defun bs--mark-unmark (count fun)
   "Call FUN on COUNT consecutive buffers of *buffer-selection*."
   (let ((dir (if (> count 0) 1 -1)))
-    (dotimes (i (abs count))
+    (dotimes (_i (abs count))
       (let ((buffer (bs--current-buffer)))
        (when buffer (funcall fun buffer))
        (bs--update-current-line)
@@ -976,7 +976,7 @@ Uses function `toggle-read-only'."
 
 (defun bs--nth-wrapper (count fun &rest args)
   "Call COUNT times function FUN with arguments ARGS."
-  (dotimes (i (or count 1))
+  (dotimes (_i (or count 1))
     (apply fun args)))
 
 (defun bs-up (arg)
@@ -1212,11 +1212,10 @@ 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)
+        ;; We don't want the frame iconified if the only window in the frame
+        ;; happens to be dedicated.
+        (bury-buffer (current-buffer))
+       (switch-to-buffer next nil t)
        (setq bs--cycle-list (append (cdr cycle-list)
                                     (list (car cycle-list))))
        (bs-message-without-log "Next buffers: %s"
@@ -1245,7 +1244,7 @@ by buffer configuration `bs-cycle-configuration-name'."
                                            bs--cycle-list)))
             (prev-buffer (car tupel))
             (cycle-list (cdr tupel)))
-       (switch-to-buffer prev-buffer)
+       (switch-to-buffer prev-buffer nil t)
        (setq bs--cycle-list (append (last cycle-list)
                                     (reverse (cdr (reverse cycle-list)))))
        (bs-message-without-log "Previous buffers: %s"
@@ -1415,8 +1414,7 @@ for buffer selection."
        (bs--restore-window-config)
        (setq bs--window-config-coming-from (current-window-configuration))
        (when (> (window-height (selected-window)) 7)
-          (split-window-vertically)
-          (other-window 1)))
+          (select-window (split-window-below))))
       (bs-show-in-buffer liste)
       (bs-message-without-log "%s" (bs--current-config-message)))))