From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Steinar Bang Newsgroups: gmane.emacs.help Subject: Re: Use emacs.desktop when starting emacs from a particular directory Date: Fri, 02 Nov 2018 20:18:42 +0100 Message-ID: <86ftwjl23x.fsf@dod.no> References: <86pnvolrgq.fsf@dod.no> <83muqshcoq.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541186253 30355 195.159.176.226 (2 Nov 2018 19:17:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Nov 2018 19:17:33 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (windows-nt) 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 20:17:29 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 1gIewj-0007pi-0Z for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Nov 2018 20:17:29 +0100 Original-Received: from localhost ([::1]:53148 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIeyp-0006xS-Bu for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Nov 2018 15:19:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIeyJ-0006xL-5y for help-gnu-emacs@gnu.org; Fri, 02 Nov 2018 15:19:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIeyF-0007TU-Nh for help-gnu-emacs@gnu.org; Fri, 02 Nov 2018 15:19:07 -0400 Original-Received: from cadalora.default.sbang.uk0.bigv.io ([2001:41c9:1:424::90]:41216 helo=cadalora.bang.priv.no) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIeyD-0007M0-B9 for help-gnu-emacs@gnu.org; Fri, 02 Nov 2018 15:19:03 -0400 Original-Received: from mccoy (cm-84.212.50.160.getinternet.no [84.212.50.160]) by cadalora.bang.priv.no (Postfix) with ESMTPSA id 498CFCDFF7 for ; Fri, 2 Nov 2018 19:18:43 +0000 (GMT) In-Reply-To: <83muqshcoq.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 01 Nov 2018 20:31:33 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:41c9:1:424::90 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:118557 Archived-At: >>>>> Eli Zaretskii : >> The way I've tried to accomplish it is by starting emacs with the >> following commands: >> cd ~/workspaces >> emacs --eval "(progn (setq desktop-path (expand-file-name \"~/workspaces\")) (desktop-save-mode 1))" >/dev/null 2>&1 & > AFAIK, the above is a mistake: desktop-path should be a list of > strings, not a single string. (I use this feature since time > immemoriam, and it works for me every time.) 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.