kc2001
kc2001

Reputation: 5247

How do I start emacs in the upper right hand corner of my Windows display?

Back in my Unix days, I used to be able to start Emacs in the top right corner of my screen by specifying a geometry option on startup. However, if I use

C:\Emacs\emacs-24.2\bin\runemacs.exe -geometry 80x60-0+0 --debug-init

on Windows7, the Emacs window does not stay in the top-right. It does appear to be top right briefly, then the window resizes as Emacs initializes, and shifts out of the top-right corner. It appears that the resize is due to the specification of a font, because when I comment out the following line in my .emacs, the window stays in the top right.

(set-default-font "-*-Courier New-normal-r-*-*-12-90-*-*-c-*-*-ansi-")

Does anybody know how I can force Emacs into the top right corner of the screen (besides using the default font). ;)

Upvotes: 1

Views: 495

Answers (2)

JSON
JSON

Reputation: 4606

Two possible solutions

  1. Specify the font on the command line so it is not processed after the geometry option.

runemacs -fn "Courier New-9" -geometry 80x60-0+0 --debug-init

  1. Specify the geometry in .emacs after the font is changed (-0 does not work in this context, as the sign is discarded by the lisp parser).

(setq initial-frame-alist '((top . 0) (left . -1) (width . 80) (height . 60)))

Upvotes: 5

Ralph
Ralph

Reputation: 5232

Shouldn't that be -0+0 for the upper right hand corner? That does the trick for me using Emacs 21.3.

Upvotes: 1

Related Questions