gpt4 book ai didi

emacs - 使用 elisp 将 Emacs 框架最大化到仅一台显示器

转载 作者:行者123 更新时间:2023-12-04 01:05:02 24 4
gpt4 key购买 nike

我用 maxframe.el最大化我的 Emacs 框架。

除了我的双头 Mac 设置(配备 23 英寸显示器的 Macbook Pro 15 英寸笔记本电脑)外,它在所有三个主要平台上都运行良好。

最大化 Emacs 框架时,框架会扩展以填充两个显示器的宽度和较大显示器的高度。

显然,我希望框架最大化以仅填充它所在的显示器。如何使用elisp检测两个独立显示器的分辨率?

谢谢,
雅各布

编辑:正如丹尼斯指出的那样,设置 mf-max-width 是一个合理的解决方法。但是(正如我应该提到的)我希望有一个适用于显示器和任何分辨率的解决方案。也许是特定于 Windows 的 w32-send-sys-command 风格中特定于 OSX 的东西。

最佳答案

我快速扫描了您提供给 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 - 使用 elisp 将 Emacs 框架最大化到仅一台显示器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/93415/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com