I'm trying to create a function that inserts text into an arbitrary file without switching to that file's buffer.
I know this could be done with echo, but is there a way to do it using only elisp?
|
feedback
|
|
Try this function:
| |||
|
feedback
|
|
You need to make a buffer current to do pretty much anything with its content. Making a buffer current is related to the Lisp interpreter, it doesn't involve displaying the buffer in a window. The basic primitives are There are a number of macros called
If you want to open the file and close it when you're done, there's no
| |||
|
feedback
|
append-to-fileandwrite-regionon the elisp reference (info - Elisp - Writing to files) – Juancho Jun 16 '11 at 0:08