]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/shadow.el
(end-of-defun): Consider the ".*\n" after the end of
[gnu-emacs] / lisp / emacs-lisp / shadow.el
index b36ce4a332e16bbb853b18cbac971e2d6dfa21fe..9b3f60ff75c4bf5d2b723e2c0d0c2b2a1696a6b1 100644 (file)
@@ -1,6 +1,7 @@
 ;;; shadow.el --- locate Emacs Lisp file shadowings
 
-;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Terry Jones <terry@santafe.edu>
 ;; Keywords: lisp
@@ -8,10 +9,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -92,7 +91,7 @@ See the documentation for `list-load-path-shadows' for further information."
       (setq dir (directory-file-name (file-truename (or (car path) "."))))
       (if (member dir true-names)
          ;; We have already considered this PATH redundant directory.
-         ;; Show the redundancy if we are interactiver, unless the PATH
+         ;; Show the redundancy if we are interactive, unless the PATH
          ;; dir is nil or "." (these redundant directories are just a
          ;; result of the current working directory, and are therefore
          ;; not always redundant).
@@ -104,7 +103,7 @@ See the documentation for `list-load-path-shadows' for further information."
        (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 +113,8 @@ See the documentation for `list-load-path-shadows' for further information."
        (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)))
 
@@ -167,8 +168,8 @@ See the documentation for `list-load-path-shadows' for further information."
 (defun list-load-path-shadows ()
   "Display a list of Emacs Lisp files that shadow other files.
 
-This function lists potential load-path problems.  Directories in the
-`load-path' variable are searched, in order, for Emacs Lisp
+This function lists potential load path problems.  Directories in
+the `load-path' variable are searched, in order, for Emacs Lisp
 files.  When a previously encountered file name is found again, a
 message is displayed indicating that the later file is \"hidden\" by
 the earlier.
@@ -181,17 +182,17 @@ and that each of these directories contains a file called XXX.el.  Then
 XXX.el in the site-lisp directory is referred to by all of:
 \(require 'XXX\), \(autoload .... \"XXX\"\), \(load-library \"XXX\"\) etc.
 
-The first XXX.el file prevents emacs from seeing the second \(unless
-the second is loaded explicitly via load-file\).
+The first XXX.el file prevents Emacs from seeing the second \(unless
+the second is loaded explicitly via `load-file'\).
 
 When not intended, such shadowings can be the source of subtle
 problems.  For example, the above situation may have arisen because the
-XXX package was not distributed with versions of emacs prior to
-19.30.  An emacs maintainer downloaded XXX from elsewhere and installed
-it.  Later, XXX was updated and included in the emacs distribution.
-Unless the emacs maintainer checks for this, the new version of XXX
+XXX package was not distributed with versions of Emacs prior to
+19.30.  An Emacs maintainer downloaded XXX from elsewhere and installed
+it.  Later, XXX was updated and included in the Emacs distribution.
+Unless the Emacs maintainer checks for this, the new version of XXX
 will be hidden behind the old \(which may no longer work with the new
-emacs version\).
+Emacs version\).
 
 This function performs these checks and flags all possible
 shadowings.  Because a .el file may exist without a corresponding .elc
@@ -209,7 +210,8 @@ buffer called `*Shadows*'.  Shadowings are located by calling the
        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)
@@ -257,5 +259,5 @@ version unless you know what you are doing.\n")
 
 (provide 'shadow)
 
-;;; arch-tag: 0480e8a7-62ed-4a12-a9f6-f44ded9b0830
+;; arch-tag: 0480e8a7-62ed-4a12-a9f6-f44ded9b0830
 ;;; shadow.el ends here