How do I set the size of Emacs' window?

前端 未结 10 1451
陌清茗
陌清茗 2020-12-04 06:19

I\'m trying to detect the size of the screen I\'m starting emacs on, and adjust the size and position the window it is starting in (I guess that\'s the frame in emacs-speak)

10条回答
  •  醉梦人生
    2020-12-04 06:26

    The easiest way I've found to do that in an X-Window environment is through X resources. The relevant part of my .Xdefaults looks like this:

    Emacs.geometry: 80x70
    

    You should be able to suffix it with +0+0 location coordinates to force it to the upper-left corner of your display. (the reason I don't do it is that I occasionnally spawn new frames, and it makes things confusing if they appear in the exact same location as the previous one)

    According to the manual, this technique works on MS Windows too, storing the resources as key/value pairs in the registry. I never tested that. It might be great, it might be much more of an inconvenience compared to simply editing a file.

提交回复
热议问题