From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Use emacs.desktop when starting emacs from a particular directory Date: Fri, 02 Nov 2018 23:32:03 +0200 Message-ID: <83sh0jf9nw.fsf@gnu.org> References: <86pnvolrgq.fsf@dod.no> <83muqshcoq.fsf@gnu.org> <86ftwjl23x.fsf@dod.no> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1541194974 29685 195.159.176.226 (2 Nov 2018 21:42:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Nov 2018 21:42:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 02 22:42:50 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gIhDN-0007cH-DY for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Nov 2018 22:42:49 +0100 Original-Received: from localhost ([::1]:53500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIhFT-0001Wc-HL for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Nov 2018 17:44:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIhEy-0001Qv-6C for help-gnu-emacs@gnu.org; Fri, 02 Nov 2018 17:44:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIh3K-0002cN-4F for help-gnu-emacs@gnu.org; Fri, 02 Nov 2018 17:32:31 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIh3A-0002XP-MT for help-gnu-emacs@gnu.org; Fri, 02 Nov 2018 17:32:21 -0400 Original-Received: from [176.228.60.248] (port=4137 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gIh38-0006go-6y for help-gnu-emacs@gnu.org; Fri, 02 Nov 2018 17:32:15 -0400 In-reply-to: <86ftwjl23x.fsf@dod.no> (message from Steinar Bang on Fri, 02 Nov 2018 20:18:42 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:118565 Archived-At: > From: Steinar Bang > Date: Fri, 02 Nov 2018 20:18:42 +0100 > > >>>>> Eli Zaretskii : > > Thanks! I've changed the commands starting emacs to: > cd ~/workspaces > emacs --eval "(progn (progn (push (expand-file-name \"~/workspaces\") desktop-path) (desktop-save-mode 1)) (desktop-save-mode 1))" >/dev/null 2>&1 & > > Now desktop-path has the following value after startup: > ("/home/sb/workspaces" "~/.emacs.d/" "~") > Original value was > ("~/.emacs.d/" "~") > > However, emacs still saves and restores state from the > ~/.emacs.d/.emacs.desktop file. First, why do you use 'push' instead of 'setq'? Don't you want to replace desktop-path for this invocation? Second, is there actually an .emacs.desktop file in the ~/workspaces directory? Here's what I do for a long time in my .emacs: (setq desktop-path '("." ".." "../.." "../../..")) (desktop-save-mode 1) Then starting Emacs in a directory with a .emacs.desktop file reads that desktop file. So this feature works, it's just that something in your case prevents it from working for you. Perhaps some debugging is in order.