dgnushack.el (dgnushack-compile, dgnushack-make-cus-load, dgnushack-make-auto-load...
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 6 Sep 2010 05:09:14 +0000 (05:09 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 6 Sep 2010 05:09:14 +0000 (05:09 +0000)
lisp/ChangeLog
lisp/dgnushack.el

index 1bc7f3e..24240e5 100644 (file)
@@ -1,5 +1,8 @@
 2010-09-06  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * dgnushack.el (dgnushack-compile, dgnushack-make-cus-load)
+       (dgnushack-make-auto-load): Exclude .dir-locals.el file.
+
        * pop3.el: Require cl when compiling.
        (pop3-number-of-responses): Search for "+OK", not "+OK ".
 
index ee4410a..dc256bb 100644 (file)
@@ -308,7 +308,8 @@ dgnushack-compile."
   (unless warn
     (setq byte-compile-warnings
          '(free-vars unresolved callargs redefine)))
-  (let ((files (directory-files srcdir nil "^[^=].*\\.el$"))
+  (let ((files (delete ".dir-locals.el"
+                      (directory-files srcdir nil "^[^=].*\\.el$")))
        ;;(byte-compile-generate-call-tree t)
        file elc)
     ;; Avoid barfing (from gnus-xmas) because the etc directory is not yet
@@ -373,9 +374,16 @@ dgnushack-compile."
 (defun dgnushack-make-cus-load ()
   (load "cus-dep")
   (let ((cusload-base-file dgnushack-cus-load-file))
-    (if (fboundp 'custom-make-dependencies)
-       (custom-make-dependencies)
-      (Custom-make-dependencies))
+    (defadvice directory-files (after exclude-dir-locals activate)
+      "Exclude .dir-locals.el file."
+      (dolist (file ad-return-value)
+       (if (string-match "/?\\.dir-locals\\.el\\'" file)
+           (setq ad-return-value (delete file ad-return-value)))))
+    (unwind-protect
+       (if (fboundp 'custom-make-dependencies)
+           (custom-make-dependencies)
+         (Custom-make-dependencies))
+      (ad-unadvise 'directory-files))
     (when (featurep 'xemacs)
       (message "Compiling %s..." dgnushack-cus-load-file)
       (byte-compile-file dgnushack-cus-load-file))))
@@ -404,7 +412,14 @@ dgnushack-compile."
            (delete-file generated-autoload-file))
       (with-temp-file generated-autoload-file
        (insert ?\014)))
-    (batch-update-autoloads)))
+    (defadvice directory-files (after exclude-dir-locals activate)
+      "Exclude .dir-locals.el file."
+      (dolist (file ad-return-value)
+       (if (string-match "/?\\.dir-locals\\.el\\'" file)
+           (setq ad-return-value (delete file ad-return-value)))))
+    (unwind-protect
+       (batch-update-autoloads)
+      (ad-unadvise 'directory-files))))
 
 (defun dgnushack-make-load ()
   (unless (featurep 'xemacs)