Function: idlwave-update-routine-info

idlwave-update-routine-info is an interactive and byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-update-routine-info &optional ARG NO-CONCATENATE)

Documentation

Update the internal routine-info lists.

These lists are used by idlwave-routine-info (M-x idlwave-routine-info (idlwave-routine-info)) and by idlwave-complete (M-x idlwave-complete (idlwave-complete)) to provide information about individual routines.

The information can come from 4 sources:
1. IDL programs in the current editing session
2. Compiled modules in an IDL shell running as Emacs subprocess
3. A list which covers the IDL system routines.
4. A list which covers the prescanned library files.

Scans all IDLWAVE-mode buffers of the current editing session (see idlwave-scan-all-buffers-for-routine-info). When an IDL shell is running, this command also queries the IDL program for currently compiled routines.

With prefix ARG, also reload the system and library lists. With two prefix ARG's, also rescans the chosen user catalog tree. With three prefix args, dispatch asynchronous process to do the update.

If NO-CONCATENATE is non-nil, don't pre-concatenate the routine info lists, but instead wait for the shell query to complete and asynchronously finish updating routine info. This is set automatically when called interactively. When you need routine information updated immediately, leave NO-CONCATENATE nil.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/idlwave.el.gz
(defun idlwave-update-routine-info (&optional arg no-concatenate)
  "Update the internal routine-info lists.
These lists are used by `idlwave-routine-info' (\\[idlwave-routine-info])
and by `idlwave-complete' (\\[idlwave-complete]) to provide information
about individual routines.

The information can come from 4 sources:
1. IDL programs in the current editing session
2. Compiled modules in an IDL shell running as Emacs subprocess
3. A list which covers the IDL system routines.
4. A list which covers the prescanned library files.

Scans all IDLWAVE-mode buffers of the current editing session (see
`idlwave-scan-all-buffers-for-routine-info').
When an IDL shell is running, this command also queries the IDL program
for currently compiled routines.

With prefix ARG, also reload the system and library lists.
With two prefix ARG's, also rescans the chosen user catalog tree.
With three prefix args, dispatch asynchronous process to do the update.

If NO-CONCATENATE is non-nil, don't pre-concatenate the routine info
lists, but instead wait for the shell query to complete and
asynchronously finish updating routine info.  This is set
automatically when called interactively.  When you need routine
information updated immediately, leave NO-CONCATENATE nil."
  (interactive "P\np")
  ;; Stop any idle processing
  (if (timerp idlwave-load-rinfo-idle-timer)
      (cancel-timer idlwave-load-rinfo-idle-timer))
  (cond
   ((equal arg '(64))
    ;; Start a background process which updates the catalog.
    (idlwave-rescan-asynchronously))
   ((equal arg '(16))
    ;; Update the user catalog now, and wait for them.
    (idlwave-create-user-catalog-file t))
   (t
    (let* ((load (or arg
		     idlwave-buffer-case-takes-precedence
		     (null idlwave-routines)))
	   ;; The override-idle means, even if the idle timer has done some
	   ;; preparing work, load and renormalize everything anyway.
	   (override-idle (or arg idlwave-buffer-case-takes-precedence)))

      (setq idlwave-buffer-routines nil
	    idlwave-compiled-routines nil
	    idlwave-unresolved-routines nil)
      ;; Reset the appropriate hashes
      (if (get 'idlwave-reset-sintern 'done-by-idle)
	  ;; reset was already done in idle time, so skip this step now once
	  (put 'idlwave-reset-sintern 'done-by-idle nil)
	(idlwave-reset-sintern (cond (load t)
				     ((null idlwave-system-routines) t)
				     (t 'bufsh))))

      (if idlwave-buffer-case-takes-precedence
	  ;; We can safely scan the buffer stuff first
	  (progn
	    (idlwave-update-buffer-routine-info)
	    (and load (idlwave-load-all-rinfo override-idle)))
	;; We first do the system info, and then the buffers
	(and load (idlwave-load-all-rinfo override-idle))
	(idlwave-update-buffer-routine-info))

      ;; Let's see if there is a shell
      (let* ((shell-is-running (and (fboundp 'idlwave-shell-is-running)
				    (idlwave-shell-is-running)))
	     (ask-shell (and shell-is-running
			     idlwave-query-shell-for-routine-info)))

	;; Load the library catalogs again, first re-scanning the path
	(when arg
	  (if shell-is-running
	      (idlwave-shell-send-command idlwave-shell-path-query
					  '(progn
					     (idlwave-shell-get-path-info)
					     (idlwave-scan-library-catalogs))
					  'hide)
	    (idlwave-scan-library-catalogs)))

	(if (or (not ask-shell)
		(not no-concatenate))
	    ;; 1. If we are not going to ask the shell, we need to do the
	    ;;    concatenation now.
	    ;; 2. When this function is called non-interactively, it
	    ;;    means that someone needs routine info *now*.  The
	    ;;    shell update causes the concatenation to be
	    ;;    *delayed*, so not in time for the current command.
	    ;;    Therefore, we do a concatenation now, even though
	    ;;    the shell might do it again.
	    (idlwave-concatenate-rinfo-lists nil 'run-hooks))

	(when ask-shell
	  ;; Ask the shell about the routines it knows of.
	  (message "Querying the shell")
	  (idlwave-shell-update-routine-info nil t)))))))