Function: diff--cache-clean

diff--cache-clean is a byte-compiled function defined in diff-mode.el.gz.

Signature

(diff--cache-clean)

Documentation

Discard the least recently used half of the cache.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/diff-mode.el.gz
(defconst diff--cache-clean-interval 3600)  ; seconds

(defun diff--cache-clean ()
  "Discard the least recently used half of the cache."
  (let ((n (/ (length diff--cached-revision-buffers) 2)))
    (mapc #'kill-buffer (mapcar #'cdr (nthcdr n diff--cached-revision-buffers)))
    (setq diff--cached-revision-buffers
          (ntake n diff--cached-revision-buffers)))
  (diff--cache-schedule-clean))