Hello, Stephen!
There is patch for using gnatfind.
Please see.
On 01.05.2015 11:43, Евгений Турышев wrote:
Hello, Stephen!
ada-gnat-xref-other work not correct for me.
It search ALI only in current dir.
because
(gnat-run-gnat "find" (list switches arg))
switches not contains -aOPATH_TO_ALI option
Is obj_dir project variables now not being used?
Best regards,
Evgeniy Turishev
--
--------------
Evgeniy Turishev
Евгений Турышев
diff -u ada-mode-5.1.8-orig/ada-gnat-xref.el ada-mode-5.1.8/ada-gnat-xref.el
--- ada-mode-5.1.8-orig/ada-gnat-xref.el 2015-05-24 18:05:55.000000000 +0600
+++ ada-mode-5.1.8/ada-gnat-xref.el 2015-05-24 18:53:17.000000000 +0600
@@ -57,10 +57,12 @@
(switches (concat
"-a"
(when (ada-prj-get 'gpr_ext) (concat "--ext=" (ada-prj-get 'gpr_ext)))))
+ (dirs (when (ada-prj-get 'obj_dir)
+ (concat "-aO" (mapconcat 'identity (ada-prj-get 'obj_dir) ":"))))
status
(result nil))
(with-current-buffer (gnat-run-buffer)
- (gnat-run-gnat "find" (list switches arg))
+ (gnat-run-gnat "find" (list switches dirs arg))
(goto-char (point-min))
(forward-line 2); skip ADA_PROJECT_PATH, 'gnat find'
@@ -103,9 +105,11 @@
"-d"
(when (ada-prj-get 'gpr_ext) (concat "--ext=" (ada-prj-get 'gpr_ext)))
))
+ (dirs (when (ada-prj-get 'obj_dir)
+ (concat "-aO" (mapconcat 'identity (ada-prj-get 'obj_dir) ":"))))
(result nil))
(with-current-buffer (gnat-run-buffer)
- (gnat-run-gnat "find" (append switches (list arg)))
+ (gnat-run-gnat "find" (append switches (list dirs arg)))
(goto-char (point-min))
(forward-line 2); skip GPR_PROJECT_PATH, 'gnat find'
@@ -151,7 +155,9 @@
;; is asynchronous, and automatically runs the compilation error
;; filter.
- (let* ((cmd (format "gnat find -a -r %s:%s:%d:%d" identifier file line col)))
+ (let* ((dirs (when (ada-prj-get 'obj_dir)
+ (concat "-aO" (mapconcat 'identity (ada-prj-get 'obj_dir) ":"))))
+ (cmd (format "gnat find -a -r %s %s:%s:%d:%d" dirs identifier file line col)))
(with-current-buffer (gnat-run-buffer); for default-directory
(let ((compilation-environment (ada-prj-get 'proc_env))
diff -u ada-mode-5.1.8-orig/ada-mode.el ada-mode-5.1.8/ada-mode.el
--- ada-mode-5.1.8-orig/ada-mode.el 2015-05-24 18:05:54.000000000 +0600
+++ ada-mode-5.1.8/ada-mode.el 2015-05-24 18:47:12.000000000 +0600
@@ -1322,6 +1322,7 @@
(path_sep path-separator)
(proc_env process-environment)
(src_dir (list "."))
+ (obj_dir (list "."))
(xref_tool ada-xref-tool)
))))
@@ -1471,7 +1472,7 @@
"Parse the Ada mode project file PRJ-FILE, set project properties in PROJECT.
Return new value of PROJECT."
(let (;; fields that are lists or that otherwise require special processing
- casing src_dir
+ casing src_dir obj_dir
tmp-prj
(parse-one-compiler (cdr (assoc ada-compiler ada-prj-parse-one-compiler)))
(parse-final-compiler (cdr (assoc ada-compiler ada-prj-parse-final-compiler)))
@@ -1524,6 +1525,11 @@
(expand-file-name (match-string 2)))
src_dir :test #'equal))
+ ((string= (match-string 1) "obj_dir")
+ (cl-pushnew (file-name-as-directory
+ (expand-file-name (match-string 2)))
+ obj_dir :test #'equal))
+
((string= (match-string 1) "xref_tool")
(let ((xref (intern (match-string 2))))
(setq project (plist-put project 'xref_tool xref))
@@ -1563,6 +1569,7 @@
;; process accumulated lists
(if casing (setq project (plist-put project 'casing (reverse casing))))
(if src_dir (setq project (plist-put project 'src_dir (reverse src_dir))))
+ (if obj_dir (setq project (plist-put project 'obj_dir (reverse obj_dir))))
(when parse-final-compiler
;; parse-final-compiler may reference the "current project", so
_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org