[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/06: ui: Add an 'unbound-variable' exception printer.
From: |
Ludovic Courtès |
Subject: |
03/06: ui: Add an 'unbound-variable' exception printer. |
Date: |
Thu, 9 Nov 2017 17:56:45 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit dc856223f5eab57d8a4881782ec0f50abd12afa3
Author: Ludovic Courtès <address@hidden>
Date: Thu Nov 9 23:31:18 2017 +0100
ui: Add an 'unbound-variable' exception printer.
* guix/ui.scm (print-unbound-variable-error): New variable.
Use it as the 'unbound-variable' printer.
---
guix/ui.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/guix/ui.scm b/guix/ui.scm
index 9f790b6..05782a5 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -149,6 +149,18 @@ messages."
(report-error args ...)
(exit 1)))
+(define (print-unbound-variable-error port key args default-printer)
+ ;; Print unbound variable errors more nicely, and in the right language.
+ (match args
+ ((proc message (variable) _ ...)
+ ;; We can always omit PROC because when it's useful (i.e., different from
+ ;; "module-lookup"), it gets displayed before.
+ (format port (G_ "~a: unbound variable") variable))
+ (_
+ (default-printer))))
+
+(set-exception-printer! 'unbound-variable print-unbound-variable-error)
+
(define (make-user-module modules)
"Return a new user module with the additional MODULES loaded."
;; Module in which the machine description file is loaded.
- branch master updated (d8f075c -> e99f045), Ludovic Courtès, 2017/11/09
- 03/06: ui: Add an 'unbound-variable' exception printer.,
Ludovic Courtès <=
- 02/06: ui: Provide hints for unbound-variable errors., Ludovic Courtès, 2017/11/09
- 01/06: ui: Add 'display-hint'., Ludovic Courtès, 2017/11/09
- 05/06: gnu: emacs-ahungry-theme: Update to 1.8.0., Ludovic Courtès, 2017/11/09
- 06/06: gnu: Add r-directlabels., Ludovic Courtès, 2017/11/09
- 04/06: gnu: Add nxbelld., Ludovic Courtès, 2017/11/09