Function: msb--create-sort-item

msb--create-sort-item is a byte-compiled function defined in msb.el.gz.

Signature

(msb--create-sort-item FUNCTION-INFO)

Documentation

Return (SORT-KEY TITLE . BUFFER-LIST) or nil if the buffer-list is empty.

Source Code

;; Defined in /usr/src/emacs/lisp/msb.el.gz
(defun msb--create-sort-item (function-info)
  "Return (SORT-KEY TITLE . BUFFER-LIST) or nil if the buffer-list is empty."
  (let ((buffer-list (symbol-value (aref function-info 0))))
    (when buffer-list
      (let ((sorter (aref function-info 5)) ;SORTER
	    (sort-key (aref function-info 2))) ;MENU-SORT-KEY
	(when sort-key
	  (cons sort-key
		(cons (format (aref function-info 3) ;MENU-TITLE
			      (length buffer-list))
		      (cond
		       ((null sorter)
			buffer-list)
		       ((eq sorter t)
			(nreverse buffer-list))
		       (t
			(sort buffer-list sorter))))))))))