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.

18 lines
403 B

5 years ago
  1. # -*- mode: snippet -*-
  2. # contributor: Xah Lee (XahLee.org)
  3. # name: read lines of a file
  4. # key: x-file
  5. # --
  6. (defun read-lines (filePath)
  7. "Return a list of lines in FILEPATH."
  8. (with-temp-buffer
  9. (insert-file-contents filePath)
  10. (split-string
  11. (buffer-string) "\n" t)))
  12. ;; process all lines
  13. (mapc
  14. (lambda (aLine)
  15. (message aLine) ; do your stuff here
  16. )
  17. (read-lines "inputFilePath")
  18. )