emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 50b5239: * lisp/subr.el (do-after-load-evaluation): Handle batch


From: Stefan Monnier
Subject: master 50b5239: * lisp/subr.el (do-after-load-evaluation): Handle batch mode as well
Date: Tue, 26 Nov 2019 13:58:47 -0500 (EST)

branch: master
commit 50b52390ee5894e91965bd37f2d0c571df1e2e89
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/subr.el (do-after-load-evaluation): Handle batch mode as well
---
 lisp/subr.el | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index 20daed6..fe55566 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4599,31 +4599,31 @@ This function is called directly from the C code."
       ;; discard the file name regexp
       (mapc #'funcall (cdr a-l-element))))
   ;; Complain when the user uses obsolete files.
-  (when (string-match-p "/obsolete/\\([^/]*\\)\\'" abs-file)
+  (when (string-match-p "/obsolete/[^/]*\\'" abs-file)
     ;; Maybe we should just use display-warning?  This seems yucky...
     (let* ((file (file-name-nondirectory abs-file))
            (package (intern (substring file 0
                                       (string-match "\\.elc?\\>" file))
                             obarray))
-          (msg (format "Package %s is deprecated" package)))
+          (msg (format "Package %s is deprecated" package))
+          (fun (lambda (msg) (minibuffer-message "%s" msg))))
       ;; Cribbed from cl--compiling-file.
       (when (or (not (fboundp 'byte-compile-warning-enabled-p))
                 (byte-compile-warning-enabled-p 'obsolete package))
-        (if (and (boundp 'byte-compile--outbuffer)
-                (bufferp (symbol-value 'byte-compile--outbuffer))
-                (equal (buffer-name (symbol-value 'byte-compile--outbuffer))
-                       " *Compiler Output*"))
-           ;; Don't warn about obsolete files using other obsolete files.
-           (unless (and (stringp byte-compile-current-file)
-                        (string-match-p "/obsolete/[^/]*\\'"
-                                        (expand-file-name
-                                         byte-compile-current-file
-                                         byte-compile-root-dir)))
-             (byte-compile-warn "%s" msg))
-         (run-with-idle-timer 0 nil
-                         (lambda (msg)
-                           (minibuffer-message "%s" msg))
-                         msg)))))
+        (cond
+        ((and (boundp 'byte-compile--outbuffer)
+              (bufferp (symbol-value 'byte-compile--outbuffer))
+              (equal (buffer-name (symbol-value 'byte-compile--outbuffer))
+                     " *Compiler Output*"))
+         ;; Don't warn about obsolete files using other obsolete files.
+         (unless (and (stringp byte-compile-current-file)
+                      (string-match-p "/obsolete/[^/]*\\'"
+                                      (expand-file-name
+                                       byte-compile-current-file
+                                       byte-compile-root-dir)))
+           (byte-compile-warn "%s" msg)))
+         (noninteractive (funcall fun)) ;; No timer will be run!
+        (t (run-with-idle-timer 0 nil fun msg))))))
 
   ;; Finally, run any other hook.
   (run-hook-with-args 'after-load-functions abs-file))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]