我使用maxframe.el来最大化我的Emacs框架。
除了在我的双头Mac设置(配备23英寸显示器的Macbook Pro 15英寸笔记本电脑)上,它在所有三个主要平台上均能很好地工作。
当最大化Emacs框架时,该框架会扩展以填充两个监视器的宽度和较大的监视器的高度。
很显然,我希望框架最大化以仅填充它所在的显示器。如何使用elisp检测两个单独的显示器的分辨率?
谢谢,
雅各布
编辑:正如Denis所指出的那样,设置mf-max-width是一个合理的解决方法。但是(正如我应该提到的那样),我希望找到一种既适用于显示器,又适用于任何分辨率的解决方案。也许是Windows特定的w32-send-sys-command风格的OSX特定的东西。
我迅速扫描了您提供给maxframe.el的引用,但我不认为您使用的是与我相同的技术。以下代码段对您有帮助吗?
1 2 3 4 5
| (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)))))) |
自定义`mf-max-width \\'是否有效?其文档:
1 2 3 4 5
| "*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." |
这种事情是窗口管理器的工作,而不是emacs的工作。 (例如,Xmonad可以很好地处理全屏emacs。)