aboutsummaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm10
1 files changed, 6 insertions, 4 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 7fbd4c63a2..334dce2c68 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -376,12 +376,14 @@ ARGS is the list of arguments received by the 'throw' handler."
(('system-error . rest)
(let ((err (system-error-errno args)))
(report-error (G_ "failed to load '~a': ~a~%") file (strerror err))))
- (('read-error "scm_i_lreadparen" message _ ...)
+ (('read-error _ message args ...)
;; Guile's missing-paren messages are obscure so we make them more
;; intelligible here.
- (if (string-suffix? "end of file" message)
- (let ((location (string-drop-right message
- (string-length "end of file"))))
+ (if (or (string-suffix? "end of file" message) ;Guile < 3.0.6
+ (and (string-contains message "unexpected end of input")
+ (member '(#\)) args)))
+ (let ((location (string-take message
+ (+ 2 (string-contains message ": ")))))
(format (current-error-port) (G_ "~amissing closing parenthesis~%")
location))
(apply throw args)))