comparison lisp/emacs-lisp/shadow.el @ 49598:0d8b17d428b5

Trailing whitepace deleted.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 04 Feb 2003 13:24:35 +0000
parents f1f792410820
children 695cf19ef79e d7ddb3e565de
comparison
equal deleted inserted replaced
49597:e88404e8f2cf 49598:0d8b17d428b5
72 even-length list of files. A file in this list at position 2i shadows 72 even-length list of files. A file in this list at position 2i shadows
73 the file in position 2i+1. Emacs Lisp file suffixes \(.el and .elc\) 73 the file in position 2i+1. Emacs Lisp file suffixes \(.el and .elc\)
74 are stripped from the file names in the list. 74 are stripped from the file names in the list.
75 75
76 See the documentation for `list-load-path-shadows' for further information." 76 See the documentation for `list-load-path-shadows' for further information."
77 77
78 (or path (setq path load-path)) 78 (or path (setq path load-path))
79 79
80 (let (true-names ; List of dirs considered. 80 (let (true-names ; List of dirs considered.
81 shadows ; List of shadowings, to be returned. 81 shadows ; List of shadowings, to be returned.
82 files ; File names ever seen, with dirs. 82 files ; File names ever seen, with dirs.
84 curr-files ; This dir's Emacs Lisp files. 84 curr-files ; This dir's Emacs Lisp files.
85 orig-dir ; Where the file was first seen. 85 orig-dir ; Where the file was first seen.
86 files-seen-this-dir ; Files seen so far in this dir. 86 files-seen-this-dir ; Files seen so far in this dir.
87 file) ; The current file. 87 file) ; The current file.
88 88
89 89
90 (while path 90 (while path
91 91
92 (setq dir (directory-file-name (file-truename (or (car path) ".")))) 92 (setq dir (directory-file-name (file-truename (or (car path) "."))))
93 (if (member dir true-names) 93 (if (member dir true-names)
94 ;; We have already considered this PATH redundant directory. 94 ;; We have already considered this PATH redundant directory.
123 (member file '("subdirs"))) 123 (member file '("subdirs")))
124 ;; File has not been seen yet in this directory. 124 ;; File has not been seen yet in this directory.
125 ;; This test prevents us declaring that XXX.el shadows 125 ;; This test prevents us declaring that XXX.el shadows
126 ;; XXX.elc (or vice-versa) when they are in the same directory. 126 ;; XXX.elc (or vice-versa) when they are in the same directory.
127 (setq files-seen-this-dir (cons file files-seen-this-dir)) 127 (setq files-seen-this-dir (cons file files-seen-this-dir))
128 128
129 (if (setq orig-dir (assoc file files)) 129 (if (setq orig-dir (assoc file files))
130 ;; This file was seen before, we have a shadowing. 130 ;; This file was seen before, we have a shadowing.
131 ;; Report it unless the files are identical. 131 ;; Report it unless the files are identical.
132 (let ((base1 (concat (cdr orig-dir) "/" file)) 132 (let ((base1 (concat (cdr orig-dir) "/" file))
133 (base2 (concat dir "/" file))) 133 (base2 (concat dir "/" file)))
200 considered to shadow a later file XXX.el, and vice-versa. 200 considered to shadow a later file XXX.el, and vice-versa.
201 201
202 When run interactively, the shadowings \(if any\) are displayed in a 202 When run interactively, the shadowings \(if any\) are displayed in a
203 buffer called `*Shadows*'. Shadowings are located by calling the 203 buffer called `*Shadows*'. Shadowings are located by calling the
204 \(non-interactive\) companion function, `find-emacs-lisp-shadows'." 204 \(non-interactive\) companion function, `find-emacs-lisp-shadows'."
205 205
206 (interactive) 206 (interactive)
207 (let* ((path (copy-sequence load-path)) 207 (let* ((path (copy-sequence load-path))
208 (tem path) 208 (tem path)
209 toplevs) 209 toplevs)
210 ;; If we can find simple.el in two places, 210 ;; If we can find simple.el in two places,