|
From: | Ricardo Wurmus |
Subject: | Re: [PATCH 1/3] gwl/ui: Check for log-events configuration |
Date: | Sun, 12 Jun 2022 11:08:31 +0200 |
User-agent: | mu4e 1.6.10; emacs 28.1 |
Olivier Dion <olivier.dion@polymtl.ca> 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 > result. […] > +(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’t need the #t at the end of the “and”; the previous two values are already “truthy” or “falsy”. You could also do this: (and=> (%config 'log-events) (lambda (log-events) (or (member 'all log-events) (member type log-events)))) -- Ricardo
[Prev in Thread] | Current Thread | [Next in Thread] |