2

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?

Peter
  • 971
  • 8
  • 15
  • This question probably belongs on "SuperUser", but isn't it possible that Emacs is being overridden by the KDE window manager? I have endless problems with Gnome with it overriding window sizes and things. –  Oct 30 '09 at 01:10

1 Answers1

2

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.

AFoglia
  • 7,968
  • 3
  • 35
  • 51
  • Quote from the link: If these settings affect the frame geometry and appearance, you'll see the frame appear with the wrong ones and then change to the specified ones. If that bothers you, you can specify the same geometry and appearance with X resources; those do take effect before the frame is created. See X Resources. It doesn't bother me that it changes. What bothers me is the LAST configuration is not what I asked for with initial-frame-alist. I probably should have been clearer in my question that I assumed the initial position (& font) was the X default. What is the LAST one? – Peter Oct 30 '09 at 02:03