Can I detect the display size/resolution in Emacs?

谁都会走 提交于 2019-11-28 22:45:38

问题


I'd like to change the window/frame size of my XEmacs based on the current display resolution.

This is useful when I run my laptop either by itself or attached to a docking station with an external monitor. In either situation, I'd like Emacs to detect the primary screen resolution and adjust its main window frame size accordingly when I start it up.


回答1:


The current display resolution is available using the following functions (both non-interactive).

(x-display-pixel-width)
(x-display-pixel-height)



回答2:


For a more cross-platform solution, look at

(display-pixel-width)
(display-pixel-height)

If what you actually want to do is set the Emacs window to full screen on start-up, check out maxframe.el.



来源:https://stackoverflow.com/questions/2151449/can-i-detect-the-display-size-resolution-in-emacs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!