]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/srecode/java.el
Update copyright year to 2015
[gnu-emacs] / lisp / cedet / srecode / java.el
index 29a8465c45c270b375df10f426a1e4313ac440bf..d812df1c935bb5cef2566ef978ba9f511a7e8b84 100644 (file)
@@ -1,6 +1,6 @@
 ;;; srecode/java.el --- Srecode Java support
 
-;; Copyright (C) 2009-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2015 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
 
@@ -27,6 +27,7 @@
 
 (require 'srecode/dictionary)
 (require 'semantic/find)
+(require 'ede)
 
 ;;;###autoload
 (defun srecode-semantic-handle-:java (dict)
@@ -39,16 +40,15 @@ FILENAME_AS_CLASS - file converted to a Java class name."
         (fnox (file-name-sans-extension fsym))
         (dir (file-name-directory (buffer-file-name)))
         (fpak fsym)
+        (proj (ede-current-project))
+        (pths (ede-source-paths proj 'java-mode))
         )
     (while (string-match "\\.\\| " fpak)
       (setq fpak (replace-match "_" t t fpak)))
     ;; We can extract package from:
     ;; 1) a java EDE project source paths,
-    (cond ((ede-current-project)
-           (let* ((proj (ede-current-project))
-                  (pths (ede-source-paths proj 'java-mode))
-                  (pth)
-                  (res))
+    (cond ((and proj pths)
+           (let* ((pth) (res))
              (while (and (not res)
                          (setq pth (expand-file-name (car pths))))
                (when (string-match pth dir)