aboutsummaryrefslogtreecommitdiff
path: root/sx-cache.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-08 14:12:42 -0500
committerSean Allred <code@seanallred.com>2014-11-08 14:12:42 -0500
commit7ed29c4dc940a871562aaa802ac53ddee4c66a27 (patch)
tree4656459efc90a16ad70a5f857630066a85805e11 /sx-cache.el
parentb6043f63e5b3437633a53bcc191214bb8a7f936b (diff)
Re-work filtering and caching
* sx-auth.el - Use new symbolic cache access * sx-cache.el - Implement symbolic cache access * sx-filter.el - Use symbolic cache access - Compile and save filters on-demand (more work to be done to this end) * sx-question.el - Symbolic filters * sx-request.el - Protection against infinitely recursing when compiling a filter This will be re-worked into requests (a front-end function) and 'raw' requests (a back-end function). The front-end will add convenience to the back-end. * test/tests.el Remove outdated tests
Diffstat (limited to 'sx-cache.el')
-rw-r--r--sx-cache.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/sx-cache.el b/sx-cache.el
index a090982..54ae94f 100644
--- a/sx-cache.el
+++ b/sx-cache.el
@@ -20,7 +20,12 @@
;;; Commentary:
+;; All caches are retrieved and set using symbols. The symbol should
+;; be the sub-subpackage that is using the cache. For example,
+;; `sx-pkg' would use `(sx-cache-get 'pkg)'.
;;
+;; This symbol is then converted into a filename within
+;; `sx-cache-directory'.
;;; Code:
@@ -30,7 +35,9 @@
(defun sx-cache-get-file-name (filename)
"Expands FILENAME in the context of `sx-cache-directory'."
- (expand-file-name filename sx-cache-directory))
+ (expand-file-name
+ (concat (symbol-name filename) ".el")
+ sx-cache-directory))
(defun sx-cache-get (cache)
"Return the data within CACHE.