Skip to content

Instantly share code, notes, and snippets.

@sluchin
Created December 6, 2012 15:12
Show Gist options
  • Save sluchin/4225167 to your computer and use it in GitHub Desktop.
Save sluchin/4225167 to your computer and use it in GitHub Desktop.
;; 画面の解像度によりフレームサイズを変化させる
(when window-system
(let ((height-gain))
(cond ((>= (x-display-pixel-height) 900)
(setq height-gain 0.9))
((>= (x-display-pixel-height) 768)
(setq height-gain 0.8))
(t
(setq height-gain 0.7)))
(message "%f" height-gain)
(message "%f" (floor (/ (* (x-display-pixel-height) height-gain)
(frame-char-height))))
(set-frame-size (selected-frame)
100 ; 幅は解像度に関係なく固定
(floor (/ (* (x-display-pixel-height) height-gain)
(frame-char-height))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment