~abcdw/rde-devel

gnu: home-services: mail: Improve serialization for Isync service. v1 APPLIED

Xinglu Chen: 1
 gnu: home-services: mail: Improve serialization for Isync service.

 1 files changed, 16 insertions(+), 1 deletions(-)
That’s what we have ‘boolean->true-or-false’ in (gnu
home-services-utils) for.  :)
Next
Xinglu Chen <public@yoctocell.xyz> writes:
Next
Andrew Tropin <andrew@trop.in> writes:
Next
Xinglu Chen <public@yoctocell.xyz> writes:
Next
Xinglu Chen <public@yoctocell.xyz> writes:
Next
This is a current format.
Next
Let's call this option 4.
Next
Xinglu Chen <public@yoctocell.xyz> writes:
Next
Xinglu Chen <public@yoctocell.xyz> writes:
Next
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~abcdw/rde-devel/patches/23370/mbox | git am -3
Learn more about email & git

[PATCH] gnu: home-services: mail: Improve serialization for Isync service. Export this patch

* mail.scm (%isync-all-caps-words): New variable.
(serialize-isync-config): Serialize symbols according to the Isync
naming conventions.  Serialize numbers.
---
The naming of symbols should be consistent across services, one
shouldn’t have to write 'symbol-name in one field and 'SymbolName in
another field.  Guix should take care of serializing 'symbol-name to
whatever format the program expects (camelCase, snake_case, etc.).
 gnu/home-services/mail.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/home-services/mail.scm b/gnu/home-services/mail.scm
index bfb4284..f3a03c0 100644
--- a/gnu/home-services/mail.scm
+++ b/gnu/home-services/mail.scm
@@ -14,10 +14,25 @@
  #:export (home-isync-service-type
	    home-isync-configuration))

(define %isync-all-caps-words
  '("ssl" "imap" "starttls" "imaps"))

(define (serialize-isync-config field-name val)
  ;; imap-store => IMAPStore
  ;; user => User
  (define (serialize-symbol symbol)
    (let* ((str (symbol->string symbol)))
      (string-join (map (lambda (word)
                          (if (member word %isync-all-caps-words)
                              (string-upcase word)
                              (string-capitalize word)))
                        (string-split str #\-))
                   "")))

  (define (serialize-term term)
    (match term
      ((? symbol? e) (symbol->string e))
      ((? symbol? e) (serialize-symbol e))
      ((? number? e) (format #f "~a" e))
      ((? string? e) (format #f "~s" e))
      (e e)))
  (define (serialize-item entry)

base-commit: 4317b9d171377b51547df3e2cc8dff80f65e47bb
-- 
2.32.0
Xinglu Chen <public@yoctocell.xyz> writes: