I need to append a string S
(belonging to no buffer) to a special file F
, but since I hope this operation takes as little time as possible I don't want F
opened as a buffer.
AFAIK, there is a built-in function in emacs called write-region
, but this requires the content to be written into F
inside one of the buffers(while in my case there is no guarantee that S
should be such a string). How can I make it?
To insert text into a buffer, place the cursor where you want to start inserting text, and start typing away. If you want to insert the contents of another file into the current buffer, place the cursor at the desired insertion point, and type Control-X-I. Emacs will ask you for the name of the file you wish to insert.
function (aka #' ) is used to quote functions, whereas quote (aka ' ) is used to quote data.
In a fresh Emacs window, type ESC-x lisp-interaction-mode . That will turn your buffer into a LISP terminal; pressing Ctrl+j will feed the s-expression that your cursor (called "point" in Emacs manuals' jargon) stands right behind to LISP, and will print the result.
Emacs Lisp has a compiler that translates functions written in Lisp into a special representation called byte-code that can be executed more efficiently. The compiler replaces Lisp function definitions with byte-code. When a byte-code function is called, its definition is evaluated by the byte-code interpreter.
(write-region <STRING> nil <FILENAME> 'append)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With