emacs 开始最大化

Sea*_*mus 5 emacs ubuntu

我想要一个键盘快捷键来在最大化的窗口中打开 emacs。我试过了emacs --fullscreen,但那是全屏而不是最大化窗口...也就是说,emacs 窗口覆盖了 ubuntu 菜单栏。emacs -fw获得一个全宽窗口并emacs -fh获得一个全高窗口,但是如果您同时放置两个选项,它只会读取第二个选项。目前,我只有另一个用于最大化窗口的键盘快捷键。有没有办法让 emacs 开始最大化?

Ubuntu 9.10,emacs 22,如果这有区别的话。

Joe*_*nte 3

我的 .emacs 中有这个,然后我将其绑定到一个键:

(defun my-frame-toggle ()
  "Maximize/Restore Emacs frame using 'wmctrl'."
  (interactive)
  (shell-command "wmctrl -r :ACTIVE: -btoggle,maximized_vert,maximized_horz"))

(global-set-key [(control f4)] 'my-frame-toggle)
Run Code Online (Sandbox Code Playgroud)

然后你可以点击CtrlF4并在常规和全屏之间切换(但不要覆盖 Ubuntu 菜单栏和屏幕底部的栏,我现在正在空白显示其名称)。要以这种方式启动,只需调用它:

$ emacs -e "my-frame-toggle"
Run Code Online (Sandbox Code Playgroud)