Function: iswitchb-make-buflist

iswitchb-make-buflist is a byte-compiled function defined in iswitchb.el.gz.

Signature

(iswitchb-make-buflist DEFAULT)

Documentation

Set iswitchb-buflist to the current list of buffers.

Currently visible buffers are put at the end of the list. The hook iswitchb-make-buflist-hook is run after the list has been created to allow the user to further modify the order of the buffer names in this list. If DEFAULT is non-nil, and corresponds to an existing buffer, it is put to the start of the list.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/iswitchb.el.gz
;;; CREATE LIST OF ALL CURRENT BUFFERS

(defun iswitchb-make-buflist (default)
  "Set `iswitchb-buflist' to the current list of buffers.
Currently visible buffers are put at the end of the list.
The hook `iswitchb-make-buflist-hook' is run after the list has been
created to allow the user to further modify the order of the buffer names
in this list.  If DEFAULT is non-nil, and corresponds to an existing buffer,
it is put to the start of the list."
  (setq iswitchb-buflist
	(let* ((iswitchb-current-buffers (iswitchb-get-buffers-in-frames))
	       (iswitchb-temp-buflist
		(delq nil
		      (mapcar
		       (lambda (x)
			 (let ((b-name (buffer-name x)))
			   (if (not
				(or
				 (iswitchb-ignore-buffername-p b-name)
				 (memq b-name iswitchb-current-buffers)))
			       b-name)))
		       (buffer-list (and iswitchb-use-frame-buffer-list
					 (selected-frame)))))))
	  (setq iswitchb-temp-buflist
		(nconc iswitchb-temp-buflist iswitchb-current-buffers))
	  (run-hooks 'iswitchb-make-buflist-hook)
	 ;; Should this be after the hooks, or should the hooks be the
	  ;; final thing to be run?
	  (if default
	      (progn
		(setq iswitchb-temp-buflist
		      (delete default iswitchb-temp-buflist))
		(setq iswitchb-temp-buflist
		      (cons default iswitchb-temp-buflist))))
	  iswitchb-temp-buflist)))