changeset 67018:ef7892af4fa7

Handle compressed files.
author Andreas Schwab <schwab@suse.de>
date Sat, 19 Nov 2005 16:53:32 +0000
parents fb42f801f872
children 53c3a64c4d4f
files lisp/emacs-lisp/shadow.el
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/shadow.el	Sat Nov 19 15:57:20 2005 +0000
+++ b/lisp/emacs-lisp/shadow.el	Sat Nov 19 16:53:32 2005 +0000
@@ -104,7 +104,7 @@
 	(setq true-names (append true-names (list dir)))
 	(setq dir (directory-file-name (or (car path) ".")))
 	(setq curr-files (if (file-accessible-directory-p dir)
-			     (directory-files dir nil ".\\.elc?$" t)))
+			     (directory-files dir nil ".\\.elc?\\(\\.gz\\)?$" t)))
 	(and curr-files
 	     (not noninteractive)
 	     (message "Checking %d files in %s..." (length curr-files) dir))
@@ -114,6 +114,8 @@
 	(while curr-files
 
 	  (setq file (car curr-files))
+	  (if (string-match "\\.gz$" file)
+	      (setq file (substring file 0 -3)))
 	  (setq file (substring
 		      file 0 (if (string= (substring file -1) "c") -4 -3)))
 
@@ -209,7 +211,8 @@
 	toplevs)
     ;; If we can find simple.el in two places,
     (while tem
-      (if (file-exists-p (expand-file-name "simple.el" (car tem)))
+      (if (or (file-exists-p (expand-file-name "simple.el" (car tem)))
+	      (file-exists-p (expand-file-name "simple.el.gz" (car tem))))
 	  (setq toplevs (cons (car tem) toplevs)))
       (setq tem (cdr tem)))
     (if (> (length toplevs) 1)