0

I want to display the emacs frame in the middle of the monitor. At first the emacs window is placed at the center, but after setting initial-frame-alist and the font height, the frame is repositioned off-center.

(setq initial-frame-alist '((width . 75) (height . 21)))
(set-face-attribute 'default nil :height 160 :weight 'bold)

Have also used

(defun frame-center (&optional frame display)
  (interactive)
  (set-frame-position frame
     (/ (- (display-pixel-width display) (frame-pixel-width frame)) 2)
     (/ (- (display-pixel-height display) (frame-pixel-height frame)) 2)))

but which does not work with multiple monitors.

What can I do to keep the frame centered in the current monitor?

Dilna
  • 1,173
  • 3
  • 10

0 Answers0