aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-06-17 12:36:01 +0200
committerLars Ingebrigtsen2019-06-17 12:36:01 +0200
commite6f2f5ace17fa752194f94f6762d3684d0d5b40a (patch)
tree064cbc0391b69ac1595f44c97db65e360982ed84
parentc90fc19c6ca27c2e280c5f0cdc0e2299c033f355 (diff)
downloademacs-e6f2f5ace17fa752194f94f6762d3684d0d5b40a.tar.gz
emacs-e6f2f5ace17fa752194f94f6762d3684d0d5b40a.zip
Make do-after-load-evaluation check whether warnings are enabled.
* lisp/subr.el (do-after-load-evaluation): Heed `byte-compile-warning-enabled-p', if defined. This allows suppressing the warning about packages being obsolete.
-rw-r--r--lisp/subr.el39
1 files changed, 21 insertions, 18 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index d505eb3917f..66568b795de 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4442,25 +4442,28 @@ This function is called directly from the C code."
4442 (when (string-match-p "/obsolete/\\([^/]*\\)\\'" abs-file) 4442 (when (string-match-p "/obsolete/\\([^/]*\\)\\'" abs-file)
4443 ;; Maybe we should just use display-warning? This seems yucky... 4443 ;; Maybe we should just use display-warning? This seems yucky...
4444 (let* ((file (file-name-nondirectory abs-file)) 4444 (let* ((file (file-name-nondirectory abs-file))
4445 (msg (format "Package %s is obsolete!" 4445 (package (intern (substring file 0
4446 (substring file 0 4446 (string-match "\\.elc?\\>" file))
4447 (string-match "\\.elc?\\>" file))))) 4447 obarray))
4448 (msg (format "Package %s is obsolete" package)))
4448 ;; Cribbed from cl--compiling-file. 4449 ;; Cribbed from cl--compiling-file.
4449 (if (and (boundp 'byte-compile--outbuffer) 4450 (when (or (not (fboundp 'byte-compile-warning-enabled-p))
4450 (bufferp (symbol-value 'byte-compile--outbuffer)) 4451 (byte-compile-warning-enabled-p 'obsolete package))
4451 (equal (buffer-name (symbol-value 'byte-compile--outbuffer)) 4452 (if (and (boundp 'byte-compile--outbuffer)
4452 " *Compiler Output*")) 4453 (bufferp (symbol-value 'byte-compile--outbuffer))
4453 ;; Don't warn about obsolete files using other obsolete files. 4454 (equal (buffer-name (symbol-value 'byte-compile--outbuffer))
4454 (unless (and (stringp byte-compile-current-file) 4455 " *Compiler Output*"))
4455 (string-match-p "/obsolete/[^/]*\\'" 4456 ;; Don't warn about obsolete files using other obsolete files.
4456 (expand-file-name 4457 (unless (and (stringp byte-compile-current-file)
4457 byte-compile-current-file 4458 (string-match-p "/obsolete/[^/]*\\'"
4458 byte-compile-root-dir))) 4459 (expand-file-name
4459 (byte-compile-warn "%s" msg)) 4460 byte-compile-current-file
4460 (run-with-timer 0 nil 4461 byte-compile-root-dir)))
4461 (lambda (msg) 4462 (byte-compile-warn "%s" msg))
4462 (message "%s" msg)) 4463 (run-with-timer 0 nil
4463 msg)))) 4464 (lambda (msg)
4465 (message "%s" msg))
4466 msg)))))
4464 4467
4465 ;; Finally, run any other hook. 4468 ;; Finally, run any other hook.
4466 (run-hook-with-args 'after-load-functions abs-file)) 4469 (run-hook-with-args 'after-load-functions abs-file))