emacsclient:tldr:07a3b
The command emacsclient --eval '(${command})'
is used to evaluate a piece of elisp code within an Emacs server session.
Here's how it works:
-
emacsclient
: This command is used to connect to an existing Emacs server session or start a new one if it doesn't exist. -
--eval
: This option tellsemacsclient
to evaluate the following elisp code. -
'(${command})'
: The code within the single quotes is the elisp code to be evaluated.${command}
is a placeholder for the actual command you want to execute within Emacs server.
The code within '(${command})'
will be replaced by the desired elisp code before execution.
Let's say you want to evaluate the elisp code (message "Hello, world!")
within an Emacs server session. You can use the following command:
emacsclient --eval '(message "Hello, world!")'
The emacsclient
command will connect to the Emacs server, send the (message "Hello, world!")
code for evaluation, and then exit.
The output of the code, in this case, would be the message "Hello, world!" displayed in the Emacs server's message area or as a notification depending on your Emacs configuration.