diff options
Diffstat (limited to 'lisp/progmodes/flymake.el')
-rw-r--r-- | lisp/progmodes/flymake.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index bd308e02203..8481a27775f 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -284,16 +284,17 @@ If set to nil, don't suppress any zero counters." (defmacro flymake-log (level msg &rest args) "Log, at level LEVEL, the message MSG formatted with ARGS. LEVEL is passed to `display-warning', which is used to display -the warning. If this form is included in a byte-compiled file, +the warning. If this form is included in a file, the generated warning contains an indication of the file that generated it." - (let* ((compile-file (macroexp-file-name)) - (sublog (if (and - compile-file - (not load-file-name)) + (let* ((file (if (fboundp 'macroexp-file-name) + (macroexp-file-name) + (and (not load-file-name) + (bound-and-true-p byte-compile-current-file)))) + (sublog (if file (intern (file-name-nondirectory - (file-name-sans-extension compile-file)))))) + (file-name-sans-extension file)))))) `(flymake--log-1 ,level ',sublog ,msg ,@args))) (defun flymake-error (text &rest args) |