summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2017-10-03 16:08:04 +0200
committerMichael Albinus <michael.albinus@gmx.de>2017-10-03 16:08:04 +0200
commit4ac5ac50c94b20acdad3746ee168a72d8dd18b4f (patch)
treee9075ad4924581420080d0fe2757360d58762b31 /lisp/emacs-lisp/bytecomp.el
parenta9ac20c179e62f69c77a068f6107e4b186e4c24d (diff)
parentca08b6954974555ba929b4f9b6b0a52d48d1f8e6 (diff)
downloademacs-4ac5ac50c94b20acdad3746ee168a72d8dd18b4f.tar.gz
emacs-4ac5ac50c94b20acdad3746ee168a72d8dd18b4f.tar.bz2
emacs-4ac5ac50c94b20acdad3746ee168a72d8dd18b4f.zip
Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs into emacs-26
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el22
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