unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Question about Emacs client and server
@ 2023-07-12 11:34 PierGianLuca
  2023-07-12 12:34 ` Eric S Fraga
  0 siblings, 1 reply; 6+ messages in thread
From: PierGianLuca @ 2023-07-12 11:34 UTC (permalink / raw)
  To: help-gnu-emacs

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-12 15:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12 11:34 Question about Emacs client and server PierGianLuca
2023-07-12 12:34 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).