From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: How to disable warnings/questions when using desktop-save-mode? Date: Thu, 24 May 2012 22:20:09 -0600 Message-ID: References: <87zk8ztcz7.fsf@math.ethz.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1337919608 26943 80.91.229.3 (25 May 2012 04:20:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 May 2012 04:20:08 +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 May 25 06:20:08 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SXm0U-000376-QN for geh-help-gnu-emacs@m.gmane.org; Fri, 25 May 2012 06:20:06 +0200 Original-Received: from localhost ([::1]:45930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXm0U-0005et-Ad for geh-help-gnu-emacs@m.gmane.org; Fri, 25 May 2012 00:20:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXm0O-0005ej-Cm for help-gnu-emacs@gnu.org; Fri, 25 May 2012 00:20:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXm0M-0007RX-KU for help-gnu-emacs@gnu.org; Fri, 25 May 2012 00:19:59 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:60601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXm0M-0007RR-DY for help-gnu-emacs@gnu.org; Fri, 25 May 2012 00:19:58 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SXm0G-0002bz-56 for help-gnu-emacs@gnu.org; Fri, 25 May 2012 06:19:52 +0200 Original-Received: from c-71-237-25-24.hsd1.co.comcast.net ([71.237.25.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 May 2012 06:19:52 +0200 Original-Received: from kevin.d.rodgers by c-71-237-25-24.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 May 2012 06:19:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-25-24.hsd1.co.comcast.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 In-Reply-To: <87zk8ztcz7.fsf@math.ethz.ch> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84964 Archived-At: On 5/23/12 4:21 AM, Marius Hofert wrote: > 1) I have enabled desktop-save mode (with (desktop-save-mode 1)) since I find this > quite useful. I recently started to use different instances of Emacs (Emacs 24 > GTK Snapshot version on Xubuntu 12.04). Every time I open another instance of > Emacs, I receive "...Warning: desktop file appears to be in > use by PID ... Use it anyway? (y or n)". How can I tell Emacs to not ask me but > always choose y (= yes) here automatically? [I tried (setq desktop-save t) but > I still obtained the warning.] (setq desktop-load-locked-desktop t) > 2) A similar problem appears when a new instance is closed and thus writes to the > desktop file. When closing an older instance afterwards one then obtains > "... Desktop file is more recent than the one loaded. Save anyway?". How can I > tell Emacs to not ask me but choose y (= yes) automatically? > > Maybe 2) is solved by choosing "no" in 1) [which I guess is also fine in most cases]. I think you need to make sure each instance has its own value of desktop base-file-name and/or desktop-base-lock-name, effectively defeating the locking mechanism altogether. You could do that by appending the PID returned by (emacs-pid) to those variables in your ~/.emacs: (setq desktop-base-lock-name (convert-standard-filename (format ".emacs.desktop.lock-%d" (emacs-pid)))) or: (eval-after-load 'desktop '(setq desktop-base-lock-name (format "%s-%d" desktop-base-lock-name (emacs-pid)))) and probably the same for desktop-base-lock-name. -- Kevin Rodgers Denver, Colorado, USA