1 # contributor: Xah Lee (XahLee.org)
2 # name: a function that process a file
5 (defun doThisFile (fpath)
6 "Process the file at path FPATH ..."
8 ;; create temp buffer without undo record or font lock. (more efficient)
9 ;; first space in temp buff name is necessary
10 (set-buffer (get-buffer-create " myTemp"))
11 (insert-file-contents fpath nil nil nil t)
14 ;; (goto-char 0) ; move to begining of file's content (in case it was open)
15 ;; ... do something here
16 ;; (write-file fpath) ;; write back to the file
18 (kill-buffer " myTemp")))