home-services: shells: Use match-record-lambda instead of lambda with a single expression match-record

pull/1/head
Luis Guilherme Coelho 2023-11-26 12:36:50 -03:00
parent bd7484f873
commit e853d05dc1
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
1 changed files with 16 additions and 17 deletions

View File

@ -61,23 +61,22 @@
(define (serialize-fish-abbreviations field-name val)
#~(string-append
#$@(map (lambda (abbr)
(match-record abbr <abbreviation>
(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 <abbreviation>
(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)