mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
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>.
This commit is contained in:
parent
5282181d51
commit
89d02b98f9
1 changed files with 7 additions and 5 deletions
12
guix/ui.scm
12
guix/ui.scm
|
@ -77,17 +77,19 @@ (define-syntax name
|
|||
(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)))
|
||||
|
|
Loading…
Reference in a new issue