diff options
| author | Simeon Simeonov | 2015-02-04 21:41:42 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2015-02-04 21:41:42 +0100 |
| commit | 897eee81de8b3f6adf0165f50e95600a7b89c20c (patch) | |
| tree | 5ee19c07c40e822e15a6443e5db5601c28913454 /.emacs.d/mysnippets/text-mode/emacs-lisp-mode/file.process | |
| parent | 9a46567eb167e5aef4b2e760c5d6bdc4fe1ba06a (diff) | |
Standalone lisp and snippet repo
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"))) | ||
