使用elisp将Emacs框架最大化到仅一台显示器
时间:2020-03-06 14:21:48 来源:igfitidea点击:
我使用maxframe.el来最大化我的Emacs框架。
除了在我的双头Mac设置(配备23英寸显示器的Macbook Pro 15英寸笔记本电脑)上,它在所有三个主要平台上均能正常工作。
当最大化Emacs框架时,框架会扩展以填充两个监视器的宽度和较大的监视器的高度。
显然,我希望框架最大化以仅填充它所在的监视器。如何使用elisp检测两个单独的显示器的分辨率?
谢谢,
雅各布
编辑:正如丹尼斯指出,设置mf-max-width是一个合理的解决方法。但是(正如我应该提到的那样),我希望找到一种既适用于显示器又适用于任何分辨率的解决方案。可能是特定于Windows的w32-send-sys-command风格的特定于OSX的东西。
解决方案
定制`mf-max-width'是否有效?其文档:
"*The maximum display width to support. This helps better support the true nature of display-pixel-width. Since multiple monitors will result in a very large display pixel width, this value is used to set the stop point for maximizing the frame. This could also be used to set a fixed frame size without going over the display dimensions."
我快速浏览了我们提供给maxframe.el
的引用,但我不认为我们使用的是与我相同的技术。以下代码段对我们有帮助吗?
(defun toggle-fullscreen () "toggles whether the currently selected frame consumes the entire display or is decorated with a window border" (interactive) (let ((f (selected-frame))) (modify-frame-parameters f `((fullscreen . ,(if (eq nil (frame-parameter f 'fullscreen)) 'fullboth nil))))))
这种事情是窗口管理器的工作,而不是emacs的工作。 (例如,Xmonad可以很好地处理全屏emacs。)