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: Fri, 28 Oct 2022 09:03:21 +0300 Message-ID: <831qqslc2e.fsf@gnu.org> References: <6568e483-d5d8-cd60-c51b-abbf3f4839da@akwebsoft.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20219"; 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 Fri Oct 28 08:04:55 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 1ooIUB-00050D-2H for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 28 Oct 2022 08:04:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooITH-0001pt-Hg; Fri, 28 Oct 2022 02:04:00 -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 1ooISm-0001kN-T4 for Help-gnu-emacs@gnu.org; Fri, 28 Oct 2022 02:03:35 -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 1ooISm-0004te-2T for Help-gnu-emacs@gnu.org; Fri, 28 Oct 2022 02:03:28 -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=1kc1BGI6pet14GC/BPT0eNcTn0N40TFEJ9GViVotLts=; b=b9Zv3DMknW3o X7UKjE1mDz64uAe6ztFmcPgn6jm52qXL0CcBuFcT9EeKvzERwoYh1IJlgCF3FXS6d+bLmfy5APA0z D4NOBsYxDVc6jbjUPXT71K6SF0/cJoChPhS3l86PldzHg609SmEyaM7CA1cwztgcecI9k2gpMCFf3 CjaqofX844UO8qN9Lo5j2yKfgPBwYWSSyxyHBrgym5aUhMZvJXmIgur9nw6l2mYrHrzbfyX0LRqNA +vecEbJy3x9/T8bTE2MDFIg/bUuKncpUSmbxE2y/5+vPdIG2XFPFKZTr4QpG7ycsyyjw5ofLEOZwW jzfvt96Ng8SqmIkezv0AGg==; 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 1ooISk-0000Cm-9z for Help-gnu-emacs@gnu.org; Fri, 28 Oct 2022 02:03:27 -0400 In-Reply-To: <6568e483-d5d8-cd60-c51b-abbf3f4839da@akwebsoft.com> (message from Tim Johnson on Thu, 27 Oct 2022 14:41:42 -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:140451 Archived-At: > Date: Thu, 27 Oct 2022 14:41:42 -0800 > From: Tim Johnson > > I have written my own project management module using 'desktop. > If I have loaded a desktop file for a project and attempt to switch to a > different project > I get the following message: > > "Not reloading the desktop; already loaded" > > and the loading of the second desktop file is suppressed. > > I suspect that the problem will be solved by customizing 'desktop, > but do not know how to proceed. Look at the code which issues this message: (if (or noninteractive (and (desktop-owner) (= (desktop-owner) (emacs-pid)))) (message "Not reloading the desktop%s" (if noninteractive "" "; already loaded")) 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. Another way is to release the desktop file lock before you load the second one, and then re-lock it afterwards. And there are probably others.