From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id 6CGnDQMrdmE7QAAAsNZ9tg (envelope-from ); Mon, 25 Oct 2021 03:56:51 +0000 Received: from out1.migadu.com ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4EOCCQMrdmEhPAAA1q6Kng (envelope-from ); Mon, 25 Oct 2021 03:56:51 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1635134211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y1OmCSqhWm5FqxJX1XA47rxaASKD9L7WlT8divp8no8=; b=Gc+fy1jNhLmJ+2KWdwqOtj/LtOud5vooqZnvzpvbj2gEV2SeDn8fqFZ+xkI5YWJyFkoxjf U27/NNJQWWp3E6ir4N3a+bpXVHKxyK6lbuhkV8BwbDvLqKbZCx8pky/IwxHM4JdO2b+IN/ SqJfgi1leeDa/ecg8v3ASWAZBdBRY5jPbNTSQp07FUE6sg76vsR2syBISnmgRXN/R1jqXn PnEjlxAELO76NV4IrHPBFe6wtP30f+B0/FqnMCySimLvpdlwn9w/eQ9JUbmnaOUIBEJo1Q bVJgPbFhUM7ZCG2SSdVeO2VT5DLL40rSTHZ/cu9jWsvueWlJz4ksBQlOQia7ng== From: Kyle Meyer 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 Message-Id: <20211025035630.297598-9-kyle@kyleam.com> In-Reply-To: <20211025035630.297598-1-kyle@kyleam.com> References: <20211025035630.297598-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-TUID: 2VG4kYfW+IRi 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) -- 2.33.1