The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Read Files Contents Into A Temporary Emacs Buffer With Lisp

TODO: Pull subtitle into page object

This started as an example way to read file contents. It's also the code that is setup to use `__END__` in a file.

This reads a file into a temporary buffer, deletes everything up to the first occurance of the word `brown`, and then outputs what's left.

code_start_default_section code_end_default_section

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Read Files Contents Into A Temporary Emacs Buffer With Lisp 

-- p

This started as an example way to read file contents. It's also the code that is setup to use `__END__` in a file.

-- p

This reads a file into a temporary buffer, deletes everything up to the first occurance of the word `brown`, and then outputs what's left.

-- code/
-- elisp

(with-temp-buffer
 (insert-file-contents "input.txt")
 (goto-char (point-max))
 (delete-region
  (point-min) 
  (search-forward "__END__" nil nil -1))
 (delete-region
  (point-min) 
  (search-forward "__END__\n" nil nil))
 (append-to-file nil nil "output.txt"))

-- /code


-- categories
-- Emacs 
-- Lisp 

-- metadata
-- date: 2022-10-20 19:27:15
-- id: 2gq6prlw
-- status: published 
-- type: post
-- SCRUBBED_NEO: false
-- site: aws