diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2017-10-06 09:50:54 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2017-10-06 09:50:54 -0400 |
commit | 11f9cb522fed9aa6552f6315340ca7352661a1e8 (patch) | |
tree | 39facc48471c67b321c045e47d70ef030adbea44 /lisp/emacs-lisp/bytecomp.el | |
parent | 92045f4546b9708dc9f69954799d211c1f56ff1e (diff) | |
parent | 9655937da4a339300c624addd97674c038a01bc9 (diff) | |
download | emacs-11f9cb522fed9aa6552f6315340ca7352661a1e8.tar.gz emacs-11f9cb522fed9aa6552f6315340ca7352661a1e8.tar.bz2 emacs-11f9cb522fed9aa6552f6315340ca7352661a1e8.zip |
Merge emacs-26
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 1b42961f1a4..590db570c56 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1183,7 +1183,29 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (compilation-forget-errors) pt)))) +(defvar byte-compile-log-warning-function + #'byte-compile--log-warning-for-byte-compile + "Function called when encountering a warning or error. +Called with arguments (STRING POSITION FILL LEVEL). STRING is a +message describing the problem. POSITION is a buffer position +where the problem was detected. FILL is a prefix as in +`warning-fill-prefix'. LEVEL is the level of the +problem (`:warning' or `:error'). POSITION, FILL and LEVEL may be +nil.") + (defun byte-compile-log-warning (string &optional fill level) + "Log a byte-compilation warning. +STRING, FILL and LEVEL are as described in +`byte-compile-log-warning-function', which see." + (funcall byte-compile-log-warning-function + string byte-compile-last-position + fill + level)) + +(defun byte-compile--log-warning-for-byte-compile (string &optional + _position + fill + level) "Log a message STRING in `byte-compile-log-buffer'. Also log the current function and file if not already done. If FILL is non-nil, set `warning-fill-prefix' to four spaces. LEVEL |