[Emacs-ada-mode] Finding spec/body in same directory
Stephen Leake
Stephe.Leake at nasa.gov
Sat Jun 21 00:15:28 PDT 2008
Emmanuel Briot <briot at adacore.com> writes:
>> I agree with you in the general case, but in my specific case, I'd
>> prefer to configure Emacs Ada Mode in some way to search the
>> complementary file in the same directory.
>
> Maybe you could systematically add "." in front of the search path,
> probably in the hook executed when the ada-mode has been loaded.
Or modify ada-xref-get-src-dir-field. Currently, that is:
(defun ada-xref-get-src-dir-field ()
"Return the full value for src_dir, including the default directories.
All the directories are returned as absolute directories."
(let ((build-dir (ada-xref-get-project-field 'build_dir)))
(append
;; Add ${build_dir} in front of the path
(list build-dir)
(ada-get-absolute-dir-list (ada-xref-get-project-field 'src_dir)
build-dir)
;; Add the standard runtime at the end
ada-xref-runtime-library-specs-path)))
I'm not clear why it adds build-dir to the front of the path;
apparently that was a good optimization for someone. You could replace
that with "add '.' to front of path":
(defun ada-xref-get-src-dir-field ()
"Return the full value for src_dir, including the default directories.
All the directories are returned as absolute directories."
(let ((build-dir (ada-xref-get-project-field 'build_dir)))
(append
;; Add "." in front of the path, since that's most likely where
;; the file we're looking for is
(list ".")
(ada-get-absolute-dir-list (ada-xref-get-project-field 'src_dir)
build-dir)
;; Add the standard runtime at the end
ada-xref-runtime-library-specs-path)))
--
-- Stephe
More information about the Emacs-ada-mode
mailing list