Simon Wright <[email protected]> writes:

> I finally got round to doing something about automatic case adjustment in 
> GPRs.
>
> Below is a first hack, not yet even incorporated in my .emacs.
>
> Two gotchas:
>
> (1) I’ve been using Project’Project_Dir to access the current directory, 
> useful because compiling & linking are done from the Object_Dir:
>
>      for Runtime ("ada") use Project'Project_Dir & "../arduino-due”;
>
>      package Linker is
>         for Map_File_Option use "-Wl,-Map," & Project'Project_Dir;
>      end Linker;
>
>    but “project” is now a keyword, & ends up in lower case. 

You should be able to use the parse result to distingish the two; one
will have token KEYWORD, the other IDENTIFIER (or NAME).

> (2) “external_as_list” is a keyword for GPR but not for Ada! It ends
> up as “External_As_list”. I ended up making it a full case exception.

"external_as_list" is in gpr-grammar.wy as a keyword. But it's not in
gpr-font-lock-keywords (I just fixed that). So now it has the right
face.

It stays lowercase for me.

We should move the "name" font-lock to grammar actions, as for ada-mode;
that would simplify the keyword management.

Probably I should rename ada-adjust-case and related functions to
wisi-*, and provide appropriate buffer-local vars for everything.

Thanks for this; I've been wanting case correction in gpr files. If I
had realized how easy it would be, I'd have done it before now!

-- 
-- Stephe

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to