emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114235: * subr.el (do-after-load-evaluation): Also


From: Glenn Morris
Subject: [Emacs-diffs] trunk r114235: * subr.el (do-after-load-evaluation): Also give compiler warnings
Date: Thu, 12 Sep 2013 06:37:15 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114235
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2013-09-11 23:37:02 -0700
message:
  * subr.el (do-after-load-evaluation): Also give compiler warnings
  when obsolete files are used (except by obsolete files).
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/subr.el                   subr.el-20091113204419-o5vbwnq5f7feedwu-151
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-09-12 06:21:33 +0000
+++ b/lisp/ChangeLog    2013-09-12 06:37:02 +0000
@@ -1,5 +1,8 @@
 2013-09-12  Glenn Morris  <address@hidden>
 
+       * subr.el (do-after-load-evaluation): Also give compiler warnings
+       when obsolete files are used (except by obsolete files).
+
        * vc/vc-svn.el (vc-svn-parse-status): If there are multiple files
        in the status output, assume `filename' is the first.  (Bug#15322)
 

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2013-09-10 15:30:10 +0000
+++ b/lisp/subr.el      2013-09-12 06:37:02 +0000
@@ -3907,12 +3907,27 @@
       (mapc #'funcall (cdr a-l-element))))
   ;; Complain when the user uses obsolete files.
   (when (string-match-p "/obsolete/[^/]*\\'" abs-file)
-    (run-with-timer 0 nil
-                    (lambda (file)
-                      (message "Package %s is obsolete!"
-                               (substring file 0
-                                          (string-match "\\.elc?\\>" file))))
-                    (file-name-nondirectory abs-file)))
+    ;; Maybe we should just use display-warning?  This seems yucky...
+    (let* ((file (file-name-nondirectory abs-file))
+          (msg (format "Package %s is obsolete!"
+                       (substring file 0
+                                  (string-match "\\.elc?\\>" file)))))
+      ;; Cribbed from cl--compiling-file.
+      (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-log-warning msg))
+       (run-with-timer 0 nil
+                       (lambda (msg)
+                         (message "%s" msg)) 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]