diff options
Diffstat (limited to '.emacs.d/mysnippets/text-mode/emacs-lisp-mode/file.process')
| -rw-r--r-- | .emacs.d/mysnippets/text-mode/emacs-lisp-mode/file.process | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/file.process b/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/file.process deleted file mode 100644 index abd1a33..0000000 --- a/.emacs.d/mysnippets/text-mode/emacs-lisp-mode/file.process +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 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"))) | ||
