Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> C-like languages like Python

I can see Paredit working somehow with the curly brace blocks of C, but how does it handle the significant whitespace of Python? Are indent and dedent handled as tokens?



I did something far cruder which is also how paredit itself works internally.

Redefine the meaning of moving up, down, left or right by syntactic token. In Python up/down is either by block (try, if, etc.) or by s-exp ([], {}, etc.) which Emacs is already capable of doing.

By doing that you can effectively teach paredit a little bit about how the language works, as you're moving point around for it.

Note that my crude hack was never more than a prototype. Though it did work in more places than it ought to.


No, I've never tried to make it do that. So in Python paredit-kill will not kill a function definition, whereas it would in a language that uses braces for function bodies.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: