all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: PierGianLuca <luca@magnaspesmeretrix.org>
To: help-gnu-emacs@gnu.org
Subject: Question about Emacs client and server
Date: Wed, 12 Jul 2023 13:34:01 +0200	[thread overview]
Message-ID: <d8097f11-6ebf-4272-de44-f2af78976b0a@magnaspesmeretrix.org> (raw)

I'm on a Linux machine (Ubuntu) with a desktop manager (KDE). It has always been my wish to set up Emacs so that it works as follows:

1a. If no Emacs is running, then launching "Emacs" (from program launcher or command line) should start Emacs and reopen the previous Emacs-desktop configuration.

1b. If Emacs is already running, then launching "Emacs" should open a new empty (scratch) frame.

2a. If Emacs is already running, and a (say .txt) file is double-clicked or sent to "open with Emacs", or called by some other program invoking a text editor, then it should open in a new Emacs frame.

2b. If no Emacs is running, and a file is double-clicked or called by some other program invoking a text editor, then it should open in a new Emacs frame, and the previous Emacs-desktop configuration should be restored.


Now I've managed to almost achieve this behaviour, but I notice that some Emacs frames are "emacsclient" ones (they have a "@" in the status line); others are not. I don't see why they should be different.

And sometimes launching an Emacs instance warns me that the emacs-desktop is already in use. This happens if I'm not careful and am launching "Emacs" instead of "Emacs (client)".

I wonder if anyone here has suggestions on how to achieve the behaviour that I wish – or can tell me if it isn't possible.

I've tried to understand and configure the Emacs server and the emacsclient behaviour for some years now, but in the end I've always given up. I haven't fully grasped how they work yet.

Just to avoid misunderstandings: this is absolutely *not* meant as a criticism of how Emacs works. It's just a request for customization help. And I understand that great part of the problem comes from my ignorance about Emacs's workings.

Cheers!
Luca





             reply	other threads:[~2023-07-12 11:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 11:34 PierGianLuca [this message]
2023-07-12 12:34 ` Question about Emacs client and server Eric S Fraga
2023-07-12 13:35   ` PierGianLuca
2023-07-12 14:59     ` Eric S Fraga
2023-07-12 15:43       ` PierGianLuca
2023-07-12 13:56   ` PierGianLuca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d8097f11-6ebf-4272-de44-f2af78976b0a@magnaspesmeretrix.org \
    --to=luca@magnaspesmeretrix.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.