Permalink
Browse files

Accommodate new syntax obj_new('class') == CLASS()

IDL 8 introduced a new convenience syntax for calling the Init method of a class.  Here we add copied routine info entries which substitute class for the routine name.
  • Loading branch information...
1 parent d62acf6 commit e35826c6da09b0b1e0b44d25697f75ec5adca0ca @jdtsmith committed Jan 2, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 idlwave.el
View
18 idlwave.el
@@ -7711,6 +7711,7 @@ property indicating the link is added."
(idlwave-new-sintern-type 'sysvartag)
(add-to-list 'idlwave-complete-special 'idlwave-complete-sysvar-or-tag)
(add-hook 'idlwave-update-rinfo-hook 'idlwave-sysvars-reset)
+(add-hook 'idlwave-update-rinfo-hook 'idlwave-class-add-init-special)
(add-hook 'idlwave-after-load-rinfo-hook 'idlwave-sintern-sysvar-alist)
@@ -7835,6 +7836,23 @@ associated TAG, if any."
(setq tags (cdr tags))))))))
+(defun idlwave-class-add-init-special ()
+ ;; Create special entries for Class::Init() methods as Class() (IDL >=8)
+ (idlwave-routines)
+ (setcdr (last idlwave-routines)
+ (idlwave-sintern-rinfo-list
+ (mapcar
+ (lambda (entry)
+ (let ((new-entry (copy-sequence entry)))
+ (setcar new-entry (nth 2 entry))
+ (setcar (cddr new-entry) nil)
+ new-entry))
+ (idlwave-all-assq (idlwave-sintern-method "Init")
+ idlwave-routines))
+ 'set)))
+
+
+
(defun idlwave-sysvars-reset ()
(if (and (fboundp 'idlwave-shell-is-running)
(idlwave-shell-is-running)

0 comments on commit e35826c

Please sign in to comment.