I want to get the first line of the buffer I'm actually in. More generally, I'm looking for a utility that returns Nth line from a supplied buffer. Is there some built-in for that?
This could be done with the next function (with or without narrowing):
(defun get-nth-line (number) "Get line with NUMBER" (save-restriction (widen) (save-excursion (goto-line number) (buffer-substring-no-properties (line-beginning-position) (line-end-position)))))
To get the first line execute
If you want to get text properties, then use
buffer-substring instead of