emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/svg-lib 6ceae83 16/32: Change `svg-lib-icons-dir` defau


From: ELPA Syncer
Subject: [elpa] externals/svg-lib 6ceae83 16/32: Change `svg-lib-icons-dir` default value
Date: Mon, 27 Sep 2021 16:57:48 -0400 (EDT)

branch: externals/svg-lib
commit 6ceae8324723523428b2a006056690b52aee7fbe
Author: Damon Chan <damon.chan@freshup.com.hk>
Commit: Damon Chan <damon.chan@freshup.com.hk>

    Change `svg-lib-icons-dir` default value
    
    It saves to "~/.emacs.d/.cache/svg-lib/" by default. If `svg-lib-icons-dir`
    does not exist, create it.
---
 svg-lib.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/svg-lib.el b/svg-lib.el
index 682916a..40fc697 100644
--- a/svg-lib.el
+++ b/svg-lib.el
@@ -103,7 +103,8 @@ collection (there are way too many to store them)."
                 :value-type (string :tag "URL"))
   :group 'svg-lib)
 
-(defcustom svg-lib-icons-dir "~/Downloads"
+(defcustom svg-lib-icons-dir
+  (expand-file-name (concat user-emacs-directory ".cache/svg-lib/"))
   "svg-lib icons directory."
   :group 'svg-lib
   :type 'directory)
@@ -313,7 +314,9 @@ Cached version is returned if it exists unless FORCE-RELOAD 
is t."
 
   ;; Build url from collection and name without checking for error
   (let ((url (format (cdr (assoc collection svg-lib-icon-collections)) name)))
-    ;; Get data from cache
+    ;; create the svg-lib-icons-dir if not exists
+    (unless (file-exists-p svg-lib-icons-dir)
+      (make-directory svg-lib-icons-dir))
     (let* ((filename (expand-file-name (format "%s_%s.svg" collection name) 
svg-lib-icons-dir))
            (buffer (if (or force-reload (not (file-exists-p filename)))
                        (with-current-buffer (url-retrieve-synchronously url)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]