From 4e76a0aeb91348843d779b47372563e977132a29 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 25 May 2020 05:33:07 +0530 Subject: utils: Introduce the not-end-let utility. * email/utils.scm (not-end-let): New macro. * .dir-locals.el (scheme-mode): Indent not-end-let correctly. --- email/utils.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'email') diff --git a/email/utils.scm b/email/utils.scm index 984f07e..97c1b5a 100644 --- a/email/utils.scm +++ b/email/utils.scm @@ -35,6 +35,14 @@ acons* alist-combine)) +(define-syntax-rule (not-end-let (var expr) body ...) + "Bind result of EXPR to VAR. If VAR is an end-of-file object, return +it. Else, execute BODY." + (let ((var expr)) + (if (eof-object? var) + var + (begin body ...)))) + (define (read-objects read-proc port) "Read all objects using READ-PROC from PORT and return them as a list." -- cgit v1.2.3