Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Emacs: Start Maximized by Default?

  1. #1
    Join Date
    Aug 2006
    Beans
    59

    Emacs: Start Maximized by Default?

    How can I make emacs start maximized by default? Is there anything I could do to .emacs? By default, emacs starts up with a rather small window and it's a little annoying.

    Thanks in advance.

  2. #2
    Join Date
    Apr 2007
    Beans
    14,781

    Re: Emacs: Start Maximized by Default?

    man emacs:

    Code:
    --geometry geometry
                   Set the Emacs window's width, height, and  position  as  speci-
                   fied.   The geometry specification is in the standard X format;
                   see X(1) for more information.  The width and height are speci-
                   fied  in  characters;  the  default is 80 by 24.  See the Emacs
                   manual, section "Options for Window  Size  and  Position",  for
                   information on how window sizes interact with selecting or des-
                   electing the tool bar and menu bar.

  3. #3
    Join Date
    May 2008
    Location
    London, UK
    Beans
    6

    Re: Emacs: Start Maximized by Default?

    Within gnome/ubuntu, I find the --geometry option doesn't always give what I want. It will only allow me to set the size/location to certain maximums only (maximums which don't match the height of my display).

    Alternatively, for running emacs in full screen, just do the command :

    $ emacs -fs

    Or, for emacs in full height, do:

    $ emacs -fh

    Darren
    Last edited by djs_uk; May 5th, 2008 at 03:36 AM.

  4. #4
    Join Date
    Aug 2006
    Beans
    59

    Re: Emacs: Start Maximized by Default?

    Thanks for the help.

    I changed my .Xdefaults to make emacs start a bit bigger on start up, but it's still not ideal. It is technically not "maximized", but simply "resized to fill the entire screen". Call me obsessive-compulsive, but I'm somewhat bothered by this and will still hit "maximize".

    Full screen is actually kind of cool and I'll certainly make use of it, especially as a way to force myself to not get sidetracked. But for most purposes, I would definitely prefer just having it maximized.

    Looks like compiz fusion might let me do what I want (I installed compizconfig-settings-manager). There are lots of settings available, and they can be set to apply only to specific programs. Awesome -- but I can't find a setting anywhere for starting a specific program maximized. Fiddlesticks.

    Looks like it's possible to do this in KDE. I'm using Gnome. More fiddlesticks.

    If anyone has a solution, please post. Meanwhile, I'll continue suffering from my obsessive compulsive disorder-induced paranoia that all windows must be maximized.

  5. #5
    Join Date
    Aug 2008
    Beans
    28

    Re: Emacs: Start Maximized by Default?

    Hey guys,

    I ran into this emacs maximized problem as well on ubuntu 8.04. the -fs option actually made it cover my desktop bars at the bottom and top of the screen, and fw and fh would not work together. Posted below is the solution I arrived at for starting emacs maximized, just the way I wanted it:

    Code:
    (defun toggle-fullscreen ()
      (interactive)
      (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
    	    		 '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
      (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
    	    		 '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
    )
    (toggle-fullscreen)
    Just put it in your .emacs, and you should be set. You should probably remove any other -fs/fh/fw command line arguments.

    Hope this helps other emacs users on Hardy.

  6. #6
    Join Date
    May 2006
    Location
    US (MA)
    Beans
    79
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Emacs: Start Maximized by Default?

    Perfect! Thanks, just what I was looking for!
    Dell XPS m1530 T9300@2.51 Ghz | 4 Gb | NVidia 8600M | Crucial m4 64Gb SSD | Ubuntu Natty Narwhal 64bit
    Ubuntu User #12366
    Read my blog for my experiences with Ubuntu

  7. #7
    Join Date
    Nov 2008
    Beans
    4

    Re: Emacs: Start Maximized by Default?

    Is there an X resource equivalent to the -fh or --fullheight switch? I tried adding the following to my .Xresources:
    emacs.fullheight: true
    but that did not achieve the desired effect.

    I suppose I could put the elisp that sends X a maximize message in my .emacs, but that seems less clean, elegant, and easy to remember next time I'm setting it up.

  8. #8
    Join Date
    Nov 2008
    Beans
    4

    Re: Emacs: Start Maximized by Default?

    Quote Originally Posted by amacleod View Post
    Is there an X resource equivalent to the -fh or --fullheight switch? I tried adding the following to my .Xresources:
    Sorry.. I should have looked closer at the manpage for emacs before posting. I found my own answer there:
    fullscreen (class Fullscreen)
    The desired fullscreen size. The value can be one of
    fullboth, fullwidth, or fullheight, which correspond to
    the command-line options ‘-fs’, ‘-fw’, and ‘-fh’,
    respectively. Note that this applies to the initial
    frame only.

  9. #9
    Join Date
    Nov 2008
    Beans
    4

    Re: Emacs: Start Maximized by Default?

    I noticed some very strange behavior now that I'm playing with Emacs in fullheight mode. I'm using the GNOME desktop that comes with Ubuntu 8.04.1 LTS. I've got two monitors which I'm using as a single desktop with Xinerama support. When I added a panel to the right side of my right-hand screen, Emacs no longer respects the lower boundary set by the panel on the bottom of the screen (I start Emacs on the left-hand screen by default). The moment I took away the vertical panel on the right, Emacs started fitting nicely between the horizontal top and bottom panels again.

    Interesting thing about the top and bottom panels: the default panels supplied by GNOME only showed up on my left-hand screen, while the right-hand screen had none. In that configuration, Emacs refused to start fullheight in the left-hand screen--it automatically jumped to the right where it had more room. Adding blank/empty panels to the top and bottom of the right hand screen fixed this.

    Anyway, I'm not sure what the cause of this is, but I figured I'd post about it here in case anyone else encountered similar problems.

  10. #10
    Join Date
    Mar 2008
    Beans
    4,715
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Emacs: Start Maximized by Default?

    The devilspie package can help you control the window geometry (placement and size) for all your graphical apps.

    The beauty of devilspie is you don't have to learn a different trick, command or config file syntax to control the window geometry of each app. It is not a large package either.

    Devilspie offers a consistent, lisp-like config language to handle all window geometry rules.

    For example, if you put this in ~/.devilspie/config.ds
    Code:
    ( if 
      ( is ( application_name ) "emacs" )
      ( begin 
        ( geometry "831x1012+0+32" )
      )
    )
    then your emacs application will open with upper left corner at (0,32) and have width of 831 pixels height of 1012 pixels.
    Last edited by unutbu; November 11th, 2008 at 05:22 PM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •