Function: bs-select

bs-select is an interactive and byte-compiled function defined in bs.el.gz.

Signature

(bs-select)

Documentation

Select current line's buffer and other marked buffers.

If there are no marked buffers the window configuration before starting Buffer Selection Menu will be restored. If there are marked buffers each marked buffer and the current line's buffer will be selected in a window. Leave Buffer Selection Menu.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/bs.el.gz
(defun bs-select ()
  "Select current line's buffer and other marked buffers.
If there are no marked buffers the window configuration before starting
Buffer Selection Menu will be restored.
If there are marked buffers each marked buffer and the current line's buffer
will be selected in a window.
Leave Buffer Selection Menu."
  (interactive)
  (let ((buffer (bs--current-buffer)))
    (bury-buffer (current-buffer))
    (bs--restore-window-config)
    (switch-to-buffer buffer)
    (when bs--marked-buffers
      ;; Some marked buffers for selection
      (let* ((all (delq buffer bs--marked-buffers))
	     (height (/ (1- (frame-height)) (1+ (length all)))))
	(delete-other-windows)
	(switch-to-buffer buffer)
	(dolist (buf all)
	  (split-window nil height)
	  (other-window 1)
	  (switch-to-buffer buf))
	;; goto window we have started bs.
	(other-window 1)))))