Function: python-nav-cache-set

python-nav-cache-set is a byte-compiled function defined in python.el.gz.

Signature

(python-nav-cache-set KIND CURRENT TARGET)

Documentation

Add a key-value pair to the navigation cache.

Invalidate the navigation cache if the current buffer has been modified. Then add a key-value pair to the navigation cache. The key consists of KIND and CURRENT line number, and the value is TARGET position.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-nav-cache-set (kind current target)
  "Add a key-value pair to the navigation cache.
Invalidate the navigation cache if the current buffer has been modified.
Then add a key-value pair to the navigation cache.  The key consists of
KIND and CURRENT line number, and the value is TARGET position."
  (let ((tick (buffer-chars-modified-tick)))
    (when (/= tick python-nav-cache-tick)
      (setq-local python-nav-cache nil
                  python-nav-cache-tick tick))
    (push (cons (cons kind current) target) python-nav-cache)
    target))