Re: Some "how to do it" questions

From: Jeremy Cowgar <jeremy_at_cowgar.com>
Date: Sun, 20 Jul 2008 23:16:24 -0400

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?

/* 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:16:24 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 21 2008 - 05:16:39 CEST