From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:203:b4db::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id uCpnEtCVdGKnQQAAsNZ9tg (envelope-from ) for ; Fri, 06 May 2022 03:28:16 +0000 Received: from out2.migadu.com ([2001:41d0:2:aacc::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WFPkENCVdGIxfgAA9RJhRA (envelope-from ) for ; Fri, 06 May 2022 05:28:16 +0200 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=1651807696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KQJJdiHLquiki8pVVlCBQNsfWW26bnFh2Nw+ghmmhuM=; b=hLuGaOZlJvovc9njXgaGoLzQUpk3d8rQvxmnnUb6UCu+FX0Wl9Ltuq4rKtW0cod4nq7eph tgP37JBYE05hr7xH6N1dlVzGYGtzrhHJqgffFALUQMYy6k4yHOn7AZfxzMdEavvjpdegoB vg5ZuaeK9LuIciF9hdXJ/5s4gctRAPwLQKzYfYy9dDDwHif5MBj/Vu/xYRYQLt/JySdX/r buUjduOBkPbWZUQvjefRiY3wJ9Lv9HA5Bngj3sxwX4IvziI1FnLxFp79ex3iZ2Sv4DxlNl zyTKKC/eviWcmJoyO2IulGsT5zcvIxlMoW/m91EO0EACxA7rojvFCit6VA1tFQ== From: Kyle Meyer To: Ihor Radchenko Cc: piem@inbox.kyleam.com Subject: Re: [PATCH] piem-inboxes: Support mapping inbox to multiple coderepos In-Reply-To: <874k238l7y.fsf@localhost> References: <87pml6871p.fsf@kyleam.com> <20220506014017.14259-1-kyle@kyleam.com> <874k238l7y.fsf@localhost> Date: Thu, 05 May 2022 23:28:14 -0400 Message-ID: <877d6zmjap.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyleam.com X-TUID: 1IXbZz+VqyVI Ihor Radchenko writes: > Kyle Meyer writes: [...] >> @@ -100,8 +102,7 @@ (defcustom piem-inboxes nil >> ;; `piem--merge-config-inboxes' so that the value can also be set in >> ;; ~/.public-inbox/config. >> :type '(alist :key-type string >> - :value-type >> - (plist :value-type string)) >> + :value-type plist) > > :value-type plist seems wrong, unless I miss something. Even a list of > strings will not necessarily match this value type when there are e.g. 3 > repos associated with an inbox. Hmm, aren't you mapping at the wrong level? This type is supposed to match an alist like this: (("git" :url "https://lore.kernel.org/git/" :address "git@@vger.kernel.org" :listid "git.vger.kernel.org" :coderepo "~/src/git/") ...) And it looks to me like it does: (alist :key-type string => "git" :value-type plist) => (:url ...) Before I was specifying that the plist values should be strings, but, given that :coderepo can now be a list of strings, this patch loosens the plist type to its default value type (sexp). >> - (when-let ((coderepo >> + (when-let ((coderepos >> (and (eq prop-name :coderepo) >> - (car (gethash >> - (format "coderepo.%s.dir" (car val)) >> - pi-cfg))))) >> + (mapcar >> + (lambda (v) >> + (car (gethash (format "coderepo.%s.dir" v) >> + pi-cfg))) >> + val)))) > > Does it mean that :coderepo "a single string" format is no longer supported? A string value is still supported. This mapcar is working with the values returned by piem--git-config-list, and that returns all values as a list of strings. (Notice in the pre-image above its `(car val)`.)