Function: magit-file-lines

magit-file-lines is a byte-compiled function defined in magit-base.el.

Signature

(magit-file-lines FILE &optional KEEP-EMPTY-LINES)

Documentation

Return a list of strings containing one element per line in FILE.

Unless optional argument KEEP-EMPTY-LINES is t, trim all empty lines.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-base.el
(defun magit-file-lines (file &optional keep-empty-lines)
  "Return a list of strings containing one element per line in FILE.
Unless optional argument KEEP-EMPTY-LINES is t, trim all empty lines."
  (and (file-regular-p file)
       (with-temp-buffer
         (insert-file-contents file)
         (split-string (buffer-string) "\n" (not keep-empty-lines)))))