diff options
Diffstat (limited to 'guix/ui.scm')
-rw-r--r-- | guix/ui.scm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/guix/ui.scm b/guix/ui.scm index 447c3a9a9f..4fc0dd089a 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -23,12 +23,14 @@ #:use-module (guix packages) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) + #:use-module (ice-9 match) #:export (_ N_ leave show-version-and-exit call-with-error-handling - with-error-handling)) + with-error-handling + location->string)) ;;; Commentary: ;;; @@ -80,4 +82,11 @@ (lambda () body ...))))) +(define (location->string loc) + "Return a human-friendly, GNU-standard representation of LOC." + (match loc + (#f (_ "<unknown location>")) + (($ <location> file line column) + (format #f "~a:~a:~a" file line column)))) + ;;; ui.scm ends here |