Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I disconnect my external cinema display monitor from my Mac laptop (running OS X 10.6), many windows become overly sized, especially Aquamacs (and the terminal window). It creates a frustrating situation where the window is too big for the screen, so that the lower part of the window (where the mini-buffer is) is not visible. This also means that I can find the lower right corner where I can resize the window to make it fit the screen. Restarting Aquamacs does not fix this. Any ideas on how I can resize the windows, or prevent this from happening altogether when I disconnect my screen?

thanks.

share|improve this question

migrated from stackoverflow.com Feb 21 '10 at 22:35

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

up vote 0 down vote accepted

The following will resize an emacs frame (emacs uses an older terminology that predates modern windowing systems, what would normally be called a "window", emacs calls a "frame").

(set-frame-size (selected-frame) <width in characters> <height in characters>)

Also potentially helpful, the following could move the emacs window so the bottom right corner will be visible, if OSX lets the window be placed in such a way that the title bar is above the top of the screen:

(set-frame-position (selected-frame) x y)

Since you cannot see the minibuffer, and these functions are not interactive, and do not have key shortcuts, you could use the version of emacs that runs in Terminal to add a keyboard shortcut to your .emacs as follows:

(define-key global-map "\C-c\C-c"
  (lambda ()
    (interactive)
    (set-frame-size (selected-frame) 80 24)))

If you don't get elisp, this creates a keyboard shortcut globally (working in all buffers) that will resize the current to 80x24 (standard tty size) when you type "Control-c Control-c".

share|improve this answer
add comment

Why don't you just press the maximize button on the window's titlebar?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.