Skip to content

Instantly share code, notes, and snippets.

@dakkar
Created June 26, 2019 18:26
Show Gist options
  • Save dakkar/f591251f210d2010a4bf2dd12507aad4 to your computer and use it in GitHub Desktop.
Save dakkar/f591251f210d2010a4bf2dd12507aad4 to your computer and use it in GitHub Desktop.
EMACS - cache vagrant-tramp lookups
(require 'vagrant-tramp)
(defun dakkar-cache-vagrant (orig &rest args)
(let ((repo (pcache-repository "vagrant-tramp"))
(key 'all-boxes))
(if (pcache-has repo key)
(pcache-get repo key)
(let ((value (apply orig args)))
(pcache-put repo key value 300)
value))))
(advice-add 'vagrant-tramp--all-boxes :around #'dakkar-cache-vagrant)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment