Hello,

In our large systems at Eurocontrol, we have a large number of read-only
directories containing the baselined sources and other read-only
directories containing the .ali files produced during nightly builds.
The .o files are moved into static archives (lib*.a), so not directly
visible to any tool.  The nightly builds also produce 50 read-only .gpr
files or so (referencing one another); one of these is the top-level
project for a system.

When a developer creates a working "view", they check out only a few of
these files and copy them to their working copy.  To the compiler and
all other tools, these files shadow the ones in the baseline.  I have
attached a hook to ada-mode-hooks that generates a .gpr project file
that "extends" the top-level project file from the baseline, adding the
working view as a source and object directory.  (I call it a "working
view", not a "working copy", because it is NOT a complete copy of the
baseline!)

I have discovered that ada-goto-declaration calls gnat find without the
-a switch; as a consequence, gnat find ignores all read-only .ali files,
which in our case represents 99% of all files in the system...  The
patch below corrects that.  However I understand that our workflow may
not be the same as everyone else's, so I'm wondering whether this should
be made configurable.

--
Ludovic Brenta.
--- ada-gnat-xref.el
+++ ada-gnat-xref.el
@@ -53,7 +53,9 @@
     )
 
   (let* ((arg (format "%s:%s:%d:%d" identifier file line col))
-        (switches (when (ada-prj-get 'gpr_ext) (concat "--ext=" (ada-prj-get 
'gpr_ext))))
+        (switches (concat
+                    "-a"
+                    (when (ada-prj-get 'gpr_ext) (concat "--ext=" (ada-prj-get 
'gpr_ext)))))
         status
         (result nil))
     (with-current-buffer (gnat-run-buffer)
@@ -97,6 +99,7 @@
 
   (let* ((arg (format "%s:%s:%d:%d" identifier file line col))
         (switches (concat
+                    "-a"
                    "-d"
                    (when (ada-prj-get 'gpr_ext) (concat "--ext=" (ada-prj-get 
'gpr_ext)))
                    ))
@@ -149,7 +152,7 @@
   ;; is asynchronous, and automatically runs the compilation error
   ;; filter.
 
-  (let* ((cmd (format "gnat find -r %s:%s:%d:%d" identifier file line col)))
+  (let* ((cmd (format "gnat find -a -r %s:%s:%d:%d" identifier file line col)))
 
     (with-current-buffer (gnat-run-buffer); for default-directory
       (let ((compilation-environment (ada-prj-get 'proc_env))
_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to