aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-12 05:30:47 +0000
committerRichard M. Stallman1997-08-12 05:30:47 +0000
commit0cdbb11dee301e1537bcdab1f4ae53f2515db274 (patch)
tree02d5877e82a39b7c751f50a18f177cf1f13443ed
parent67f04586c37572504cfe52aed9e0c19ba640767f (diff)
downloademacs-0cdbb11dee301e1537bcdab1f4ae53f2515db274.tar.gz
emacs-0cdbb11dee301e1537bcdab1f4ae53f2515db274.zip
(list-load-path-shadows): Exclude, from the path we search, all but
the first set of directories that include the standard Emacs Lisp files.
-rw-r--r--lisp/emacs-lisp/shadow.el72
1 files changed, 47 insertions, 25 deletions
diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el
index 7e49c8b6f17..cca8b350731 100644
--- a/lisp/emacs-lisp/shadow.el
+++ b/lisp/emacs-lisp/shadow.el
@@ -173,34 +173,56 @@ buffer called `*Shadows*'. Shadowings are located by calling the
173\(non-interactive\) companion function, `find-emacs-lisp-shadows'." 173\(non-interactive\) companion function, `find-emacs-lisp-shadows'."
174 174
175 (interactive) 175 (interactive)
176 (let* ((shadows (find-emacs-lisp-shadows)) 176 (let* ((path (copy-sequence load-path))
177 (n (/ (length shadows) 2)) 177 (tem path)
178 (msg (format "%s Emacs Lisp load-path shadowing%s found" 178 toplevs)
179 (if (zerop n) "No" (concat "\n" (number-to-string n))) 179 ;; If we can find simple.el in two places,
180 (if (= n 1) " was" "s were")))) 180 (while tem
181 (if (interactive-p) 181 (if (file-exists-p (expand-file-name "simple.el" (car tem)))
182 (save-excursion 182 (setq toplevs (cons (car tem) toplevs)))
183 ;; We are interactive. 183 (setq tem (cdr tem)))
184 ;; Create the *Shadows* buffer and display shadowings there. 184 (if (> (length toplevs) 1)
185 (let ((output-buffer (get-buffer-create "*Shadows*"))) 185 ;; Cut off our copy of load-path right before
186 (display-buffer output-buffer) 186 ;; the second directory which has simple.el in it.
187 (set-buffer output-buffer) 187 ;; This avoids loads of duplications between the source dir
188 (erase-buffer) 188 ;; and the dir where these files were copied by installation.
189 (while shadows 189 (let ((break (nth (- (length toplevs) 2) toplevs)))
190 (insert (format "%s hides %s\n" (car shadows) 190 (setq tem path)
191 (car (cdr shadows)))) 191 (while tem
192 (setq shadows (cdr (cdr shadows)))) 192 (if (eq (nth 1 tem) break)
193 (insert msg "\n"))) 193 (progn
194 ;; We are non-interactive, print shadows via message. 194 (setcdr tem nil)
195 (when shadows 195 (setq tem nil)))
196 (message "This site has duplicate Lisp libraries with the same name. 196 (setq tem (cdr tem)))))
197
198 (let* ((shadows (find-emacs-lisp-shadows path))
199 (n (/ (length shadows) 2))
200 (msg (format "%s Emacs Lisp load-path shadowing%s found"
201 (if (zerop n) "No" (concat "\n" (number-to-string n)))
202 (if (= n 1) " was" "s were"))))
203 (if (interactive-p)
204 (save-excursion
205 ;; We are interactive.
206 ;; Create the *Shadows* buffer and display shadowings there.
207 (let ((output-buffer (get-buffer-create "*Shadows*")))
208 (display-buffer output-buffer)
209 (set-buffer output-buffer)
210 (erase-buffer)
211 (while shadows
212 (insert (format "%s hides %s\n" (car shadows)
213 (car (cdr shadows))))
214 (setq shadows (cdr (cdr shadows))))
215 (insert msg "\n")))
216 ;; We are non-interactive, print shadows via message.
217 (when shadows
218 (message "This site has duplicate Lisp libraries with the same name.
197If a locally-installed Lisp library overrides a library in the Emacs release, 219If a locally-installed Lisp library overrides a library in the Emacs release,
198that can cause trouble, and you should probably remove the locally-installed 220that can cause trouble, and you should probably remove the locally-installed
199version unless you know what you are doing.\n")) 221version unless you know what you are doing.\n"))
200 (while shadows 222 (while shadows
201 (message "%s hides %s" (car shadows) (car (cdr shadows))) 223 (message "%s hides %s" (car shadows) (car (cdr shadows)))
202 (setq shadows (cdr (cdr shadows)))) 224 (setq shadows (cdr (cdr shadows))))
203 (message "%s" msg)))) 225 (message "%s" msg)))))
204 226
205(provide 'shadow) 227(provide 'shadow)
206 228