Georg Bauhaus <[email protected]> writes: > On 22 Feb 2014, at 10:59, Simon Wright <[email protected]> wrote: > >> On 22 Feb 2014, at 07:57, Stephen Leake <[email protected]> >> wrote: >> >>> Markus Schöpflin <[email protected]> writes: >>> >>>> Hello, >>>> >>>> how do I configure the new Ada mode to use all upper case for >>>> identifiers? I can't find any option for this. >>> >>> (setq ada-case-keyword 'upcase-word) >> >> That seems to work fine if you want to upcase *keywords*; Markus >> wants to upcase *identifiers*. (I made the same mistake!) > > A quick fix for this particular application changes > one line in function `ada-case-adjust-identifier’ of ada-mode.el. > > > > --- ada-mode.el.orig 2014-02-05 08:45:10.000000000 +0100 > +++ ada-mode.el 2014-02-22 11:29:46.000000000 +0100 > @@ -977,7 +977,7 @@ > > ;; else apply Mixed_Case and partial-exceptions > (if ada-case-strict > - (downcase-region start end)) > + (upcase-region start end)) > (while (not done) > (setq next > (or
Yes. And that could easily be made an option; it was an option in 4.0 - ada-case-identifier. I think I asked about it here, but I guess that was not an authoritative survey. I'll put it on the list; it may be in 5.0.2. It will still be named ada-case-identifier, so the patch will be: > + (defvar ada-case-identifier 'downcase-region "") > - (downcase-region start end)) > + (funcall ada-case-identifier start end)) if you want to do this yourself in a forward-compatible way. Then add (setq ada-case-identifier 'upcase-region) in your .emacs or project file (an Emacs Ada mode project file can reference an elisp file for this sort of thing). Hmm. That is part of 'ada-case-adjust-identifier', whose doc string says "used Mixed_Case with exceptions". So at least the docstring has to also change. It could also skip the mixed-case part of the code. And there may be other things I have not thought of yet. So the full change will be more complicated. The right way may involve factoring out 'ada-mixed-case' and specifying that for the default of 'ada-case-identifier' (which is what 4.0 did). Which is why it may not be in 5.0.2. Somebody is going to want CamelCase; I might as well anticipate that :) (it would have to use a dictionary!). -- -- Stephe _______________________________________________ Emacs-ada-mode mailing list [email protected] http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org
