Function: idlwave-scan-library-catalogs

idlwave-scan-library-catalogs is a byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-scan-library-catalogs &optional MESSAGE-BASE NO-LOAD)

Documentation

Scan for library catalog files (.idlwave_catalog) and ingest.

All directories on idlwave-path-alist (or idlwave-library-path instead, if present) are searched. Print MESSAGE-BASE along with the libraries being loaded, if passed, and skip loading/normalizing if NO-LOAD is non-nil. The variable idlwave-use-library-catalogs can be set to nil to disable library catalog scanning.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/idlwave.el.gz
;;----- Scanning the library catalogs ------------------




(defun idlwave-scan-library-catalogs (&optional message-base no-load)
  "Scan for library catalog files (.idlwave_catalog) and ingest.

All directories on `idlwave-path-alist' (or `idlwave-library-path'
instead, if present) are searched.  Print MESSAGE-BASE along with the
libraries being loaded, if passed, and skip loading/normalizing if
NO-LOAD is non-nil.  The variable `idlwave-use-library-catalogs' can
be set to nil to disable library catalog scanning."
  (when idlwave-use-library-catalogs
    (let ((dirs
	   (if idlwave-library-path
	       (idlwave-expand-path idlwave-library-path)
	     (mapcar #'car idlwave-path-alist)))
	  (old-libname "")
	  dir-entry dir catalog all-routines)
      (if message-base (message "%s" message-base))
      (while (setq dir (pop dirs))
	(catch 'continue
	  (when (file-readable-p
		 (setq catalog (expand-file-name ".idlwave_catalog" dir)))
	    (unless no-load
	      (setq idlwave-library-catalog-routines nil)
	      ;; Load the catalog file
	      (condition-case nil
		  (load catalog t t t)
		(error (throw 'continue t)))
	      (when (and
		     message-base
		     (not (string= idlwave-library-catalog-libname
				   old-libname)))
		(message "%s%s" message-base idlwave-library-catalog-libname)
		(setq old-libname idlwave-library-catalog-libname))
	      (when idlwave-library-catalog-routines
		(setq all-routines
		      (append
		       (idlwave-sintern-rinfo-list
			idlwave-library-catalog-routines 'sys dir)
		       all-routines))))

	    ;;  Add a 'lib flag if on path-alist
	    (when (and idlwave-path-alist
		       (setq dir-entry (assoc dir idlwave-path-alist)))
	      (idlwave-path-alist-add-flag dir-entry 'lib)))))
      (unless no-load (setq idlwave-library-catalog-routines all-routines))
      (if message-base (message "%sdone" message-base)))))