Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
602 B

4 years ago
  1. # -*- mode: snippet -*-
  2. # name: a function that process a file
  3. # contributor : Xah Lee
  4. # --
  5. (defun doThisFile (fpath)
  6. "Process the file at path FPATH ..."
  7. (let ()
  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)
  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. (kill-buffer " myTemp")))