Function: idlwave-study-twins
idlwave-study-twins is a byte-compiled function defined in
idlwave.el.gz.
Signature
(idlwave-study-twins ENTRIES)
Documentation
Return dangerous twins of first entry in ENTRIES.
Dangerous twins are routines with same name, but in different files on
the load path. If a file is in the system library and has an entry in
the idlwave-system-routines list, we omit the latter as
non-dangerous because many IDL routines are implemented as library
routines, and may have been scanned.
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/idlwave.el.gz
(defun idlwave-study-twins (entries)
"Return dangerous twins of first entry in ENTRIES.
Dangerous twins are routines with same name, but in different files on
the load path. If a file is in the system library and has an entry in
the `idlwave-system-routines' list, we omit the latter as
non-dangerous because many IDL routines are implemented as library
routines, and may have been scanned."
(let* ((entry (car entries))
(idlwave-twin-name (car entry)) ;
(type (nth 1 entry)) ; Must be bound for
(idlwave-twin-class (nth 2 entry)) ; idlwave-routine-twin-compare
(cnt 0)
source type-cons file alist syslibp key)
(while (setq entry (pop entries))
(cl-incf cnt)
(setq source (nth 3 entry)
type (car source)
type-cons (cons type (nth 3 source))
file (idlwave-routine-source-file source))
;; Make KEY to index entry properly
(setq key (cond ((eq type 'system) type)
(file (file-truename file))
(t 'unresolved)))
;; Check for an entry in the system library
(if (and file
(not syslibp)
(idlwave-syslib-p file))
(setq syslibp t))
;; If there's more than one matching entry for the same file, just
;; append the type-cons to the type list.
(if (setq entry (assoc key alist))
(push type-cons (nth 2 entry))
(push (list key file (list type-cons)) alist)))
(setq alist (nreverse alist))
(when syslibp
;; File is in system *library* - remove any 'system entry
(setq alist (delq (assq 'system alist) alist)))
;; If 'system remains and we've scanned the syslib, it's a builtin
;; (rather than a !DIR/lib/.pro file bundled as source).
(when (and (idlwave-syslib-scanned-p)
(setq entry (assoc 'system alist)))
(setcar entry 'builtin))
(sort alist #'idlwave-routine-twin-compare)))