- (let* ((path (copy-sequence load-path))
- (tem path)
- toplevs)
- ;; If we can find simple.el in two places,
- (dolist (tt tem)
- (if (or (file-exists-p (expand-file-name "simple.el" tt))
- (file-exists-p (expand-file-name "simple.el.gz" tt)))
- (setq toplevs (cons tt toplevs))))
- (if (> (length toplevs) 1)
- ;; Cut off our copy of load-path right before
- ;; the last directory which has simple.el in it.
- ;; This avoids loads of duplications between the source dir
- ;; and the dir where these files were copied by installation.
- (let ((break (car toplevs)))
- (setq tem path)
- (while tem
- (if (eq (nth 1 tem) break)
- (progn
- (setcdr tem nil)
- (setq tem nil)))
- (setq tem (cdr tem)))))
-
- (let* ((shadows (load-path-shadows-find path))
- (n (/ (length shadows) 2))
- (msg (format "%s Emacs Lisp load-path shadowing%s found"
- (if (zerop n) "No" (concat "\n" (number-to-string n)))
- (if (= n 1) " was" "s were"))))
- (with-temp-buffer
- (while shadows
- (insert (format "%s hides %s\n" (car shadows)
- (car (cdr shadows))))
- (setq shadows (cdr (cdr shadows))))
- (if stringp
- (buffer-string)
- (if (called-interactively-p 'interactive)
- ;; We are interactive.
- ;; Create the *Shadows* buffer and display shadowings there.
- (let ((string (buffer-string)))
- (with-current-buffer (get-buffer-create "*Shadows*")
- (display-buffer (current-buffer))
- (load-path-shadows-mode) ; run after-change-major-mode-hook
- (let ((inhibit-read-only t))
- (erase-buffer)
- (insert string)
- (insert msg "\n")
- (while (re-search-backward "\\(^.*\\) hides \\(.*$\\)"
- nil t)
- (dotimes (i 2)
- (make-button (match-beginning (1+ i))
- (match-end (1+ i))
- 'type 'load-path-shadows-find-file
- 'shadow-file
- (match-string (1+ i)))))
- (goto-char (point-max)))))
- ;; We are non-interactive, print shadows via message.
- (unless (zerop n)
- (message "This site has duplicate Lisp libraries with the same name.
+ (let* ((shadows (load-path-shadows-find load-path))
+ (n (/ (length shadows) 2))
+ (msg (format "%s Emacs Lisp load-path shadowing%s found"
+ (if (zerop n) "No" (concat "\n" (number-to-string n)))
+ (if (= n 1) " was" "s were"))))
+ (with-temp-buffer
+ (while shadows
+ (insert (format "%s hides %s\n" (car shadows)
+ (car (cdr shadows))))
+ (setq shadows (cdr (cdr shadows))))
+ (if stringp
+ (buffer-string)
+ (if (called-interactively-p 'interactive)
+ ;; We are interactive.
+ ;; Create the *Shadows* buffer and display shadowings there.
+ (let ((string (buffer-string)))
+ (with-current-buffer (get-buffer-create "*Shadows*")
+ (display-buffer (current-buffer))
+ (load-path-shadows-mode) ; run after-change-major-mode-hook
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (insert string)
+ (insert msg "\n")
+ (while (re-search-backward "\\(^.*\\) hides \\(.*$\\)"
+ nil t)
+ (dotimes (i 2)
+ (make-button (match-beginning (1+ i))
+ (match-end (1+ i))
+ 'type 'load-path-shadows-find-file
+ 'shadow-file
+ (match-string (1+ i)))))
+ (goto-char (point-max)))))
+ ;; We are non-interactive, print shadows via message.
+ (unless (zerop n)
+ (message "This site has duplicate Lisp libraries with the same name.