Mac – How to set the initial window position in Cocoa emacs

cocoaemacs

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)

EDIT:

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")))

Best Answer

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

http://paste.lisp.org/display/6194

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

Related Question