From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Not reloading the desktop; already loaded Date: Sat, 29 Oct 2022 08:48:26 +0300 Message-ID: <837d0jji39.fsf@gnu.org> References: <6568e483-d5d8-cd60-c51b-abbf3f4839da@akwebsoft.com> <831qqslc2e.fsf@gnu.org> <5ccf9868-c656-61a7-e5e7-31faba8d4a3a@akwebsoft.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24090"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 29 07:56:01 2022 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 1ooep6-00068U-UV for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 29 Oct 2022 07:56:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooemr-0004XR-VT; Sat, 29 Oct 2022 01:53:41 -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 1ooehr-0002Uy-6g for help-gnu-emacs@gnu.org; Sat, 29 Oct 2022 01:48:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooehq-0002Ol-Uh for help-gnu-emacs@gnu.org; Sat, 29 Oct 2022 01:48:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ApOFpq3/wDnxG+OgeFyAObIRp0C2WtC9nYxx+qMYHX4=; b=o4Qwtag1XRBx CZhUUyqCL+wP6Yy8/DDsiV7LGEmSPvtIutTOoj7sgw3hHPv91slF2cU1L+Dh4yX05UqAvK8KCdAH6 T1K8GqeVv5xrAEmGJOj4YYKnXunRdoziHo7o/j3AWNFBLpv89lKyH8NSuTG37qhEtsS9ibzdAC42u Q5rqpRsEecGoyh072uQjKjQTWT6BCt+a97qR4bZx4YmmXzKfC3cOMiG+Ss1zco+OTHB4/4nFHgxLT YthNDpnIIMqoLlQnKajJdBdSpFQu6ljGDVey0I1Q15ZuTj7l1pK4LutTCjKPm4BJPgFlz4KJIGfkw SGg8JyowxzNwMBP2NV3K1A==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooehp-0006BA-QC for help-gnu-emacs@gnu.org; Sat, 29 Oct 2022 01:48:30 -0400 In-Reply-To: <5ccf9868-c656-61a7-e5e7-31faba8d4a3a@akwebsoft.com> (message from Tim Johnson on Fri, 28 Oct 2022 11:27:12 -0800) 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: , Original-Sender: "help-gnu-emacs" Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140486 Archived-At: > Date: Fri, 28 Oct 2022 11:27:12 -0800 > From: Tim Johnson > > > I assume yours is an interactive (i.e., no "--batch") session, so the > > condition that applies in your case is the one about the "owner" of > > the desktop file. So the problem is that the desktop file was (of > > course) written by the same Emacs process as the current one, and you > > need to work around that. One way is to override the definition of > > desktop-owner. > How would I do that? (feel free to point to documentation and I will > also search > on your last phrase) The simplest way is to define your own version of that function that is similar, but not identical. A less brute-force way is to "advise" the function; see the node "Advising Functions" in the ELisp manual. > > Another way is to release the desktop file lock before > > you load the second one, and then re-lock it afterwards. > Again: how would I do that? Look at the functions in desktop.el which do that: desktop-claim-lock and desktop-release-lock. You can call them from your code. > > And there > > are probably others. > Sure, such as use elisp instead of bash to delete the file lock ... Deleting the lock is not something I'd recommend. It is there for a reason.