Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I launch emacsclient maximized from the commandline

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.
like image 585
ppr Avatar asked Nov 28 '22 07:11

ppr


2 Answers

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

in .emacs does the job.

like image 61
ppr Avatar answered Mar 15 '23 14:03

ppr


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))"
like image 31
user178047 Avatar answered Mar 15 '23 15:03

user178047