 ;; we don't want to stack definition declarations
 (setq fi:maintain-definition-stack nil)
 
+;; try to get a full symbol from the position given
+(defun find-symbol-at-point (start end)
+  ;; is the previous char a : ?
+  (save-excursion
+    (goto-char start)
+    (backward-char)
+    (when (looking-at ":")
+      (while (and (not (or (looking-at "[ (]")
+			   (looking-at "^")))
+		  (> (point) (point-min)))
+	(backward-char))
+      (if (looking-at "^")
+	  (setq start (point))
+	(setq start (1+ (point))))))
+  (buffer-substring-no-properties start end))
+    
 ;; <ctrl-c .> in ojs file
 ;; works with ojs and lisp file and properly do the search
 (defun %ojs-find-definition (tag)
   (interactive
-     (if current-prefix-arg
-	 '(nil)
-       (list (car (fi::get-default-symbol "Lisp locate source" t t)))))
-  (fi::lisp-find-definition-common (concat "js::" tag) nil))
+   (list 
+    (let ((bounds (bounds-of-thing-at-point 'symbol)))
+      (find-symbol-at-point (car bounds) (cdr bounds)))))
+  (if (string-match ":" tag)
+      (fi::lisp-find-definition-common tag nil)
+    (fi::lisp-find-definition-common (concat "js::" tag) nil)))
 
 (defun %ojs-list-who-calls (tag)
   (interactive 

	      (setq proc
		    (fi:open-lisp-listener
		     -1
		     *ojs-compilation-buffer-name*
		     )))
	    (set-process-filter proc 'ojs-compilation-filter)
	    (cond ((eq type :compile)
		   (process-send-string *ojs-compilation-buffer-name* (format "(:rjs \"%s\")\n" script))

    '("OPX2 Javascript"
      ["Compile and load file..." compile-ojs-file
       t]
      ["Check syntax of selected region" check-ojs-region
       t]	    
      ["Compile, load and synchronize file..." save-compile-and-sync-ojs-file
       t]
      ["Find function definition..." %ojs-find-definition
