Function: bs-show-in-buffer

bs-show-in-buffer is a byte-compiled function defined in bs.el.gz.

Signature

(bs-show-in-buffer LIST)

Documentation

Display buffer list LIST in buffer *buffer-selection*.

Select buffer *buffer-selection* and display buffers according to current configuration bs-current-configuration. Set window height, fontify buffer and move point to current buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/bs.el.gz
(defun bs-show-in-buffer (list)
  "Display buffer list LIST in buffer *buffer-selection*.
Select buffer *buffer-selection* and display buffers according to current
configuration `bs-current-configuration'.  Set window height, fontify buffer
and move point to current buffer."
  (setq bs-current-list list)
  (let* ((window-combination-limit 'window-size)
	 (bs-buf (get-buffer-create "*buffer-selection*"))
	 (bs-win (progn
		   (pop-to-buffer bs-buf bs-default-action-list)
		   (selected-window))))
    ;; Delete other windows showing *buffer-selection*.
    ;; Done after pop-to-buffer, instead of just calling delete-windows-on,
    ;; to allow display-buffer-reuse(-mode)?-window to be used in ALIST.
    (dolist (w (get-buffer-window-list bs-buf 'not t))
      (unless (eq w bs-win)
	(with-demoted-errors "Error deleting window: %S"
	  (delete-window w)))))
  (bs-mode)
  (let* ((inhibit-read-only t)
	 (map-fun (lambda (entry)
		    (string-width (buffer-name entry))))
	 (max-length-of-names (apply 'max
				     (cons 0 (mapcar map-fun list))))
	 (name-entry-length (min bs-maximal-buffer-name-column
				 (max bs-minimal-buffer-name-column
				      max-length-of-names))))
    (erase-buffer)
    (setq bs--name-entry-length name-entry-length)
    (bs--show-header)
    (dolist (buffer list)
      (bs--insert-one-entry buffer)
      (insert "\n"))
    (delete-char -1)
    (bs--set-window-height)
    (bs--goto-current-buffer)
    (font-lock-ensure)
    (bs-apply-sort-faces)
    (set-buffer-modified-p nil)))