Juanma Barranquero <[email protected]> writes: > On Fri, Feb 28, 2014 at 6:16 PM, Stephen Leake > <[email protected]> wrote: > >> prog-mode does not provide for ada-mode-post-local-vars, and I could not >> figure out any other way to make that work. > > What do you mean by that? Could you explain it a bit?
The key problem is taking into account settings in file-local variables. Suppose the user is not using project files, and has some ada-2005 and some ada-2012 projects. One way to handle this is to set ada-language-version in the file-local variables for each one. Or even with project files, the user can override that setting for an individual file with a file-local variable. But file-local variables are processed after ada-mode completes, so we can't set things that depend on ada-language-version (ada-keywords and font-lock-defaults) in ada-mode. The solution I found is to set those things in hack-local-variables-hook. So ada-mode adds ada-mode-post-local-vars to hack-local-variables-hook. Another setting that requires this treatment is ada-auto-case; the user may have a few files for which auto-case is not desired. I could not find a way to accomplish this while also deriving from prog-mode. I also looked at several other language modes, and about half did not derive from prog-mode. So it did not seem like an important issue. One solution to the loss of prog-mode-hook is for ada-mode to call it directly. Is there anything else prog-mode does that ada-mode should do? -- -- Stephe _______________________________________________ Emacs-ada-mode mailing list [email protected] http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org
