From e517da66a733f75a2aa353db234f6e08c4e2bb63 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 23 Jul 2020 17:43:45 -0400 Subject: [PATCH] docs/api: fix "Centered frame" snippet --- docs/api.org | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/api.org b/docs/api.org index 54ca1d288a7..6aecd686212 100644 --- a/docs/api.org +++ b/docs/api.org @@ -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