From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: PierGianLuca Newsgroups: gmane.emacs.help Subject: Question about Emacs client and server Date: Wed, 12 Jul 2023 13:34:01 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6901"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 12 13:34:54 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qJY7S-0001WZ-C0 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 12 Jul 2023 13:34:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJY6p-0001rS-GI; Wed, 12 Jul 2023 07:34:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJY6n-0001r0-CF for help-gnu-emacs@gnu.org; Wed, 12 Jul 2023 07:34:13 -0400 Original-Received: from manu28.manufrog.com ([138.128.182.226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJY6i-0004LO-JV for help-gnu-emacs@gnu.org; Wed, 12 Jul 2023 07:34:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=magnaspesmeretrix.org; s=default; h=Content-Transfer-Encoding:Content-Type: Subject:From:To:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yana6MvQV6943sLAtMIhO2JpXVS5xQrZNdmhde25jzc=; b=vaoFk1VFyyDvP39fRHi4L9NWeY I9UZlmgt9W60E2deZXQyxQB9FSDyTBf0gRQrmKcdfgK8yGcETZyilk42p7reiLz207mHa5y92Ez5v pdZv7QxAabAE3oVtStNZTslFx; Original-Received: from [88.94.110.2] (port=46302 helo=[10.0.0.18]) by manu28.manufrog.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1qJY6l-0000pg-00 for help-gnu-emacs@gnu.org; Wed, 12 Jul 2023 13:34:04 +0200 Content-Language: en-GB X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - manu28.manufrog.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - magnaspesmeretrix.org X-Get-Message-Sender-Via: manu28.manufrog.com: authenticated_id: luca@magnaspesmeretrix.org X-Authenticated-Sender: manu28.manufrog.com: luca@magnaspesmeretrix.org Received-SPF: pass client-ip=138.128.182.226; envelope-from=luca@magnaspesmeretrix.org; helo=manu28.manufrog.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144243 Archived-At: 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