I need to copy part of the file (with
re-search-forward) to another file under the marker. I know how to use
re-search-forward, but I have problems with buffer.
Am i right with my logic?
- 1) open needed file with temp buffer
- 2) create new buffer
- 3) find needed lines with
re-search-forwardand copy them in this new buffer
- 4) insert lines into opened file with
Right now i have a function like this:
(defun my-insert-file-name (filename) (interactive "*fInsert file name: ") (save-excursion (goto-char (point-min)) (when (re-search-forward "#here") (forward-line 1) (------something should be here-----)))