lotsa changes and inclusion of elpy
[emacs.git] / .emacs.d / elisp / yasnippet / snippets / emacs-lisp-mode / file.process
1 #name : a function that process a file
2 #contributor : Xah Lee
3 # --
4 (defun doThisFile (fpath)
5 "Process the file at path FPATH ..."
6 (let ()
7 ;; create temp buffer without undo record or font lock. (more efficient)
8 ;; first space in temp buff name is necessary
9 (set-buffer (get-buffer-create " myTemp"))
10 (insert-file-contents fpath nil nil nil t)
11
12 ;; process it ...
13 ;; (goto-char 0) ; move to begining of file's content (in case it was open)
14 ;; ... do something here
15 ;; (write-file fpath) ;; write back to the file
16
17 (kill-buffer " myTemp")))