aboutsummaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-05-30 00:49:34 +0200
committerLudovic Courtès <ludo@gnu.org>2013-05-30 00:49:34 +0200
commit89d02b98f90995b8c070ca1041a85711983584c7 (patch)
treef068d2367d3b698c08bf17114324283badc7f792 /guix/ui.scm
parent5282181d51202648d086f1f37c293dd03eee565f (diff)
downloadgnu-guix-89d02b98f90995b8c070ca1041a85711983584c7.tar
gnu-guix-89d02b98f90995b8c070ca1041a85711983584c7.tar.gz
ui: define-diagnostic: Don't mark `_' and `N_' as literals.
* guix/ui.scm (define-diagnostic): Use `free-identifier=?' to compare the user's input with `_' and `N-". This should fix builds with Guile 2.1. Reported by Cojocaru Alexandru <xojoc@gmx.com>.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index cd47989ca6..370b41b9dc 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -77,17 +77,19 @@ messages."
(define (augmented-format-string fmt)
(string-append "~:[~*~;guix ~a: ~]~a" (syntax->datum fmt)))
- (syntax-case x (N_ _) ; these are literals, yeah...
- ((name (_ fmt) args (... ...))
- (string? (syntax->datum #'fmt))
+ (syntax-case x ()
+ ((name (underscore fmt) args (... ...))
+ (and (string? (syntax->datum #'fmt))
+ (free-identifier=? #'underscore #'_))
(with-syntax ((fmt* (augmented-format-string #'fmt))
(prefix (datum->syntax x prefix)))
#'(format (guix-warning-port) (gettext fmt*)
(program-name) (program-name) prefix
args (... ...))))
- ((name (N_ singular plural n) args (... ...))
+ ((name (N-underscore singular plural n) args (... ...))
(and (string? (syntax->datum #'singular))
- (string? (syntax->datum #'plural)))
+ (string? (syntax->datum #'plural))
+ (free-identifier=? #'N-underscore #'N_))
(with-syntax ((s (augmented-format-string #'singular))
(p (augmented-format-string #'plural))
(prefix (datum->syntax x prefix)))