Initial emacs position in KDE

1k views Asked by At

I use emacs 23.1.1 with KDE 4.3.1. I have set (initial-frame-alist) and (default-frame-alist) to make my windows come up where I want. But my initial window does not come up where I want.

My initial window comes up with one font, changes font, changes size, moves (to where I want) and then finally repositions to somewhere else. It's this last move I want to prevent.

What else do I need to check or turn off?

initial-frame-alist's value is

((left . -1)
 (vertical-scroll-bars . right)
 (menu-bar-lines . 0)
 (tool-bar-lines . 0))

default-frame-alist's value is

((cursor-color . "yellow")
 (foreground-color . "#E0F0FF")
 (background-color . "#000000")
 (width . 80)
 (height . 78)
 (top . 0)
 (left . 432)
 (vertical-scroll-bars . right)
 (menu-bar-lines . 0)
 (tool-bar-lines . 0))

Hmm repeated scroll bar placement and turning off of menu and tool bars. I could clean that up. Anyway, any thoughts?

1

There are 1 answers

1
AFoglia On

It sounds like emacs is creating the initial frame before reading your configuration file, then moving the frame as directed. (This is also what the documentation claims.) You need to change this setting before the frame is even created. That's what X Windows resources are for.

(This gets into the details of X configuration, and I can never remember the nuances, but here's how I do it.)

In my home directory, I have a file called .Xresources. In it I set my emacs font. You'll want to set your emacs position. Assuming your fonts are 7x12 pixels and ignoring menus and scroll bars.

Emacs.geometry:  560x936+0+432

Now to update your X settings to reflect the new settings. At the command prompt run

$ xrdb -merge ~/.Xresources

And launch emacs, and hopefully it will be in the correct place. You'll want to play with the size to fit in the menus and scroll bars. The position might be off slightly because it may be applied to the undecorated window (i.e. the window without the title bar).

On my system, the ~/.Xresources is read automatically on log in. If not for you, add the command to the appropriate configuration file (probably ~/.profile).

Here's a link to the X Windows docs on Geometry Specification. And here's a full list of resources that emacs knows about.