mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-23 12:00:21 +02:00
warnings written to warning port
* libguile/deprecation.c (scm_c_issue_deprecation_warning): * libguile/load.c (auto_compile_catch_handler): (scm_sys_warn_auto_compilation_enabled, scm_primitive_load_path): * module/ice-9/boot-9.scm (warn, %load-announce, duplicate-handlers) (load-in-vicinity): * module/system/base/message.scm (warning): Write to the warning port. (*current-warning-port*): Alias the warning port.
This commit is contained in:
parent
3972de7675
commit
2c27dd57c7
4 changed files with 28 additions and 26 deletions
|
@ -54,11 +54,13 @@
|
|||
;;; Warnings
|
||||
;;;
|
||||
|
||||
;; This name existed before %current-warning-port was introduced, but
|
||||
;; otherwise it is a deprecated binding.
|
||||
(define *current-warning-port*
|
||||
;; The port where warnings are sent.
|
||||
(make-fluid (current-error-port)))
|
||||
|
||||
(fluid-set! *current-warning-port* (current-error-port))
|
||||
;; Can't play the identifier-syntax deprecation game in Guile 2.0, as
|
||||
;; other modules might depend on this being a normal binding and not a
|
||||
;; syntax binding.
|
||||
(parameter-fluid current-warning-port))
|
||||
|
||||
(define *current-warning-prefix*
|
||||
;; Prefix string when emitting a warning.
|
||||
|
@ -194,7 +196,7 @@
|
|||
"Emit a warning of type TYPE for source location LOCATION (a source
|
||||
property alist) using the data in ARGS."
|
||||
(let ((wt (lookup-warning-type type))
|
||||
(port (fluid-ref *current-warning-port*)))
|
||||
(port (current-warning-port)))
|
||||
(if (warning-type? wt)
|
||||
(apply (warning-type-printer wt)
|
||||
port (location-string location)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue