Stephen Leake <[email protected]> writes: > If your ~/.emacs is centrally managed, then that (require 'ada-xref) is > now gone?
Each user has their own ~/.emacs but they are required to call a centrally-managed file from it. So, while the centrally-managed file no longer requires 'ada-xref, nobody can stop developers to try to outsmart Ada mode 5 :) > Otherwise, I think the way to handle (require 'ada-xref) etc is to > provide a dummy file ada-xref.el in ada-mode 5.x that just issues an > "obsolete" message. > > Or maybe also requires ada-mode? > > That will be found first load-path, so the 4.01 files are hidden. > > I propose to define ada-find-file in 5.x as: > > (defun ada-find-file () > (interactive) > ;; we assume compliation-search-path is set, either by an > ;; ada-mode project, or by some other means. > (let ((dirs compilation-search-path) > list > filename) > > ;; build completion list of all file names in compilation-search-path > (while dirs > (when (file-directory-p (car dirs)) > (setq list (append list (file-name-all-completions "" (car dirs))))) > (setq dirs (cdr dirs))) > > ;; prompt the user with the completion list > ;; FIXME: option to filter with ada-*-suffixes? > (setq filename (completing-read "File: " list)) > > ;; open it > (find-file (locate-file filename compilation-search-path)) > )) > > This is the same functionality as in 4.01, but somewhat simpler code. > Building the initial list of completions can take a long time, and it is > not cached for subsequent searches. There's probably a way to optimize > this, but I'll worry about that if someone complains. > > Would it be useful to provide a variant that filters on > ada-spec-suffixes, ada-body-suffixes? I like the non-filter version; I > can find .texi files, test outputs, Makefiles, etc. > > Note that it does _not_ have '(ada-require-project-file); it just uses > compilation-search-path. That's to make it easier to get the default > startup behavior right. > > Comments? I have already achieved similar functionality by traversing $ADA_INCLUDE_PATH and calling file-cache-add-directory on each directory in it. This function accepts a regexp to restrict which file names are in the cache. (I discovered that the function that adds multiple directories, file-cache-add-directory-list, exhausts memory quickly; I don't know why.) >> My question is really meant for other, yet-unknown functions of >> ada-mode 4 that some users might still rely on. I'd like to make >> them all disappear. > > Right, that would be ideal. > > I propose: > > 1) add dummy replacements for ada-prj.el, ada-stmt.el, ada-xref.el in > 5.x as above OK. > 2) add obsolete aliases for the autoloaded functions that are > not defined in 5.x: ada-header > > I think that will be sufficient. Yes, but will it be maintainable? And can you discover all obsolete functions that ada-mode 4 has? -- Ludovic Brenta. _______________________________________________ Emacs-ada-mode mailing list [email protected] http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org
