mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
docs/api: fix "Centered frame" snippet
This commit is contained in:
12
docs/api.org
12
docs/api.org
@ -515,13 +515,15 @@ These are side-by-side comparisons, showing how to bind keys with and without
|
|||||||
* Interesting snippets
|
* Interesting snippets
|
||||||
** Center Emacs' initial frame with a fixed size
|
** Center Emacs' initial frame with a fixed size
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(let ((display-height (display-pixel-height))
|
(let ((width 500)
|
||||||
|
(height 250)
|
||||||
|
(display-height (display-pixel-height))
|
||||||
(display-width (display-pixel-width)))
|
(display-width (display-pixel-width)))
|
||||||
(pushnew! initial-frame-alist
|
(pushnew! initial-frame-alist
|
||||||
`(left . ,(/ display-width 2))
|
`(left . ,(- (/ display-width 2) (/ width 2)))
|
||||||
`(top . ,(/ display-height 2))
|
`(top . ,(- (/ display-height 2) (/ height 2)))
|
||||||
`(width . ,display-width)
|
`(width text-pixels ,width)
|
||||||
`(height . ,display-height)))
|
`(height text-pixels ,height)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Persist Emacs' initial frame position, dimensions and/or full-screen state across sessions
|
** Persist Emacs' initial frame position, dimensions and/or full-screen state across sessions
|
||||||
|
Reference in New Issue
Block a user