Function: idlwave-find-module

idlwave-find-module is an interactive and byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-find-module &optional ARG)

Documentation

Find the source code of an IDL module.

Works for modules for which IDLWAVE has routine info available. The function offers as default the module name idlwave-routine-info would use. With ARG limit to this buffer. With two prefix ARG's force class query for object methods.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/idlwave.el.gz
(defun idlwave-find-module (&optional arg)
  "Find the source code of an IDL module.
Works for modules for which IDLWAVE has routine info available.
The function offers as default the module name `idlwave-routine-info'
would use.  With ARG limit to this buffer.  With two prefix ARG's
force class query for object methods."
  (interactive "P")
  (let* ((idlwave-query-class nil)
	 (idlwave-force-class-query (equal arg '(16)))
	 (this-buffer (equal arg '(4)))
	 (module (idlwave-fix-module-if-obj_new (idlwave-what-module)))
	 (default (if module
		      (concat (idlwave-make-full-name
			       (nth 2 module) (car module))
			      (if (eq (nth 1 module) 'pro) "<p>" "<f>"))
		    "none"))
	 (list
	  (idlwave-uniquify
	   (delq nil
		 (mapcar (lambda (x)
			   (if (eq 'system (car-safe (nth 3 x)))
			       ;; Take out system routines with no source.
			       nil
			     (list
			      (concat (idlwave-make-full-name
				       (nth 2 x) (car x))
				      (if (eq (nth 1 x) 'pro) "<p>" "<f>")))))
			 (if this-buffer
			     (idlwave-save-buffer-update)
			   (idlwave-routines))))))
	 (name (idlwave-completing-read
		(if (or (not this-buffer)
			(assoc default list))
		    (format-prompt "Module" default)
		  "Module in this file: ")
		list))
	 type class)
    (if (string-match "\\`\\s-*\\'" name)
	;; Nothing, use the default.
	(setq name default))
    (if (string-match "<[fp]>" name)
	(setq type (substring name -2 -1)
	      name (substring name 0 -3)))
    (if (string-match "\\(.*\\)::\\(.*\\)" name)
	(setq class (match-string 1 name)
	      name (match-string 2 name)))
    (setq name (idlwave-sintern-routine-or-method name class)
	  class (idlwave-sintern-class class)
	  type (cond ((equal type "f") 'fun)
		     ((equal type "p") 'pro)
		     (t t)))
    (idlwave-do-find-module name type class nil this-buffer)))