summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-10-24 23:56:28 -0400
committerKyle Meyer <kyle@kyleam.com>2021-10-25 22:49:56 -0400
commitd0db4946a02e2f5f350836a18b82f55cfcf39115 (patch)
tree4390f450b22e303f961c7284e894f3fb1ac631fb
parent5e3002a9245581b3e3a924247707b24a9f21b610 (diff)
downloadpiem-d0db4946a02e2f5f350836a18b82f55cfcf39115.tar.gz
piem: Add function that returns public-inbox's configuration file
piem--merge-config-inboxes determines public-inbox's configuration file by using PI_CONFIG if set, falling back to the hardcoded location. piem-lei.el will need to do the same, so move the logic into a function. Message-Id: <20211025035630.297598-9-kyle@kyleam.com>
-rw-r--r--piem.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/piem.el b/piem.el
index 31b9c71..afe6b7a 100644
--- a/piem.el
+++ b/piem.el
@@ -373,9 +373,13 @@ files."
(defvar piem--inboxes 'unset)
+(defun piem-public-inbox-config-file ()
+ "Return public-inbox's configuration file."
+ (or (getenv "PI_CONFIG")
+ (expand-file-name "~/.public-inbox/config")))
+
(defun piem--merge-config-inboxes ()
- (let ((cfg-file (or (getenv "PI_CONFIG")
- (expand-file-name "~/.public-inbox/config"))))
+ (let ((cfg-file (piem-public-inbox-config-file)))
(if (not (file-readable-p cfg-file))
(setq piem--inboxes piem-inboxes)
(let ((case-fold-search t)