Georg Bauhaus <[email protected]> writes:

> On 24 Jul 2014, at 19:47, WAROQUIERS Philippe 
> <[email protected]> wrote:
>
>> (note that the above 2 blocking problems mean that nice
>> features of the new ada-mode are not looked at: users are all
>> almost directly abandoning the new ada-mode once the performance
>> and no indentation while typing problems are encountered).
>
> That’s a huge mode marketing problem indeed: first impression
> means lack of familiar behavior. 

Yes.

>To cope with this, I wonder if
> the mode could have some special backwards-looking function
> that does the right thing, and simply at that, and is electrically
> bound to ENTER?
>   It would remember the current point (marked * below), and then
> look backwards for something that's reliably expanded (marked ^).
> Then, it could add a good skeleton after the saved point.

Hmm. Now you are talking about skeletons, not indenting while editing.

Do you mean the parser should insert a partial skeleton to fix a parser
error? That's an idea. But I don't think people would like it. And there
would be a HUGE number of skeletons required.

It _might_ be possible to generate the skeletons from the wisi grammar;
that would solve one problem.

Hmm; that might help in parser error recovery as well; the skeleton
completion is inserted _virtually_ to allow the parse to complete.

Or it might be possible to add error recovery hints to the grammar. I
suspect that will be the best approach.

>    procedure Type_ahead (A : T) is ENTER
>                                   *
> (SAVE *)
> (MOVE-BACKWARDS-TO ^)
>
>    procedure Type_ahead (A : T) is ENTER
>                        ^
>
> (INS-SKEL-AFTER *)
>
>    procedure Type_ahead (A : T)
>    is
>    begin
>    end Type_before_you_structure;
>
> This should fix the first impression problem and let users
> type in the usual fashion. 

I don't see how this is anything like "the usual fashion". My reaction
would be "why is Emacs inserting all this crap in the code every time I
hit ENTER?".

Note that a more typical case is modifying an existing subprogram. For
example, if we start with:

procedure Foo (A : in Integer)
is begin
...
end;

And want to change to:

procedure Foo 
  (A : in Integer;
   B : in Float)
is begin
... <add B to function calls in this code>

<add other code that uses B>

... <no changes here>
end;

I don't see how to use skeletons for this.

> In the long run, if the parser is reasonably well informed
> about what could be type “now”, then it might show a menu
> like many other IDEs. This guide should make editing programs
> a lot more intuitive (in this guided sense).

(I hate that word "intuitive"; the OED defines it as "immediate
apprehension", which is just "what I'm used to". It does _not_ mean
"more natural" or "no learning required")

That is an alternative to skeletons; I don't see how it helps the
"indent while edit" problem. The ELSE skeleton package approximated
that; the skeleton placeholders were much more intelligent, and offered
syntax choices.

I never found it useful for more than "procedure", "if", and "loop" (and
even then I didn't use the skeletons all the time); I can just type the
code much faster than navigating thru the menus. I think it is useful
for language novices; it can help them learn the language syntax.

-- 
-- Stephe

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

Reply via email to