Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the following set in my .emacs file:

 (if (window-system)
   (set-frame-height (selected-frame) 60)
   (set-frame-position (selected-frame) 50 30))

It sets the frame height correctly but not the frame position. I am running:

GNU Emacs 23.2.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)


The code offered below is not Mac-specific. You'll have to edit it (just ake out any of the *win* references. Here's what I used that work. Tweak it to your liking!

(setq initial-frame-alist
      `((background-color . ,(face-background 'default))
        (foreground-color . ,(face-foreground 'default))
        (horizontal-scroll-bars . nil)
        (vertical-scroll-bars . nil)
        (menu-bar-lines . 0)
        (top . 50)      ;; This is overridden by my-center-frame later.
        (left . 400)        ;; This is overridden by my-center-frame later.
        (cursor-color . "red")
        (mouse-color . "green")))
share|improve this question
What is it doing with your frame position info - is it ignoring it altogether? –  blueberryfields Dec 11 '10 at 6:59

2 Answers 2

up vote 2 down vote accepted

Futzing with the initial-frame-alist settings, ala:

might work. Specifically, try playing with the top and the left properties.

share|improve this answer
This worked perfect. +50 to you. –  Avery Chan Dec 12 '10 at 12:31
I get Symbol's value as variable is void: my-win32 –  incandescentman Jul 28 '14 at 18:10

You're using if incorrectly, the code you pasted will only run the first form if the condition is true (see here). Try using the when macro instead:

(when (window-system)
  (set-frame-height (selected-frame) 60)
  (set-frame-position (selected-frame) 50 30))

This will run each form after the condition if the condition is true.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.