Emacs config utilizing prelude as a base
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
382 B

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