Skip to content

Instantly share code, notes, and snippets.

@wangkuiyi
Created April 18, 2021 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wangkuiyi/967926a7eb41a75c738e4ed8c6bf833b to your computer and use it in GitHub Desktop.
Save wangkuiyi/967926a7eb41a75c738e4ed8c6bf833b to your computer and use it in GitHub Desktop.
Move Emacs window to the right half of the screen
;; Move emacs window to the right half screen. -50 is a hack for macOS.
(let ((frame (selected-frame))
(one-half-display-pixel-width (/ (display-pixel-width) 2)))
(set-frame-width frame one-half-display-pixel-width nil 'pixelwise)
(set-frame-height frame (- (display-pixel-height) 50) nil 'pixelwise)
(set-frame-position frame one-half-display-pixel-width 0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment