Skip to content

Commit

Permalink
docs/api: fix "Centered frame" snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
hlissner committed Jul 24, 2020
1 parent e622184 commit e517da6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/api.org
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,15 @@ These are side-by-side comparisons, showing how to bind keys with and without
* Interesting snippets
** Center Emacs' initial frame with a fixed size
#+BEGIN_SRC elisp
(let ((display-height (display-pixel-height))
(display-width (display-pixel-width)))
(let ((width 500)
(height 250)
(display-height (display-pixel-height))
(display-width (display-pixel-width)))
(pushnew! initial-frame-alist
`(left . ,(/ display-width 2))
`(top . ,(/ display-height 2))
`(width . ,display-width)
`(height . ,display-height)))
`(left . ,(- (/ display-width 2) (/ width 2)))
`(top . ,(- (/ display-height 2) (/ height 2)))
`(width text-pixels ,width)
`(height text-pixels ,height)))
#+END_SRC

** Persist Emacs' initial frame position, dimensions and/or full-screen state across sessions
Expand Down

0 comments on commit e517da6

Please sign in to comment.