Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamped caching system #199

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Revamped caching system #199

wants to merge 13 commits into from

Conversation

vermiculus
Copy link
Owner

Not ready for merge yet. Use this PR as a discussion medium.

Addresses #88.

@Malabarba
Copy link
Collaborator

I have a general question here regarding what your plans are. Specifically, about the elements of sx-cache--cache-volatility-alist.

Is CACHE a symbol? If so, can't it be the same symbol as VARIABLE?
What did you have in mind for these two?

This commit will break Travis for this branch.  stash.el has yet to be
released.  It will be released to MELPA and then to ELPA pending
paperwork (at which point it will be removed from MELPA).
This obsoletes sx-cache.
Ensure application data is written before Emacs is killed.
(defmacro sx-init-variable (variable)
"Set up VARIABLE to be loaded from disk on init."
`(add-hook 'sx-init--internal-hook
(lambda () (stash-load ,variable))))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really think this ought to be handled by stash.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that it's a programmer's interface, I was hesitant to introduce functionality that wasn't specifically requested. Having gone through to use it, though, you're right – there are very few cases in which it isn't desired. A no-load flag to defstash would suffice.

Hopefully this will also resolve those issues Travis has been having
downloading the right version...
nil

(defstash sx-auth-access-token
"auth.el" sx nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given how catastrophic it would be to have two stashes with the same file name, maybe we should use more specific names for future stashes. Or (even better) maybe stash.el could take care of choosing unique file names based on variable name.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latter option seems good, but what else would auth be used for (in our case specifically)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I don't know. I don't think we should change this variable specifically. It just occurred to me we might want to use longer names on future stashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants