Created
June 26, 2019 18:26
-
-
Save dakkar/f591251f210d2010a4bf2dd12507aad4 to your computer and use it in GitHub Desktop.
EMACS - cache vagrant-tramp lookups
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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