all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oleg Pykhalov <go.wigust@gmail.com>
To: 33836@debbugs.gnu.org
Subject: [bug#33836] [PATCH 1/2] services: configuration: Add location.
Date: Sun, 23 Dec 2018 18:40:20 +0300	[thread overview]
Message-ID: <20181223154021.14287-1-go.wigust@gmail.com> (raw)
In-Reply-To: <874lb45nov.fsf@gmail.com>

* gnu/services/configuration.scm (define-configuration): Add location.
* gnu/services/mail.scm (namespace-configuration)[location]: Rename to
'mailbox-location'.
(uglify-field-name): Handle this.
* doc/guix.texi (Mail Services): Document this.
---
 doc/guix.texi                  |  2 +-
 gnu/services/configuration.scm |  5 +++++
 gnu/services/mail.scm          | 11 +++++++----
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index e254b3859..a6db2461d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -14665,7 +14665,7 @@ different for all namespaces. For example @samp{Public/}.
 Defaults to @samp{""}.
 @end deftypevr
 
-@deftypevr {@code{namespace-configuration} parameter} string location
+@deftypevr {@code{namespace-configuration} parameter} string mailbox-location
 Physical location of the mailbox. This is in the same format as
 mail_location, which is also the default for it.
 Defaults to @samp{""}.
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 707944cbe..9775f91ff 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -22,6 +22,7 @@
   #:use-module (guix packages)
   #:use-module (guix records)
   #:use-module (guix gexp)
+  #:use-module ((guix utils) #:select (source-properties->location))
   #:autoload   (texinfo) (texi-fragment->stexi)
   #:autoload   (texinfo serialize) (stexi->texi)
   #:use-module (ice-9 match)
@@ -129,6 +130,10 @@
                  #,(id #'stem #'% #'stem)
                  #,(id #'stem #'make- #'stem)
                  #,(id #'stem #'stem #'?)
+                 (location configuration-location
+                           (default (and=> (current-source-location)
+                                           source-properties->location))
+                           (innate))
                  (field field-getter (default def))
                  ...)
                (define #,(id #'stem #'stem #'-fields)
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index fcaedd038..a8121e5d1 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -75,9 +75,12 @@
 
 (define (uglify-field-name field-name)
   (let ((str (symbol->string field-name)))
-    (string-join (string-split (if (string-suffix? "?" str)
-                                   (substring str 0 (1- (string-length str)))
-                                   str)
+    (string-join (string-split (cond
+                                ((string-suffix? "?" str)
+                                 (substring str 0 (1- (string-length str))))
+                                ((string=? str "mailbox-location")
+                                 "location")
+                                (else str))
                                #\-)
                  "_")))
 
@@ -413,7 +416,7 @@ format.")
    "Prefix required to access this namespace.  This needs to be
 different for all namespaces. For example @samp{Public/}.")
 
-  (location
+  (mailbox-location
    (string "")
    "Physical location of the mailbox. This is in same format as
 mail_location, which is also the default for it.")
-- 
2.20.1

  parent reply	other threads:[~2018-12-23 15:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-22 20:38 [bug#33836] [PATCH 0/2] location in define-configuration Oleg Pykhalov
2018-12-22 20:42 ` [bug#33836] [PATCH 1/2] services: configuration: Add location Oleg Pykhalov
2018-12-22 20:42   ` [bug#33836] [PATCH 2/2] services: zabbix-front-end: Show location in messages Oleg Pykhalov
2018-12-23 14:21   ` [bug#33836] [PATCH 1/2] services: configuration: Add location Oleg Pykhalov
2018-12-23 15:36     ` [bug#33836] [PATCH] services: zabbix-front-end: Show location in messages Oleg Pykhalov
2018-12-26 17:31       ` Ludovic Courtès
2018-12-23 15:40     ` Oleg Pykhalov [this message]
2018-12-26 17:30       ` [bug#33836] [PATCH 1/2] services: configuration: Add location Ludovic Courtès
2019-02-15 22:24         ` Ludovic Courtès
2019-02-28 22:39           ` [bug#33836] [PATCH 0/2] Apply suggestions Oleg Pykhalov
2019-02-28 22:40             ` [bug#33836] [PATCH 1/2] services: configuration: Add '%location' Oleg Pykhalov
2019-02-28 22:40             ` [bug#33836] [PATCH 2/2] services: zabbix-front-end: Show location in messages Oleg Pykhalov
2019-03-10 17:21             ` [bug#33836] [PATCH 0/2] Apply suggestions Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181223154021.14287-1-go.wigust@gmail.com \
    --to=go.wigust@gmail.com \
    --cc=33836@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.