Re: Some "how to do it" questions

From: Eric S. Johansson <esj_at_harvee.org>
Date: Sun, 20 Jul 2008 23:39:20 -0400

Jeremy Cowgar wrote:
> Eric S. Johansson wrote:
>> 1) indent according to the indentation rules as defined by the
>> previous line
>> (the same level of indentation for ordinary lines, indent one further for
>> conditionals, outdent by one for block termination)
> Hm, thinking about this, I do have a "control-enter" function that
> inserts an enter and tab. So when I know the next line needs indented, I
> press control+enter and let mp do the work for me. This is not what you
> requested, but maybe a step closer?

It looks like it would be a step closer but I'm puzzled. How does this differ
from the existing functionality of python mode? When I go to the end of the
line and hit return, it puts a newline and indents to the right location.

For what it's worth, part of the reason I'm looking for this kind of
functionality is because if you step outside of the "standard script", the
system really doesn't behave right.
>
> /* newline + indent */
> sub indented_newline(d) {
> mp.actions.insert_line(d);
> mp.insert_tab(d);
> }
> mp.actions['indented_newline'] = indented_newline;
> mp.actdesc['indented_newline'] = "Insert newline and indent";
> mp.keycodes['ctrl-enter'] = 'indented_newline';
>
> Jeremy
>
>
>

-- 
To unsubscribe, send mail to mp-unsubscribe_at_lists.triptico.com.
Received on Mon Jul 21 2008 - 05:39:20 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 21 2008 - 05:37:09 CEST