> Let me give an example:
>  - we want to comment a block of code
>  - we edit C-like code, i.e.:
>    - let's say a block of code is defined by text between the next "{"
>      and its matching "}"
>    - comment means add "//" at the beginning of the line
>
> To realize this on "level 2" commands, we may use these commands:
>  - select text between "{" and next "}"
>  - add "//" at the beginning of all lines of text selection
> (and I feel this is how most vi users work, but I might be wrong)
>
> To realize this on "level 3" commands, we may use these commands:
>  - select "block of code"
>  - comment current selection
>
> ==> Level 3 commands do not depend on the actual syntax ("{", "//"
> characters), but on code abstractions.
> ==> We can use *the very same commands* for LaTeX sources for instance,
> where "{" would be "\begin", "}" would be "\end" and "//" would be "%".
>

Hmm. adding /* and */ around the selection are two times two key presses.
But I do see your approach being useful in languages where this isn't available.

Then again, what we actually do with our editors would look like:
Comment out this function (/* */), go on with a copy of the above, so we can
out-of-order undo...

Or we might select an amount of lines and make another function from them.
This might be going places.

cheers!
mar77i

Reply via email to