Skip to content

Problem with mxp when daemon socket has a name #1

Description

@magandrez

I start my emacs daemon from a systemd unit. In such, I provide a name for the emacs socket (see here).

As it is, check_emacsclient fails on the second if, as it cannot find the correct socket.

I attempted to parametrize this in the following manner:

EMACS_SOCKET_NAME=""

emacsclient() {
  if [ -n "$EMACS_SOCKET_NAME" ]; then
    command emacsclient -s "$EMACS_SOCKET_NAME" "$@"
  else
    command emacsclient "$@"
  fi
}

And modifying main as:

main() {
...
      -s|--socket-name)
        EMACS_SOCKET_NAME="$1"
	shift
        ;;
...

However, I was not able to make it work, and the following echo "foobar" | mxp --socket-name apolloemacs yields, in my case, an exit status of 1 (even after removing set -x).

I would like to provide such support, would you care to point me in the right direction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions