I've modified the code so that it also analyzes the files loaded from the profile.
;******************* p o r d e s í a r g o ********************
;************************ G L A V C V S *************************
;************************** F E C I T ***************************
(defun c:buscaDefunsRepets (/ lstLsps arch nmarch linea lst as nbref separa<->palabras lstDefuns lstRepets tit i dale path escrutArch)
(defun separa<->palabras (tx lstCtrs / c p l)
(foreach c (vl-string->list tx)
(if (member (setq c (chr c)) lstCtrs)
(if p (setq l (cons (strcase p T) l) p nil))
(setq p (if p (strcat p c) c))
)
)
(reverse (if p (cons (strcase p T) l) l))
)
(defun escrutArch (nmarch / arch linea lst as nbref dale mirExtens)
(defun mirExtens (nmarch)
(if (not (wcmatch nmarch "*[.]@@@"))
(strcat nmarch ".lsp")
nmarch
)
)
(if (and (setq nmarch (findfile (mirExtens nmarch))) (setq arch (open nmarch "r")))
(while (setq linea (read-line arch))
(cond
((and (wcmatch linea "*(defun *") (not (wcmatch linea "*\"(defun *,*\"*(defun [*] *,*\"*(defun [*]\"*")))
(setq lst (separa<->palabras linea '(" " "(" "\""))
pos (vl-position "defun" lst)
nbref (nth (1+ pos) lst)
)
(if lstDefuns
(if (not (vl-some ; comprobamos cada defun acumulada
'(lambda (v)
(if (and (= (car v) nbref) (/= nbref "defun")); si la defun recien leída coincide con alguna de las encontradas anteriormente
(if (setq lr (assoc nbref lstRepets))
(setq lstRepets (subst (append lr (list nmarch)) lr lstRepets))
(setq lstRepets (append lstRepets (list (append v (list nmarch)))))
)
)
)
lstDefuns
)
)
(setq lstDefuns (append lstDefuns (list (list nbref nmarch))))
)
(setq lstDefuns (append lstDefuns (list (list nbref nmarch))))
)
)
((wcmatch linea "*(load *\")*")
(setq lst (separa<->palabras linea '(" " "(" "\"")))
(foreach v lst
(if dale
(setq dale
(if (and
(not (member (strcase v T) (list "acad2021.lsp" "acad2021doc.lsp")))
(or
(= (length (setq lst1 (separa<->palabras v '(".")))) 1)
(member (strcase (cadr lst1) T) extens)
)
)
(escrutArch v)
)
dale nil
)
(if (= (strcase v T) "load")
(setq dale T)
)
)
)
)
)
)
)
(if arch (close arch))
)
(setq lstLsps (list "acad2021.lsp" "acad2021doc.lsp" "acadddd.lsp") extens '("lsp"))
(foreach lsp lstLsps
(if (and (findfile lsp) (setq arch (open (setq nmarch (findfile lsp)) "r")))
(escrutArch nmarch)
)
)
(if arch (close arch))
(setq i 0)
(while (setq nmarch (vl-registry-read (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar "CPROFILE") "\\Dialogs\\Appload\\Startup") (strcat (itoa (setq i (1+ i))) "StartUp")))
(escrutArch nmarch)
)
(if lstRepets
(if (setq arch (open (setq nmarch (strcat (VL-REGISTRY-READ "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" "Personal") "\\informe.txt")) "w"))
(foreach lr lstRepets
(princ (strcat (if (not tit) (setq tit "FUNCTIONS DEFINED MULTIPLE TIMES:\n") "") "\n Function NAME \'" (car lr) "\' in:\n") arch)
(foreach path (cdr lr)
(princ (strcat "\t" path "\n") arch)
)
)
)
)
(if arch (progn (close arch) (startapp "notepad" nmarch)))
(princ)
)
If after trying this nothing different comes out, then the problem isn't due to overlapping code.
In that case, I would look at the system variables and any reactors your LISPs generate when loading.