diff options
author | Kyle Meyer <kyle@kyleam.com> | 2021-10-24 23:56:28 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2021-10-25 22:49:56 -0400 |
commit | d0db4946a02e2f5f350836a18b82f55cfcf39115 (patch) | |
tree | 4390f450b22e303f961c7284e894f3fb1ac631fb | |
parent | 5e3002a9245581b3e3a924247707b24a9f21b610 (diff) | |
download | piem-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.el | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |