Function: tabulated-list-print-entries

tabulated-list-print-entries is a byte-compiled function defined in tabulated-list.el.gz.

Signature

(tabulated-list-print-entries ENTRIES SORTER UPDATE ENTRY-ID)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/tabulated-list.el.gz
(defun tabulated-list-print-entries (entries sorter update entry-id)
  (let (saved-pt)
    (while entries
      (let* ((elt (car entries))
             (tabulated-list--near-rows
              (list
               (or (tabulated-list-get-entry (pos-bol 0)) (cadr elt))
               (cadr elt)
               (or (cadr (cadr entries)) (cadr elt))))
             (id (car elt)))
        (and entry-id
             (equal entry-id id)
             (setq entry-id nil
                   saved-pt (point)))
        ;; If the buffer is empty, simply print each elt.
        (if (or (not update) (eobp))
            (apply tabulated-list-printer elt)
          (while (let ((local-id (tabulated-list-get-id)))
                   ;; If we find id, then nothing to update.
                   (cond ((equal id local-id)
                          (forward-line 1)
                          nil)
                         ;; If this entry sorts after id (or it's the
                         ;; end), then just insert id and move on.
                         ((or (not local-id)
                              (funcall sorter elt
                                       ;; FIXME: Might be faster if
                                       ;; don't construct this list.
                                       (list local-id (tabulated-list-get-entry))))
                          (apply tabulated-list-printer elt)
                          nil)
                         ;; We find an entry that sorts before id,
                         ;; it needs to be deleted.
                         (t t)))
            (let ((old (point)))
              (forward-line 1)
              (delete-region old (point))))))
      (setq entries (cdr entries)))
    saved-pt))