[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/autothemer f7ea601387 2/5: Add function to find the autoth
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/autothemer f7ea601387 2/5: Add function to find the autothemer source |
Date: |
Fri, 14 Apr 2023 10:14:31 -0400 (EDT) |
branch: elpa/autothemer
commit f7ea6013874878d151a9436a14633f88d38348a4
Author: Jason Milkins <jasonm23@gmail.com>
Commit: Jason Milkins <jasonm23@gmail.com>
Add function to find the autothemer source
We'll move the hardcoded templates into the source folder, and test
that we can find them in the next version.
---
autothemer.el | 18 +++++++++++++++++-
tests/autothemer-tests.el | 2 +-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/autothemer.el b/autothemer.el
index 0e1a8dfdd8..2a00703d71 100644
--- a/autothemer.el
+++ b/autothemer.el
@@ -7,7 +7,7 @@
;; Maintainer: Jason Milkins <jasonm23@gmail.com>
;;
;; URL: https://github.com/jasonm23/autothemer
-;; Version: 0.2.15
+;; Version: 0.2.16
;; Package-Requires: ((dash "2.10.0") (emacs "26.1"))
;;
;;; License:
@@ -1086,5 +1086,21 @@ Swatch Template parameters:
svg-swatches)))
(message "%s generated." svg-out-file)))))
+(defun autothemer--locate-source ()
+ "Return the absolute file path of autothemer source.
+
+Return nil if not found."
+ (let* ((lib-file-name "autothemer.el")
+ (located-file (file-truename (locate-library "autothemer")))
+ (is-byte-compiled (string= "elc" (file-name-extension located-file)))
+ (el-name (format "%s.el" (file-name-sans-extension located-file)))
+ (located-el (file-truename (if (and is-byte-compiled (file-exists-p
el-name))
+ el-name
+ located-file)))
+ (located-folder (file-name-directory located-el)))
+ (if (file-directory-p located-folder)
+ located-folder
+ nil)))
+
(provide 'autothemer)
;;; autothemer.el ends here
diff --git a/tests/autothemer-tests.el b/tests/autothemer-tests.el
index fc1cd4079e..77fc6fe333 100644
--- a/tests/autothemer-tests.el
+++ b/tests/autothemer-tests.el
@@ -1,6 +1,6 @@
;; autothemer-tests.el
-;; Version: 0.2.15
+;; Version: 0.2.16
;;; Code: