I am writing this mode where I only want to show one paragraph at a time. Ideally I'd like to show the paragraph in the center of the screen. Getting it horizontally centered is trivial, but I have not found out how to enter text vertically. What do you think would be the best way to achieve vertical alignment of a few lines of text in an otherwise empty buffer?
Currently thinking of:
- Pasting paragraph into new buffer
- Adding a bunch of new-lines
- Going to the top of the buffer
- Select the visible buffer
- Count the number of empty lines in visible buffer with (how-many "^$")
- Ensure that there are empty-lines-in-visible-buffer/2 empty lines before the paragraph.
I'm sure there is a better way to do this though.