;;
;; itcl_sup.el
;;
;; Apr. 18, 2010 by zhuo
;;
;; [incr tcl] support; show class-name and method-name
;;
(defun itcl-sup-show-class-and-method ()
"Show itcl-class and itcl-method (if inside). (Apr. 18, 2010 by Zhuo)"
(interactive)
(let ((class-line-pos nil)
(class-line "(not inside a class)")
(method-line "(not inside a method)"))
(save-excursion
(end-of-line)
(if (re-search-backward "itcl::class[ \t]+\\([^ \t]+\\)" nil t)
(progn
(setq class-line-pos (point))
(setq class-line (buffer-substring (match-beginning 1) (match-end 1))))))
(save-excursion
(end-of-line)
(if (re-search-backward "\\(\\(method\\|proc\\|constructor\\|destructor\\)[^}]+}\\).*$" class-line-pos t)
(setq method-line (buffer-substring (match-beginning 1) (match-end 1)))))
(princ (concat "CLASS: " class-line " BLOCK: " method-line))))
|