From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UD2LMuWtpWKGxgAAbAwnHQ (envelope-from ) for ; Sun, 12 Jun 2022 11:12:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wBmGMeWtpWITNgEAG6o9tA (envelope-from ) for ; Sun, 12 Jun 2022 11:12:05 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 886197FCB for ; Sun, 12 Jun 2022 11:12:05 +0200 (CEST) Received: from localhost ([::1]:49270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0Jdc-0005wx-L2 for larch@yhetil.org; Sun, 12 Jun 2022 05:12:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0JdZ-0005vB-Op for gwl-devel@gnu.org; Sun, 12 Jun 2022 05:12:01 -0400 Received: from sender4-of-o50.zoho.com ([136.143.188.50]:21081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0JdY-0007gM-4q for gwl-devel@gnu.org; Sun, 12 Jun 2022 05:12:01 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1655025118; cv=none; d=zohomail.com; s=zohoarc; b=BAcsVUIhUWpvjvxVQ9oXdvbbOdAu8YzLcmnXy+NmSpdBiasqnCor5bUV4Kdn0TZP1S+WCiV7H8AGpm9vk8Y/Zxibukn7T9fG40pHyoHexTa9TzcqhEQioQJQFzo8GDiq4imEd7uc/iFGHYGJJEKYe+Vlsc34dS/lDsM/DrE5SDc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655025118; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=tFQCWqJzADJKNz/zJkx742mY6Zhe3Tky3BWB6EHkPW0=; b=N9p5e0uaznm6OcZ87O111quox7vRYP5UfP5RNeZtbTTGEl5wyfugKvrLikDCIzBv5R4qWhrjCJy0Gh4jRTttDsQBldeg7Oaxsh2vuxYfSyNNsiz49Q/yq0med6CGNiUBJxy8jmnIApEdlciel52XAI/rsfvAqSLBLGfLXNgTUsY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1655025118; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:In-reply-to:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=tFQCWqJzADJKNz/zJkx742mY6Zhe3Tky3BWB6EHkPW0=; b=EG/I/mCRae0dYY7JnOiZQi/TXHe3HI81SzEMqGb1L3X6ccTNZCLDUHva4PWXfm6h L2GkzWAEyNbzWcC1sseAoG9so2GVZ2ySNGpferb3/Pcq4jebFaESofZXFnoJfTRnZQB Ef6iFXroYBAX3FjID7amqH7azw5nIwdY5OJjua48= Received: from localhost (120-110-142-46.pool.kielnet.net [46.142.110.120]) by mx.zohomail.com with SMTPS id 1655025116124548.6078974628577; Sun, 12 Jun 2022 02:11:56 -0700 (PDT) References: <20220603183203.11092-1-olivier.dion@polymtl.ca> <20220606194900.27725-1-olivier.dion@polymtl.ca> User-agent: mu4e 1.6.10; emacs 28.1 From: Ricardo Wurmus To: Olivier Dion Cc: gwl-devel@gnu.org Subject: Re: [PATCH 1/3] gwl/ui: Check for log-events configuration Date: Sun, 12 Jun 2022 11:08:31 +0200 In-reply-to: <20220606194900.27725-1-olivier.dion@polymtl.ca> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Message-ID: <87mtei1c12.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.50; envelope-from=rekado@elephly.net; helo=sender4-of-o50.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: gwl-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gwl-devel-bounces+larch=yhetil.org@gnu.org Sender: "gwl-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655025125; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=tFQCWqJzADJKNz/zJkx742mY6Zhe3Tky3BWB6EHkPW0=; b=O7SzFoL1a6jiXlk65nYzTTjnNumNyMWqugt+7NPah2XRs5NhNUQzTAsdgTAXGYXu0LGNof Bcu14yCaldHUg0OpRYVc5+ytzeLCnx1Ki+VkzJhjc/Qv+SQ89l2PbbCJoSRUE1T/QLG1ja f4ZEsPpWYmqrnVS0/mZrl/MzlQ7M+0kxmYQwIrrBlj0Wg89PJx9CPdt8pJbwfnh+J2i4fx KOJ8hdnU8bSP35dUx/EizJ7gjI4XMWhlgvHTV6zJIH59tdEeEfboWdFeHpQ1iEk3eSnOp3 +csktH0H65TEZsHANLk0DKgMcCBzrp9DxbLx/xmMEIZVe2aQCm5b1xq4wRMtMg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1655025125; a=rsa-sha256; cv=pass; b=nJjlN0iXMfBjbHeFJx4DaJC+FT7rbwDDiYrM8wHFTMO1JAhvQOwiLNiOHXJU90fO+UJdiY RIFRg/EBUJQYgih9/KsKmuFce6E3frmFDGEb13qdhJSF3ss1aYYocc9Iw/QlzeGQWu90x3 Amf1pNynnbhFdYNvf4fJMZNAQZcOtjyQn/Xe+YcAyhmvxsBxrWpn7e4w6RzFHt6HWR7FfV YcZbdrCc728hsAob/jezV2/0rZpUJ8OCaW5WzXznlHJV1vl3bkWiYxuBbvgZ9CRZQSuoES CI84CPXAzE8bGFRVAlTf77oHseLHRZ47B7sIAT591bBfSkCId4a0iO5lfeWoYA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=elephly.net header.s=zoho header.b="EG/I/mCR"; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -9.49 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=elephly.net header.s=zoho header.b="EG/I/mCR"; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of "gwl-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="gwl-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 886197FCB X-Spam-Score: -9.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: vlowEgUsSrtf Olivier Dion writes: > Some GWL sub-commands might not accept the log-events switch. > This results in returning `#f' from `(%config 'log-events)' > > Fix this by checking that 'log-events was configured. Also memoize the r= esult. [=E2=80=A6] > +(define print? > + (mlambdaq (type) > + (let ((log-events (%config 'log-events))) > + (and log-events > + (or (member 'all log-events) > + (member type log-events)) > + #t)))) > + You don=E2=80=99t need the #t at the end of the =E2=80=9Cand=E2=80=9D; the = previous two values are already =E2=80=9Ctruthy=E2=80=9D or =E2=80=9Cfalsy=E2=80=9D. You could also do this: (and=3D> (%config 'log-events) (lambda (log-events) (or (member 'all log-events) (member type log-events)))) --=20 Ricardo