diff options
| author | Stefan Monnier | 2019-11-26 13:58:39 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2019-11-26 13:58:39 -0500 |
| commit | 50b52390ee5894e91965bd37f2d0c571df1e2e89 (patch) | |
| tree | df2872e0aa334054c5fdaeb79481311798bc627a | |
| parent | 95e218af145d843750c9f05ae7682230a36044a6 (diff) | |
| download | emacs-50b52390ee5894e91965bd37f2d0c571df1e2e89.tar.gz emacs-50b52390ee5894e91965bd37f2d0c571df1e2e89.zip | |
* lisp/subr.el (do-after-load-evaluation): Handle batch mode as well
| -rw-r--r-- | lisp/subr.el | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 20daed623fe..fe55566b52d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -4599,31 +4599,31 @@ This function is called directly from the C code." | |||
| 4599 | ;; discard the file name regexp | 4599 | ;; discard the file name regexp |
| 4600 | (mapc #'funcall (cdr a-l-element)))) | 4600 | (mapc #'funcall (cdr a-l-element)))) |
| 4601 | ;; Complain when the user uses obsolete files. | 4601 | ;; Complain when the user uses obsolete files. |
| 4602 | (when (string-match-p "/obsolete/\\([^/]*\\)\\'" abs-file) | 4602 | (when (string-match-p "/obsolete/[^/]*\\'" abs-file) |
| 4603 | ;; Maybe we should just use display-warning? This seems yucky... | 4603 | ;; Maybe we should just use display-warning? This seems yucky... |
| 4604 | (let* ((file (file-name-nondirectory abs-file)) | 4604 | (let* ((file (file-name-nondirectory abs-file)) |
| 4605 | (package (intern (substring file 0 | 4605 | (package (intern (substring file 0 |
| 4606 | (string-match "\\.elc?\\>" file)) | 4606 | (string-match "\\.elc?\\>" file)) |
| 4607 | obarray)) | 4607 | obarray)) |
| 4608 | (msg (format "Package %s is deprecated" package))) | 4608 | (msg (format "Package %s is deprecated" package)) |
| 4609 | (fun (lambda (msg) (minibuffer-message "%s" msg)))) | ||
| 4609 | ;; Cribbed from cl--compiling-file. | 4610 | ;; Cribbed from cl--compiling-file. |
| 4610 | (when (or (not (fboundp 'byte-compile-warning-enabled-p)) | 4611 | (when (or (not (fboundp 'byte-compile-warning-enabled-p)) |
| 4611 | (byte-compile-warning-enabled-p 'obsolete package)) | 4612 | (byte-compile-warning-enabled-p 'obsolete package)) |
| 4612 | (if (and (boundp 'byte-compile--outbuffer) | 4613 | (cond |
| 4613 | (bufferp (symbol-value 'byte-compile--outbuffer)) | 4614 | ((and (boundp 'byte-compile--outbuffer) |
| 4614 | (equal (buffer-name (symbol-value 'byte-compile--outbuffer)) | 4615 | (bufferp (symbol-value 'byte-compile--outbuffer)) |
| 4615 | " *Compiler Output*")) | 4616 | (equal (buffer-name (symbol-value 'byte-compile--outbuffer)) |
| 4616 | ;; Don't warn about obsolete files using other obsolete files. | 4617 | " *Compiler Output*")) |
| 4617 | (unless (and (stringp byte-compile-current-file) | 4618 | ;; Don't warn about obsolete files using other obsolete files. |
| 4618 | (string-match-p "/obsolete/[^/]*\\'" | 4619 | (unless (and (stringp byte-compile-current-file) |
| 4619 | (expand-file-name | 4620 | (string-match-p "/obsolete/[^/]*\\'" |
| 4620 | byte-compile-current-file | 4621 | (expand-file-name |
| 4621 | byte-compile-root-dir))) | 4622 | byte-compile-current-file |
| 4622 | (byte-compile-warn "%s" msg)) | 4623 | byte-compile-root-dir))) |
| 4623 | (run-with-idle-timer 0 nil | 4624 | (byte-compile-warn "%s" msg))) |
| 4624 | (lambda (msg) | 4625 | (noninteractive (funcall fun)) ;; No timer will be run! |
| 4625 | (minibuffer-message "%s" msg)) | 4626 | (t (run-with-idle-timer 0 nil fun msg)))))) |
| 4626 | msg))))) | ||
| 4627 | 4627 | ||
| 4628 | ;; Finally, run any other hook. | 4628 | ;; Finally, run any other hook. |
| 4629 | (run-hook-with-args 'after-load-functions abs-file)) | 4629 | (run-hook-with-args 'after-load-functions abs-file)) |