Function: trashed-list-print-entry

trashed-list-print-entry is a natively compiled function defined in trashed.el.

Signature

(trashed-list-print-entry ID COLS)

Documentation

Redefined tabulated-list-print-entry to format trash file size and date.

See the original function for ID and COLS.

Source Code

;; Defined in /nix/store/7ppdacjhnynz276lxxnfw8sdz6r2k6h2-emacs-packages-deps/share/emacs/site-lisp/elpa/trashed-20230811.157/trashed.el
(defun trashed-list-print-entry (id cols)
  "Redefined `tabulated-list-print-entry' to format trash file size and date.
See the original function for ID and COLS."
  (let ((fcols (vector (aref cols 0)
                       (trashed-format-size-string (aref cols 1))
                       (trashed-format-date-string (aref cols 2))
                       (aref cols 3)))
        (beg   (point))
	(x     (max tabulated-list-padding 0))
	(ncols (length tabulated-list-format))
	(inhibit-read-only t))
    (if (> tabulated-list-padding 0)
	(insert (make-string x ?\s)))
    (let ((tabulated-list--near-rows ; Bind it if not bound yet (Bug#25506).
           (or (bound-and-true-p tabulated-list--near-rows)
               (list (or (tabulated-list-get-entry (point-at-bol 0))
                         fcols)
                     fcols))))
      (dotimes (n ncols)
        (setq x (tabulated-list-print-col n (aref fcols n) x))))
    (insert ?\n)
    ;; Use cols rather than fcols
    (add-text-properties
     beg (point)
     `(tabulated-list-id ,id tabulated-list-entry ,cols))))