unofficial mirror of gwl-devel@gnu.org
 help / color / mirror / Atom feed
From: Olivier Dion <olivier.dion@polymtl.ca>
To: gwl-devel@gnu.org
Cc: Olivier Dion <olivier.dion@polymtl.ca>
Subject: [PATCH] gwl/ui: Check for log-events configuration
Date: Fri,  3 Jun 2022 14:32:03 -0400	[thread overview]
Message-ID: <20220603183203.11092-1-olivier.dion@polymtl.ca> (raw)

Some GWL sub-commands such as `graph' do not accept a log event configuration.
This results in returning `#f' from `(%config 'log-events)'

Fix this by checking that 'log-events was configured.
---
 gwl/ui.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gwl/ui.scm b/gwl/ui.scm
index 35bd127..92cf451 100644
--- a/gwl/ui.scm
+++ b/gwl/ui.scm
@@ -65,8 +65,10 @@
 
 (define (log-event type . message)
   (define print?
-    (or (member 'all (%config 'log-events))
-        (member type (%config 'log-events))))
+    (let ((log-events (%config 'log-events)))
+      (and log-events
+           (or (member 'all (%config 'log-events))
+               (member type (%config 'log-events))))))
   (when print?
     (case type
       ((error)
-- 
2.36.1



             reply	other threads:[~2022-06-03 18:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03 18:32 Olivier Dion [this message]
2022-06-04 15:00 ` [PATCH] gwl/ui: Check for log-events configuration Ricardo Wurmus
2022-06-04 15:10   ` Olivier Dion via
2022-06-06 10:32     ` Ricardo Wurmus
2022-06-06 13:25       ` Olivier Dion via
2022-06-06 18:51         ` Olivier Dion via
2022-06-06 19:48 ` [PATCH 1/3] " Olivier Dion
2022-06-06 19:48   ` [PATCH 2/3] gwl/config: Share log-event switch with subcommands Olivier Dion
2022-06-12  9:03     ` Ricardo Wurmus
2022-06-06 19:49   ` [PATCH 3/3] graph: Add output switch Olivier Dion
2022-06-12  9:05     ` Ricardo Wurmus
2022-06-12  9:08   ` [PATCH 1/3] gwl/ui: Check for log-events configuration Ricardo Wurmus

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.guixwl.org/

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

  git send-email \
    --in-reply-to=20220603183203.11092-1-olivier.dion@polymtl.ca \
    --to=olivier.dion@polymtl.ca \
    --cc=gwl-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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.
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).