[nem-en] Emacs nemerle-mode

Piotr Kalinowski pitkali at gmail.com
Tue Mar 7 23:35:03 CET 2006


BTW - some notes:

1. 'catch'/'finally' is aligned to matching 'try' and 'else' is
aligned to 'if'. Full nesting support is included, but if your code
lacks matching clause, expect landing in strange place ;)
  ** special note: actually line with 'finally' is currently not
reindented automatically upon entering this word. I'll implement it
tomorrow.

2. match case - this is really tricky with indentation based syntax 
because of nested matching in another branch of current one. Take note
that nemerle-mode will associate match case (the line beginning with |
character) only with match of lower indentation level than current
one. The match here is line ending in sth like 'match (...)' or
'catch' or function definition.

3. function definition - if it contains any specifier, like private,
public, override, etc. the signature can span multiple lines (though
with opening paren on the first one). If the signature starts
immediately with the function name, arguments need to be placed in a
single line with a colon after parens. Only then will the mode
correctly infer the need to increase indentation. Otherwise you'll
need to do it manually.

The limitation comes from the inability to distinguish between the
case of function definition without specifiers and function call by
means of regular expression. Even now, if you try to call a function,
upcast result and return it from the function as a single thing on a
line, you'll get sth like: func (...) : type, and mode will try to
increase indentation. I considered it to be more rare case than
function definition ;)

Obviously, if anybody has ideas how to enhance function definition
recognition (or anything else for that matter), do let me know :)

Regards,
--
Intelligence is like a river: the deeper it is, the less noise it makes



More information about the devel-en mailing list