aboutsummaryrefslogtreecommitdiff
path: root/stack-core.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-02 11:13:41 -0500
committerSean Allred <code@seanallred.com>2014-11-02 11:13:41 -0500
commitd273e792fbc1cc7238e156e24099d25ed0b3c53e (patch)
tree18f8b14b35419f7a565822cfb6733b132eba2249 /stack-core.el
parent39777784204c3dd616dd21dc2207bf35cbf35eae (diff)
Add function to retrieve cache files
Diffstat (limited to 'stack-core.el')
-rw-r--r--stack-core.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/stack-core.el b/stack-core.el
index 3391d14..fde06a8 100644
--- a/stack-core.el
+++ b/stack-core.el
@@ -245,5 +245,14 @@ entire response as a complex alist."
cons-cell))))
data))))
+(defun stack-cache-get-file (filename)
+ "Return a buffer for FILENAME from `stack-cache-directory'."
+ (let ((find-file-hook nil)
+ (file (expand-file-name filename stack-cache-directory)))
+ (unless (file-exists-p stack-cache-directory)
+ (mkdir stack-cache-directory))
+ (unless (file-exists-p file)
+ (find-file-noselect file))))
+
(provide 'stack-core)
;;; stack-core.el ends here