discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: piem@inbox.kyleam.com
Subject: [PATCH 08/10] piem: Add function that returns public-inbox's configuration file
Date: Sun, 24 Oct 2021 23:56:28 -0400	[thread overview]
Message-ID: <20211025035630.297598-9-kyle@kyleam.com> (raw)
In-Reply-To: <20211025035630.297598-1-kyle@kyleam.com>

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.
 piem.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/piem.el b/piem.el
index 31b9c71c..afe6b7af 100644
--- a/piem.el
+++ b/piem.el
@@ -373,9 +373,13 @@ (defun piem--git-config-list (&optional file)
 (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)

  parent reply	other threads:[~2021-10-25  3:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25  3:56 [PATCH 00/10] lei-q transient Kyle Meyer
2021-10-25  3:56 ` [PATCH 01/10] piem-lei-query-show: Fix capitalization in error message Kyle Meyer
2021-10-25  3:56 ` [PATCH 02/10] piem-lei-known-mid-p: Use with-output-to-string Kyle Meyer
2021-10-25  3:56 ` [PATCH 03/10] lei: Introduce option to set "lei" executable Kyle Meyer
2021-10-25  3:56 ` [PATCH 04/10] lei: Add call-process wrapper for inserting lei output Kyle Meyer
2021-10-25  3:56 ` [PATCH 05/10] piem-lei-insert-output: Signal an error if lei call fails Kyle Meyer
2021-10-25  3:56 ` [PATCH 06/10] lei: Add transient wrapper for piem-lei-query Kyle Meyer
2021-10-25  3:56 ` [PATCH 07/10] lei: Set piem-lei-buffer-query for mid-based query functions Kyle Meyer
2021-10-25  3:56 ` Kyle Meyer [this message]
2021-10-25  3:56 ` [PATCH 09/10] lei q: Offer candidates for --include and --only Kyle Meyer
2021-10-25  3:56 ` [PATCH 10/10] lei: Rename piem-lei-show-mid to piem-lei-buffer-mid Kyle Meyer
2021-10-26  2:49   ` Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://git.kyleam.com/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211025035630.297598-9-kyle@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=piem@inbox.kyleam.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).