From e853d05dc1185cc5cf2a80cd64482c088511e32d Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Sun, 26 Nov 2023 12:36:50 -0300 Subject: [PATCH] home-services: shells: Use match-record-lambda instead of lambda with a single expression match-record --- modules/radix/home/services/shells.scm | 33 +++++++++++++------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/modules/radix/home/services/shells.scm b/modules/radix/home/services/shells.scm index b3c4ad8..f56d10c 100644 --- a/modules/radix/home/services/shells.scm +++ b/modules/radix/home/services/shells.scm @@ -61,23 +61,22 @@ (define (serialize-fish-abbreviations field-name val) #~(string-append - #$@(map (lambda (abbr) - (match-record abbr - (name pattern position marker expansion) - #~((@@ (ice-9 format) format) #f - "~%abbr --add '~a' \\~%~ - ~@[ --position ~a \\~%~]~ - ~@[ --regex \"~a\" \\~%~]~ - ~@[ --set-cursor=~a \\~%~]~ - ~@[ ~a~]~%" - '#$name - '#$position - #$pattern - #$marker - #$(if (fish-function? expansion) - (format #f "--function ~a" - (fish-function-name expansion)) - (format #f "\"~a\"" expansion))))) + #$@(map (match-record-lambda + (name pattern position marker expansion) + #~((@@ (ice-9 format) format) #f + "~%abbr --add '~a' \\~%~ + ~@[ --position ~a \\~%~]~ + ~@[ --regex \"~a\" \\~%~]~ + ~@[ --set-cursor=~a \\~%~]~ + ~@[ ~a~]~%" + '#$name + '#$position + #$pattern + #$marker + #$(if (fish-function? expansion) + (format #f "--function ~a" + (fish-function-name expansion)) + (format #f "\"~a\"" expansion)))) val))) (define (serialize-fish-env-vars field-name val)