Function: idlwave-fix-module-if-obj_new

idlwave-fix-module-if-obj_new is a byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-fix-module-if-obj_new MODULE)

Documentation

Check if MODULE points to obj_new.

If yes, and if the cursor is in the keyword region, change to the appropriate Init method.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/idlwave.el.gz
(defun idlwave-fix-module-if-obj_new (module)
  "Check if MODULE points to obj_new.
If yes, and if the cursor is in the keyword region, change to the
appropriate Init method."
  (let* ((name (car module))
	 (pos (point))
	 (case-fold-search t)
	 string)
    (if (and (stringp name)
	     (equal (downcase name) "obj_new")
	     (save-excursion
	       (idlwave-beginning-of-statement)
	       (setq string (buffer-substring (point) pos))
	       (string-match "obj_new([^'\"]*['\"]\\([a-zA-Z0-9_]+\\)"
			     string)))
	(let (;; (name "Init")
	      (class (match-string 1 string)))
	  (setq module (list (idlwave-sintern-method "Init")
			     'fun
			     (idlwave-sintern-class class)))))
    module))