如何从命令行启动最大化的emacsclient

5
我想知道如何在一个新的最大化窗口中启动emacsclient。
emacsclient -c 

启动一个新的框架,但是 man页面中没有指示如何最大化这个框架。 没有任何选项如--maximized

警告:这不是How do I provide a command-line option to emacsclient?的重复内容。 实际上,这篇帖子的答案并不能解决我的问题。它们使用-F选项,在他们的man中似乎已经记录了该选项,但是在我的man emacsclient(在debian sid中)中不存在-F选项,并且-F选项在我的情况下无效:

$ emacsclient -c  -F "((fullscreen . maximized))"
     emacsclient: unrecognized option '-F'
     Try `emacsclient --help' for more information

以下是 emacsclient --help 命令的结果信息:

emacsclient --help
Usage: emacsclient [OPTIONS] FILE...
Tell the Emacs server to visit the specified files.
Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.

The following OPTIONS are accepted:
-V, --version           Just print version info and return
-H, --help              Print this usage information message
-nw, -t, --tty          Open a new Emacs frame on the current terminal
-c, --create-frame      Create a new frame instead of trying to
                        use the current Emacs frame
-e, --eval              Evaluate the FILE arguments as ELisp expressions
-n, --no-wait           Don't wait for the server to return
-d DISPLAY, --display=DISPLAY
                        Visit the file in the given display
-s SOCKET, --socket-name=SOCKET
                        Set filename of the UNIX socket for communication
-f SERVER, --server-file=SERVER
                        Set filename of the TCP authentication file
-a EDITOR, --alternate-editor=EDITOR
                        Editor to fallback to if the server is not running
                        If EDITOR is the empty string, start Emacs in daemon
                        mode and try connecting again

Report bugs with M-x report-emacs-bug.

为什么不直接启动另一个emacs进程呢?您使用emacsclient执行此任务的特定原因是什么?在Solaris上使用常规的emacs,我可以通过使用“-fs”选项从命令行启动它全屏。 - Michael Warner
如果您想每次都在最大化的窗口中启动,您可能想尝试此问题的第一个答案。 - Michael Warner
此外,这个 似乎与您的帖子相关。 - Michael Warner
3个回答

16
(add-to-list 'default-frame-alist '(fullscreen . fullboth)) 

在.emacs文件中就能搞定。


4
请注意,这将使emacsclient全屏启动。若想最大化窗口,请将 fullboth 替换为 maximized - Scott Weldon

8
这是Evgeny的答案提供的最小工作示例。
  emacsclient -c -F "'(fullscreen . fullboth)"

  emacsclient -c -F "'(fullscreen . maximized)"

  alias ecx="emacsclient -c -F \"'(fullscreen . maximized)\""

  emacsclient -c -F "((width . 100) (height . 100) (left . 400))"

3
您可以尝试使用“-F alist”或“--frame-parameters=alist”选项。
这里描述了alist格式: 这里 您可以选择宽度、高度和字体,以便拥有舒适的窗口大小。

不好意思,我无法解密您使用的缩写(MWE)。您是指MEW吗? 但我猜您是要求我展示一个打开了emacsclient的屏幕截图。如果是这样,恐怕我做不到 - 我不使用它。 - Evgeny Lukianchikov
抱歉,MWE 代表最小可行示例。也就是说,这是一段能够产生我想要的结果的代码(而不是指出可能答案的路径)。 - ppr
(add-to-list 'default-frame-alist'(宽度。90)) (add-to-list 'default-frame-alist'(高度。40)) (add-to-list 'default-frame-alist'(字体。"Monospace-10")) 这是您可以在我提供的链接中找到的代码。如果这不能帮助您,很抱歉。 - Evgeny Lukianchikov
这不是全屏模式。我用正确的命令回答了自己(这是一个正确的MWE)。但是感谢你引导我找到了解决方案(我给你边界)。 - ppr
不管怎样,我很高兴它能帮到你)) - Evgeny Lukianchikov

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接