|
|
|
|
|
by taeric
2793 days ago
|
|
This actually takes it in a direction I disagree with. Once you get used to manipulating buffers, elisp actually is easier than most other languages. What it is bad at is processing strings. Because it is good at processing text buffers. I am on my phone, but if this thread is still going this evening, I'll show roughly what that snippet would look like. Will be, roughly, (forward-word) (move -1) (insert "/"). Obviously, some differences if you were moving words or paragraphs. But basic idea is the same. That is, don't try and manipulate strings. Manipulate the entire buffer. If needed, build a new buffer with what all you want. The irony is that elisp has a decent dsl for manipulating text. But you have to embrace the mutable nature of it. Which is unexpected for many working with a lisp. |
|