Function: vundo--record-timestamps

vundo--record-timestamps is a natively compiled function defined in vundo.el.

Signature

(vundo--record-timestamps MOD-LIST)

Documentation

Return an alist mapping mods in MOD-LIST to timestamps.

The alist is sorted by time, with latest saved mods first.

Source Code

;; Defined in /nix/store/386w2ds6bdh3gcz9k23jssw4cni4lfr2-emacs-packages-deps/share/emacs/site-lisp/elpa/vundo-2.4.0/vundo.el
(defun vundo--record-timestamps (mod-list)
  "Return an alist mapping mods in MOD-LIST to timestamps.
The alist is sorted by time, with latest saved mods first."
  (let ((timestamps ()))
    (cl-loop for idx from 1 below (length mod-list)
             for ts = (vundo-m-timestamp (aref mod-list idx))
             if ts do
             (let* ((mod-node (aref mod-list (1- idx)))
                    (master (vundo--master-eqv-mod-of mod-node))
                    (entry (assq master timestamps))
                    (old-ts (cdr entry)))
               (when (and old-ts (time-less-p ts old-ts))
                 ;; Equivalent node modified again? take the newer time.
                 (setq ts old-ts))
               (if entry (setcdr entry ts)
                 (push (cons master ts) timestamps))))
    (sort timestamps  ; Sort latest first.
          (lambda (a b) (time-less-p (cdr b) (cdr a))))))