This little function opens the current buffer in the largest available window.
"Open current buffer in largest window"
(let ((oldbuf (current-buffer)))
(global-set-key (kbd "C-x 5") 'open-in-largest-window)
I’m regulary jumping between my big display and the notebook screen.
This little function resizes and repositions my emacs window based on the screen size.
You will need to adjust the sizes to your need.
(defun set-frame-size-according-to-resolution ()
(if (> (x-display-pixel-width) 1500) ;; 1500 is the delimiter marging in px to consider the screen big
(set-frame-width (selected-frame) 237) ;; on the big screen make the fram 237 columns big
(set-frame-width (selected-frame) 177)) ;; on the small screen we use 177 columns
(setq my-height (/ (- (x-display-pixel-height) 150) ;; cut 150 px of the screen height and use the rest as height for the frame
(set-frame-height (selected-frame) my-height)
(set-frame-position (selected-frame) 3 90) ;; position the frame 3 pixels left and 90 px down
(global-set-key (kbd "C-x 9") 'set-frame-size-according-to-resolution)
Just put this in your .emacs or any other startup script