summaryrefslogtreecommitdiff
path: root/guix/diagnostics.scm
AgeCommit message (Expand)Author
2023-05-31diagnostics: Factorize 'absolute-location'....* guix/scripts/style.scm (absolute-location): Move to... * guix/diagnostics.scm (absolute-location): ... here. * guix/upstream.scm (update-package-source): Use it. Ludovic Courtès
2022-05-31diagnostics: Fix typo about 0-indexed COL in location....* guix/diagnostics.scm (source-properties->location): The location column is 0-indexed, not 1-indexed (the same as in source-properties, so the code is accurate). Maxim Cournoyer
2022-04-08diagnostics: Turn diagnostic locations into hyperlinks....* guix/diagnostics.scm (print-diagnostic-prefix): Use 'location->hyperlink' when 'supports-hyperlinks?' returns true. Ludovic Courtès
2022-04-08ui: Move 'location->hyperlink' to (guix diagnostics)....* guix/ui.scm (location->hyperlink): Move to... * guix/diagnostics.scm: ... here. * guix/scripts/system/search.scm: Adjust imports accordingly. Ludovic Courtès
2021-11-17diagnostics: Add syntax to capture arguments' syntax-properties....* guix/diagnostics.scm (define-with-syntax-properties): Add it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret
2021-04-29diagnostics, ui: Adjust to 'read-error' and 'syntax-error' in Guile 3.0.6....* guix/diagnostics.scm (source-properties->location): Add clause for vectors. * guix/ui.scm (report-load-error): Tweak 'read-error' handling for 3.0.6. * tests/guix-package.sh: Relax regexp for the "unbound variable" diagnostic check. * tests/guix-system.sh: Adjust "missing closing paren" check for 3.0.6. * tests/records.scm (location-alist): New procedure. ("define-record-type* & wrong field specifier") ("define-record-type* & wrong field specifier, identifier") ("define-record-type* & duplicate initializers"): Use it. Ludovic Courtès
2020-07-25diagnostics: Add '&formatted-message'....This allows 'gettext' to be called on the format string at the site where the exception is caught (rather than the site where it's thrown). It also allows for argument highlighting. * guix/diagnostics.scm (&formatted-message): New condition type. (check-format-string): New procedure. (formatted-message): New macro. * guix/ui.scm (report-load-error): Add clause for 'formatted-message?'. (warn-about-load-error): Likewise. (call-with-error-handling): Likewise. (read/eval): Likewise. Ludovic Courtès
2020-07-25diagnostics: Add a procedural variant of diagnostic procedures....Callers can pass 'report-error', 'warning', etc. to 'apply'. * guix/diagnostics.scm (trivial-format-string?): New procedure, moved from... (highlight-argument): ... here. (define-diagnostic): Add 'identifier?' clause. (emit-diagnostic): New procedure. Ludovic Courtès
2020-07-25utils: Move '&fix-hint' to (guix diagnostics)....* guix/utils.scm (&fix-hint): Move to... * guix/diagnostics.scm (&fix-hint): ... here. * gnu.scm: Adjust imports accordingly. * gnu/system/mapped-devices.scm: Likewise. * guix/channels.scm: Likewise. * guix/profiles.scm: Likewise. * guix/scripts/system/reconfigure.scm: Likewise. * guix/ssh.scm: Likewise. Ludovic Courtès
2020-07-25utils: Move <location> and '&error-location' to (guix diagnostics)....* guix/utils.scm (<location>, source-properties->location) (location->source-properties, &error-location): Move to... * guix/diagnostics.scm: ... here. * gnu.scm: Adjust imports accordingly. * gnu/machine.scm: Likewise. * gnu/system.scm: Likewise. * gnu/tests.scm: Likewise. * guix/inferior.scm: Likewise. * tests/channels.scm: Likewise. * tests/packages.scm: Likewise. Ludovic Courtès
2019-08-28diagnostics: Avoid highlighting complete messages....* guix/diagnostics.scm (%highlight-argument): Don't highlight ARG if it contains white space. Ludovic Courtès
2019-06-03Add (guix diagnostics)....* guix/ui.scm (warning, info, report-error, leave) (location->string, guix-warning-port, program-name) (highlight-argument, %highlight-argument, define-diagnostic) (%warning-color, %info-color, %error-color) (print-diagnostic-prefix): Move to... * guix/diagnostics.scm: ... here. New file. * Makefile.am (MODULES): Add it. Ludovic Courtès