How can I launch emacsclient maximized from the commandline
Asked Answered
T

3

6

I am wonder how to start emacsclient in a new maximized frame.

emacsclient -c 

starts a new frame but the man page indicated no way to maximize this frame. There are no such options as --maximized.

Warning : this is no a duplicate from the post : How do I provide a command-line option to emacsclient?. Indeed, the answers of this post don't fix my issue. They use the -F option which seems to be documented on the man for them but which is not present in my man emacsclient (in debian sid) and the -F option does not work in my case :

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

Here is the result of emacsclient --help for information :

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.
Taratarabar answered 29/11, 2013 at 12:35 Comment(3)
Why not just start another emacs process? Is there a particular reason you have to use emacsclient for this task? Using regular emacs on Solaris I can launch it full screen from the command-line by using the -fs option.Tenebrific
If you want to start in a maximized frame every time, you might want to try the first answer to this questionTenebrific
Also, this seems relevant to your post.Tenebrific
T
17
(add-to-list 'default-frame-alist '(fullscreen . fullboth)) 

in .emacs does the job.

Taratarabar answered 13/12, 2013 at 11:50 Comment(1)
Note that this causes emacsclient to start fullscreen. To maximize, replace fullboth with maximized.Prolonge
M
8

Here's a minimal working example from Evgeny's answer

  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))"
Mycorrhiza answered 13/2, 2017 at 22:35 Comment(0)
F
3

You can try using ‘-F alist’ or ‘--frame-parameters=alist’ option.

alist format is described here

You can select width, height and font so that you'll have comfortable window size.

Fabien answered 12/12, 2013 at 17:28 Comment(5)
Excuse me, but I couldn't decrypt the abbreviation you've used (MWE). Did you mean MEW? But I guess you ask me to show you a screenshot with emacsclient opened. If so, I'm afraid I can't do that - I don't use it.Fabien
Sorry, MWE for minimal working example. That is to say a code which produces what I want (instead of indicate paths to a possible answer)Taratarabar
(add-to-list 'default-frame-alist '(width . 90)) (add-to-list 'default-frame-alist '(height . 40)) (add-to-list 'default-frame-alist '(font . "Monospace-10")) That's the code you can find following the link I provided. Sorry if this doesn't help you.Fabien
This isn't fullscreen. I answered myself with the proper command (which is a correct MWE). But thanks for leading my to a solution (I give you the boundty).Taratarabar
I'm glad that it helped either way))Fabien

© 2022 - 2024 — McMap. All rights reserved.