GNU bug report logs - #1474
23.0.60; desktop.el don't check if pid in his lock file is always in use

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Thierry Volpiatto <thierry.volpiatto@HIDDEN>; Keywords: patch; merged with #25232; dated Tue, 2 Dec 2008 21:55:04 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 1474 <at> debbugs.gnu.org:


Received: (at 1474) by debbugs.gnu.org; 24 Jan 2020 16:47:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 24 11:47:44 2020
Received: from localhost ([127.0.0.1]:54690 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iv27U-0001bV-Cv
	for submit <at> debbugs.gnu.org; Fri, 24 Jan 2020 11:47:44 -0500
Received: from ted.gofardesign.uk ([67.225.143.91]:38552)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan@HIDDEN>)
 id 1iv27R-0001bE-Qj; Fri, 24 Jan 2020 11:47:42 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; 
 s=default;
 h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=vQCxccyoBSC9odqKHWEXMc64G+61xn3ztDHApE2MLZU=; b=Xe2esNmpfRCfW6fAl7YIpi3xTV
 uLmDK2bbAXGLmlW8izorHSvuNJyDUNU+vszIZUok3kDN0v3ofh+gtwczxNgiFbtwW0chGbKIuOlrU
 7sw9CcZXv2sZW10DYGg05n0bvqw6gKkRtbJPwhXXp4QwBX7bqDqcaSMnYvOfxvpm4ha+iUwoJLa2j
 TlOYF4ShtLTZbHDJIZFrP4a+D7jZ8UjvsdBHxAzO+cu+fLwoGwl0a84g4xmVrXzo5JhLHFUcozvug
 KxCJqoA/kmUUSlkNAnHhZD3JVVunEJD7zpQNFPVZYZDpptrolE/Do+iaVmEOpldRTK+l99thX5bJK
 nducRPZQ==;
Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:33248
 helo=localhost)
 by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
 (Exim 4.92) (envelope-from <stefan@HIDDEN>)
 id 1iv27H-0015oc-2s; Fri, 24 Jan 2020 11:47:31 -0500
From: Stefan Kangas <stefan@HIDDEN>
To: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock
 file is always in use
In-Reply-To: <87bpvufe28.fsf@HIDDEN> (Thierry Volpiatto's message of
 "Tue, 02 Dec 2008 22:43:43 +0100")
References: <87bpvufe28.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Date: Fri, 24 Jan 2020 17:47:29 +0100
Message-ID: <87v9p094ym.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - ted.gofardesign.uk
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - marxist.se
X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id:
 stefan@HIDDEN
X-Authenticated-Sender: ted.gofardesign.uk: stefan@HIDDEN
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 1474
Cc: 1474 <at> debbugs.gnu.org, emacs@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

tags 1474 + patch
thanks

Thierry Volpiatto <thierry.volpiatto@HIDDEN> writes:

> When killing emacs --daemon or emacs brutally with killall for example,
> when reloading emacs or emacs --daemon, emacs ask if we want to load
> desktop file or not (pid is already in use...).
> I think emacs should check if the PID that is in his lock file is always
> in use.

I agree with the proposal, and have written up a suggested patch.
This would work as follows (taken from my NEWS entry, see the
suggested documentation for more):

    ** Emacs Sessions (Desktop)
    
    +++
    *** New option to load if locking Emacs not running locally.
    The option 'desktop-load-locked-desktop' can now be set to value
    'check', which means to load the desktop only if the locking Emacs
    process is not running on the local machine.  See the "(emacs) Saving
    Emacs Sessions" node in the Emacs manual for details.

The concerns with this proposal was that this breaks if Emacs is
running on a remote machine.  The user could have the lock file in a
remoted directory (e.g. on an NFS mount).  I have therefore documented
in the manual and the doc string that this value should be avoided
under such circumstances.

Another idea suggested in this thread was to change the lock file to
also include (system-name).  That could be done, if it's deemed to be
better, but has the drawback that a lock file from a recent Emacs
would not be recognized by an old Emacs.  (The relevant code reads the
whole buffer.)  A possible work-around is to add the backwards
incompatible system name in a comment instead.  Maybe that is much
more desirable than simply documenting the limitation; it would be
good to hear other opinions on that.

Any comments or suggestions?

Best regards,
Stefan Kangas


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-Load-desktop-without-prompting-if-process-is-dead.patch

From 04c2d26df4f73be675cc9ea6aa2ce10a474ecd18 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@HIDDEN>
Date: Fri, 24 Jan 2020 05:12:20 +0100
Subject: [PATCH] Load desktop without prompting if process is dead

* lisp/desktop.el (desktop-load-locked-desktop): Add new value 'check'
to load desktop file without prompting if locking Emacs process does
not exist on the local machine.  (Bug#1474)
(desktop-read): Extract function from here...
(desktop--load-locked-desktop-p): ...to here.  New function handles
the semantics of 'desktop-load-locked-desktop', including above new
value 'check'.
(desktop--emacs-pid-running-p): New function.

* test/lisp/desktop-tests.el: New file with tests for the above.

* doc/emacs/misc.texi (Saving Emacs Sessions): Document the new
'check' value.
* etc/NEWS: Announce the change.
---
 doc/emacs/misc.texi        |  7 +++++-
 etc/NEWS                   |  9 +++++++
 lisp/desktop.el            | 48 +++++++++++++++++++++++++++---------
 test/lisp/desktop-tests.el | 50 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 102 insertions(+), 12 deletions(-)
 create mode 100644 test/lisp/desktop-tests.el

diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index 6b95b12a84..bedbfb7abe 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -2653,7 +2653,12 @@ Saving Emacs Sessions
 can avoid the question by customizing the variable
 @code{desktop-load-locked-desktop} to either @code{nil}, which means
 never load the desktop in this case, or @code{t}, which means load the
-desktop without asking.
+desktop without asking.  Finally, the @code{check} value means to load
+the file if the Emacs process that has locked the desktop is not
+running on the local machine.  This should not be used in
+circumstances where the locking Emacs might still be running on
+another machine.  This could be the case in multi-user environments
+where your home directory is mounted remotely using NFS or similar.
 
 @cindex desktop restore in daemon mode
   When Emacs starts in daemon mode, it cannot ask you any questions,
diff --git a/etc/NEWS b/etc/NEWS
index 11ef31b2c8..de39912e90 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -90,6 +90,15 @@ supplied error message.
 *** New connection method "media", which allows accessing media devices
 like cell phones, tablets or cameras.
 
+** Emacs Sessions (Desktop)
+
++++
+*** New option to load if locking Emacs not running locally.
+The option 'desktop-load-locked-desktop' can now be set to value
+'check', which means to load the desktop only if the locking Emacs
+process is not running on the local machine.  See the "(emacs) Saving
+Emacs Sessions" node in the Emacs manual for details.
+
 
 * New Modes and Packages in Emacs 28.1
 
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 9538bb4a34..27f6c80531 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -230,16 +230,25 @@ desktop-auto-save-timeout
 (defcustom desktop-load-locked-desktop 'ask
   "Specifies whether the desktop should be loaded if locked.
 Possible values are:
-   t    -- load anyway.
-   nil  -- don't load.
-   ask  -- ask the user.
-If the value is nil, or `ask' and the user chooses not to load the desktop,
-the normal hook `desktop-not-loaded-hook' is run."
+   t      -- load anyway.
+   nil    -- don't load.
+   ask    -- ask the user.
+   check  -- load if locking Emacs process is missing locally.
+
+If the value is nil, or `ask' and the user chooses not to load
+the desktop, the normal hook `desktop-not-loaded-hook' is run.
+
+If the value is `check', load the desktop if the Emacs process
+that has locked it is not running on the local machine.  This
+should not be used in circumstances where the locking Emacs might
+still be running on another machine.  That could be the case if
+you have remotely mounted (NFS) paths in `desktop-dirname'."
   :type
   '(choice
     (const :tag "Load anyway" t)
     (const :tag "Don't load" nil)
-    (const :tag "Ask the user" ask))
+    (const :tag "Ask the user" ask)
+    (const :tag "Load if no local process" check))
   :group 'desktop
   :version "22.2")
 
@@ -662,6 +671,27 @@ desktop-owner
 	     (integerp owner)))
 	 owner)))
 
+(defun desktop--emacs-pid-running-p (pid)
+  "Return t if an Emacs process with PID exists."
+  (when-let ((attr (process-attributes pid)))
+    (string-match "^emacs$" (alist-get 'comm attr))))
+
+(defun desktop--load-locked-desktop-p (owner)
+  "Return t if a locked desktop should be loaded.
+OWNER is the pid in the lock file.
+The return value of this function depends on the value of
+`desktop-load-locked-desktop'."
+  (pcase desktop-load-locked-desktop
+    ('ask
+     (unless (daemonp)
+       (y-or-n-p (format "Warning: desktop file appears to be in use by PID %s.\n\
+Using it may cause conflicts.  Use it anyway? " owner))))
+    ('check
+     (or (eq (emacs-pid) owner)
+         (not (desktop--emacs-pid-running-p owner))))
+    ('nil nil)
+    (_ t)))
+
 (defun desktop-claim-lock (&optional dirname)
   "Record this Emacs process as the owner of the desktop file in DIRNAME.
 DIRNAME omitted or nil means use `desktop-dirname'."
@@ -1238,11 +1268,7 @@ desktop-read
 	      (desktop-save nil)
 	      (desktop-autosave-was-enabled))
 	  (if (and owner
-		   (memq desktop-load-locked-desktop '(nil ask))
-		   (or (null desktop-load-locked-desktop)
-		       (daemonp)
-		       (not (y-or-n-p (format "Warning: desktop file appears to be in use by PID %s.\n\
-Using it may cause conflicts.  Use it anyway? " owner)))))
+                   (not (desktop--load-locked-desktop-p owner)))
 	      (let ((default-directory desktop-dirname))
 		(setq desktop-dirname nil)
 		(run-hooks 'desktop-not-loaded-hook)
diff --git a/test/lisp/desktop-tests.el b/test/lisp/desktop-tests.el
new file mode 100644
index 0000000000..7483bb8adb
--- /dev/null
+++ b/test/lisp/desktop-tests.el
@@ -0,0 +1,50 @@
+;;; desktop-tests.el --- Tests for desktop.el  -*- lexical-binding: t -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'desktop)
+
+(ert-deftest desktop-tests--emacs-pid-running-p ()
+  (should (desktop--emacs-pid-running-p (emacs-pid)))
+  (should-not (desktop--emacs-pid-running-p 1)))
+
+(ert-deftest desktop-tests--load-locked-desktop-p ()
+  (let ((desktop-load-locked-desktop t))
+    (should (desktop--load-locked-desktop-p (emacs-pid)))))
+
+(ert-deftest desktop-tests--load-locked-desktop-p-nil ()
+  (let ((desktop-load-locked-desktop nil))
+    (should-not (desktop--load-locked-desktop-p (emacs-pid)))))
+
+(ert-deftest desktop-tests--load-locked-desktop-p-ask ()
+ (let ((desktop-load-locked-desktop 'ask))
+   (cl-letf (((symbol-function 'y-or-n-p) (lambda (&rest _) t)))
+     (should (desktop--load-locked-desktop-p (emacs-pid))))
+   (cl-letf (((symbol-function 'y-or-n-p) (lambda (&rest _) nil)))
+     (should-not (desktop--load-locked-desktop-p (emacs-pid))))))
+
+(ert-deftest desktop-tests--load-locked-desktop-p-check ()
+  (let ((desktop-load-locked-desktop 'check))
+    (desktop--load-locked-desktop-p (emacs-pid))))
+
+(provide 'desktop-tests)
-- 
2.20.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#1474; Package emacs. Full text available.
Merged 1474 25232. Request was from Ionuț Ciocîrlan <ionut.ciocirlan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to `wishlist' from `normal' Request was from Glenn Morris <rgm@HIDDEN> to control@HIDDEN. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-4.7 required=4.0 tests=AWL,BAYES_00,FOURLA,
	HAS_BUG_NUMBER,PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 21:27:55 +0000
Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB3LRqxY019192
	for <1474@HIDDEN>; Wed, 3 Dec 2008 13:27:53 -0800
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av0EAHWINknO+Jkl/2dsb2JhbACBbdB5gn+BIw
X-IronPort-AV: E=Sophos;i="4.33,710,1220241600"; 
   d="scan'208";a="30612935"
Received: from 206-248-153-37.dsl.teksavvy.com (HELO pastel.home) ([206.248.153.37])
  by ironport2-out.teksavvy.com with ESMTP; 03 Dec 2008 16:27:34 -0500
Received: by pastel.home (Postfix, from userid 20848)
	id 22D568BAF; Wed,  3 Dec 2008 16:27:34 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, "Juanma Barranquero" <lekktu@HIDDEN>,
        emacs-pretest-bug@HIDDEN, emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Message-ID: <jwvprk9vtjm.fsf-monnier+emacsbugreports@HIDDEN>
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	<87zljdkbne.fsf@HIDDEN>
	<f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	<87ej0pve4l.fsf@HIDDEN>
Date: Wed, 03 Dec 2008 16:27:34 -0500
In-Reply-To: <87ej0pve4l.fsf@HIDDEN> (Thierry Volpiatto's message of
	"Wed, 03 Dec 2008 09:47:54 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

> I am sorry but I don't understand why emacs would find a process on
> another computer. In which case ?

E.g. when the user's HOME directory is shared by NFS?


        Stefan




Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,FOURLA,
	HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 21:27:57 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB3LRsKm019197
	for <submit@HIDDEN>; Wed, 3 Dec 2008 13:27:55 -0800
Received: from mail.gnu.org ([199.232.76.166]:59983 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <monnier@HIDDEN>)
	id 1L7zFm-0001Wy-Ct
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 16:27:26 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <monnier@HIDDEN>)
	id 1L7zGB-0001fP-7s
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 16:27:53 -0500
Received: from ironport2-out.pppoe.ca ([206.248.154.182]:28537 helo=ironport2-out.teksavvy.com)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <monnier@HIDDEN>)
	id 1L7zGB-0001fF-1S
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 16:27:51 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av0EAHWINknO+Jkl/2dsb2JhbACBbdB5gn+BIw
X-IronPort-AV: E=Sophos;i="4.33,710,1220241600"; 
   d="scan'208";a="30612935"
Received: from 206-248-153-37.dsl.teksavvy.com (HELO pastel.home) ([206.248.153.37])
  by ironport2-out.teksavvy.com with ESMTP; 03 Dec 2008 16:27:34 -0500
Received: by pastel.home (Postfix, from userid 20848)
	id 22D568BAF; Wed,  3 Dec 2008 16:27:34 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, "Juanma Barranquero" <lekktu@HIDDEN>,
        emacs-pretest-bug@HIDDEN, emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Message-ID: <jwvprk9vtjm.fsf-monnier+emacsbugreports@HIDDEN>
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	<87zljdkbne.fsf@HIDDEN>
	<f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	<87ej0pve4l.fsf@HIDDEN>
Date: Wed, 03 Dec 2008 16:27:34 -0500
In-Reply-To: <87ej0pve4l.fsf@HIDDEN> (Thierry Volpiatto's message of
	"Wed, 03 Dec 2008 09:47:54 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized.
X-CrossAssassin-Score: 2

> I am sorry but I don't understand why emacs would find a process on
> another computer. In which case ?

E.g. when the user's HOME directory is shared by NFS?


        Stefan




Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-4.6 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 10:20:25 +0000
Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB3AKHxn009761
	for <1474@HIDDEN>; Wed, 3 Dec 2008 02:20:19 -0800
Received: by an-out-0708.google.com with SMTP id c38so1373239ana.31
        for <1474@HIDDEN>; Wed, 03 Dec 2008 02:20:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=bmMooYJtxSHmrG62GFjJZLioQNXTGHSp9ccvL4gbEXU=;
        b=mmJ2xCybFuU22AX7OWlbrBQ0zLpf3QuqJCjFttg4hX+gGpmAUn0k9SVYJdEjf/yz+S
         flmagvtYh6NITEzPB4lL4TswWcOXLODz4TE7QPiQNfFI5mhAC79I0RY6DvbeZIZefpRY
         kFqszke9Mwldqg+d2MY0SGVAZTmKTzD2vlBRo=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=G1h/xyDnSh12cnAAW1cQwphMl+zYNYNyvmiB0+2C0LtDyW+doYv9zc/74CsbaE4nhs
         HIGQxWjbZYrw+O82g2MtA6nvop/m8W0aik80uaWv+BkXVzQ22GPfVgIobmk3wzSjxYOF
         JF52fz9ChE043V/bEF33YoyWkkNkgC3W9Ci2M=
Received: by 10.100.138.10 with SMTP id l10mr7523234and.25.1228299617386;
        Wed, 03 Dec 2008 02:20:17 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 02:20:17 -0800 (PST)
Message-ID: <f7ccd24b0812030220k7a326daakb24e5b73f0ccc7d5@HIDDEN>
Date: Wed, 3 Dec 2008 11:20:17 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
In-Reply-To: <8763m1d10c.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>
	 <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	 <87zljdkbne.fsf@HIDDEN>
	 <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	 <87ej0pve4l.fsf@HIDDEN>
	 <f7ccd24b0812030115s68926b2ag81050b0ef47a7945@HIDDEN>
	 <8763m1d10c.fsf@HIDDEN>

On Wed, Dec 3, 2008 at 11:08, Thierry Volpiatto
<thierry.volpiatto@HIDDEN> wrote:

> Ok i understand now.
> In this case, may be a variable can be set:
>
> * Use a remote desktop ==> use the .emacs.desktop.lock like the actual
>  code
>
> * Use a local desktop ==> in this case check if pid exist.

If you have a shared dir in your local disk, it could be used by a
remote Emacs; but you know nothing about that Emacs (well, *you*
perhaps do know, but the local Emacs does not).

> (i think local desktop is the most common case)

I agree, but it should work sensibly (and safely) in the uncommon cases too :-)

             Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-7.1 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 10:20:22 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB3AKJe8009939
	for <submit@HIDDEN>; Wed, 3 Dec 2008 02:20:20 -0800
Received: from mail.gnu.org ([199.232.76.166]:60521 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7opk-0001iR-Fe
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 05:19:52 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7oqA-0002TG-Iy
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 05:20:19 -0500
Received: from yw-out-1718.google.com ([74.125.46.155]:42807)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7oqA-0002T8-Af
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 05:20:18 -0500
Received: by yw-out-1718.google.com with SMTP id 9so3167618ywk.66
        for <emacs-pretest-bug@HIDDEN>; Wed, 03 Dec 2008 02:20:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=bmMooYJtxSHmrG62GFjJZLioQNXTGHSp9ccvL4gbEXU=;
        b=mmJ2xCybFuU22AX7OWlbrBQ0zLpf3QuqJCjFttg4hX+gGpmAUn0k9SVYJdEjf/yz+S
         flmagvtYh6NITEzPB4lL4TswWcOXLODz4TE7QPiQNfFI5mhAC79I0RY6DvbeZIZefpRY
         kFqszke9Mwldqg+d2MY0SGVAZTmKTzD2vlBRo=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=G1h/xyDnSh12cnAAW1cQwphMl+zYNYNyvmiB0+2C0LtDyW+doYv9zc/74CsbaE4nhs
         HIGQxWjbZYrw+O82g2MtA6nvop/m8W0aik80uaWv+BkXVzQ22GPfVgIobmk3wzSjxYOF
         JF52fz9ChE043V/bEF33YoyWkkNkgC3W9Ci2M=
Received: by 10.100.138.10 with SMTP id l10mr7523234and.25.1228299617386;
        Wed, 03 Dec 2008 02:20:17 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 02:20:17 -0800 (PST)
Message-ID: <f7ccd24b0812030220k7a326daakb24e5b73f0ccc7d5@HIDDEN>
Date: Wed, 3 Dec 2008 11:20:17 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
In-Reply-To: <8763m1d10c.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>
	 <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	 <87zljdkbne.fsf@HIDDEN>
	 <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	 <87ej0pve4l.fsf@HIDDEN>
	 <f7ccd24b0812030115s68926b2ag81050b0ef47a7945@HIDDEN>
	 <8763m1d10c.fsf@HIDDEN>
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
X-CrossAssassin-Score: 2

On Wed, Dec 3, 2008 at 11:08, Thierry Volpiatto
<thierry.volpiatto@HIDDEN> wrote:

> Ok i understand now.
> In this case, may be a variable can be set:
>
> * Use a remote desktop ==> use the .emacs.desktop.lock like the actual
>  code
>
> * Use a local desktop ==> in this case check if pid exist.

If you have a shared dir in your local disk, it could be used by a
remote Emacs; but you know nothing about that Emacs (well, *you*
perhaps do know, but the local Emacs does not).

> (i think local desktop is the most common case)

I agree, but it should work sensibly (and safely) in the uncommon cases too :-)

             Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.1 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 10:13:37 +0000
Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB3ADX0G007572
	for <1474@HIDDEN>; Wed, 3 Dec 2008 02:13:35 -0800
Received: by nf-out-0910.google.com with SMTP id 30so1722851nfu.31
        for <1474@HIDDEN>; Wed, 03 Dec 2008 02:13:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:references
         :date:in-reply-to:message-id:user-agent:mime-version:content-type;
        bh=DRucrDOO5DL9mrsmsc+54FdCtr8JRHFAPmLaH60VmWI=;
        b=oa5ybHYVgNULpa+WApwmTe+KCdsMbTSFZpPycVx9cKkMYdovP1bXCIKQSJAJ4kQEyF
         ec/ntc5j4wIJAl44hvFAtTOfw+GziRSt5Wt7rdrespvICpf+TQoRs3JV7wjW9+5fMpJr
         PxFelQJUwGDqo4aEf/fWjUX2c5ZQy4YQkJ8Vg=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:cc:subject:references:date:in-reply-to:message-id
         :user-agent:mime-version:content-type;
        b=tIUT2wK5RDWLQ0EA4Xq0Kx9rvbnpBWtzRueaHqueePT/GZFWS3SnDL6a3Eaa110Hsy
         wVdz69A90yuYRpdjicC8S8vNFp/eF8eLnrXkpI/bQ9vrCWO8OW5K0xrx0gT2pkp7mJNl
         gw1KmP+pVpPgmOxCwS/uunKugjRtYH7LJqD28=
Received: by 10.210.119.16 with SMTP id r16mr9923225ebc.127.1228299212903;
        Wed, 03 Dec 2008 02:13:32 -0800 (PST)
Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49])
        by mx.google.com with ESMTPS id 20sm452197eyc.58.2008.12.03.02.13.31
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Wed, 03 Dec 2008 02:13:32 -0800 (PST)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: "Juanma Barranquero" <lekktu@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	<87zljdkbne.fsf@HIDDEN>
	<f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	<87ej0pve4l.fsf@HIDDEN>
	<f7ccd24b0812030115s68926b2ag81050b0ef47a7945@HIDDEN>
Date: Wed, 03 Dec 2008 11:08:35 +0100
In-Reply-To: <f7ccd24b0812030115s68926b2ag81050b0ef47a7945@HIDDEN>
	(Juanma Barranquero's message of "Wed, 3 Dec 2008 10:15:15 +0100")
Message-ID: <8763m1d10c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

"Juanma Barranquero" <lekktu@HIDDEN> writes:

> On Wed, Dec 3, 2008 at 09:47, Thierry Volpiatto
> <thierry.volpiatto@HIDDEN> wrote:
>
>> I am sorry but I don't understand why emacs would find a process on
>> another computer.
>
> No, I'm saying that Emacs *won't* find a process in another computer.
>
>> In which case ?
>
> The user can customize desktop.el so the desktop file (and desktop
> file lock) are anywhere, even in a shared directory in a remote disk.
Ok i understand now.
In this case, may be a variable can be set:

* Use a remote desktop ==> use the .emacs.desktop.lock like the actual
  code

* Use a local desktop ==> in this case check if pid exist.

(i think local desktop is the most common case)


>> I just want emacs to check if the process that is in the lock file is
>> own by another emacs process.
>
> Yes, I understand. And I'm saying that in the presence of distributed
> filesystems, you cannot guarantee that a desktop lock file in a local
> disk is owned by a local process, or that a local Emacs is saving the
> desktop locally.
>
>> * If no emacs process with this pid is found ==> load desktop
>>
>> * If an emacs process with this pid is found ==> ask (default) if we load
>>  desktop or not
>>
>> Actually when the .emacs.desktop.lock is found, emacs lock desktop and
>> ask if we want to use the desktop file, even if the pid that is in the
>> file is no more in use by an emacs session.
>
> I share the sentiment. In fact, I do exactly that in my .emacs.
>
> But the point of the desktop locking mechanism is protecting the user;
> automatically overwriting the desktop is against that idea.
>
>   Juanma
>

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-7.0 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 10:13:38 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB3ADZoI007574
	for <submit@HIDDEN>; Wed, 3 Dec 2008 02:13:36 -0800
Received: from mx10.gnu.org ([199.232.76.166]:60274)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7ojE-0002Nl-9D
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 05:13:08 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7oje-0001pl-6J
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 05:13:34 -0500
Received: from nf-out-0910.google.com ([64.233.182.185]:22548)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7ojd-0001pd-Ni
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 05:13:34 -0500
Received: by nf-out-0910.google.com with SMTP id c7so2072963nfi.26
        for <emacs-pretest-bug@HIDDEN>; Wed, 03 Dec 2008 02:13:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:references
         :date:in-reply-to:message-id:user-agent:mime-version:content-type;
        bh=DRucrDOO5DL9mrsmsc+54FdCtr8JRHFAPmLaH60VmWI=;
        b=oa5ybHYVgNULpa+WApwmTe+KCdsMbTSFZpPycVx9cKkMYdovP1bXCIKQSJAJ4kQEyF
         ec/ntc5j4wIJAl44hvFAtTOfw+GziRSt5Wt7rdrespvICpf+TQoRs3JV7wjW9+5fMpJr
         PxFelQJUwGDqo4aEf/fWjUX2c5ZQy4YQkJ8Vg=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:cc:subject:references:date:in-reply-to:message-id
         :user-agent:mime-version:content-type;
        b=tIUT2wK5RDWLQ0EA4Xq0Kx9rvbnpBWtzRueaHqueePT/GZFWS3SnDL6a3Eaa110Hsy
         wVdz69A90yuYRpdjicC8S8vNFp/eF8eLnrXkpI/bQ9vrCWO8OW5K0xrx0gT2pkp7mJNl
         gw1KmP+pVpPgmOxCwS/uunKugjRtYH7LJqD28=
Received: by 10.210.119.16 with SMTP id r16mr9923225ebc.127.1228299212903;
        Wed, 03 Dec 2008 02:13:32 -0800 (PST)
Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49])
        by mx.google.com with ESMTPS id 20sm452197eyc.58.2008.12.03.02.13.31
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Wed, 03 Dec 2008 02:13:32 -0800 (PST)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: "Juanma Barranquero" <lekktu@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	<87zljdkbne.fsf@HIDDEN>
	<f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	<87ej0pve4l.fsf@HIDDEN>
	<f7ccd24b0812030115s68926b2ag81050b0ef47a7945@HIDDEN>
Date: Wed, 03 Dec 2008 11:08:35 +0100
In-Reply-To: <f7ccd24b0812030115s68926b2ag81050b0ef47a7945@HIDDEN>
	(Juanma Barranquero's message of "Wed, 3 Dec 2008 10:15:15 +0100")
Message-ID: <8763m1d10c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
X-CrossAssassin-Score: 2

"Juanma Barranquero" <lekktu@HIDDEN> writes:

> On Wed, Dec 3, 2008 at 09:47, Thierry Volpiatto
> <thierry.volpiatto@HIDDEN> wrote:
>
>> I am sorry but I don't understand why emacs would find a process on
>> another computer.
>
> No, I'm saying that Emacs *won't* find a process in another computer.
>
>> In which case ?
>
> The user can customize desktop.el so the desktop file (and desktop
> file lock) are anywhere, even in a shared directory in a remote disk.
Ok i understand now.
In this case, may be a variable can be set:

* Use a remote desktop ==> use the .emacs.desktop.lock like the actual
  code

* Use a local desktop ==> in this case check if pid exist.

(i think local desktop is the most common case)


>> I just want emacs to check if the process that is in the lock file is
>> own by another emacs process.
>
> Yes, I understand. And I'm saying that in the presence of distributed
> filesystems, you cannot guarantee that a desktop lock file in a local
> disk is owned by a local process, or that a local Emacs is saving the
> desktop locally.
>
>> * If no emacs process with this pid is found ==> load desktop
>>
>> * If an emacs process with this pid is found ==> ask (default) if we load
>>  desktop or not
>>
>> Actually when the .emacs.desktop.lock is found, emacs lock desktop and
>> ask if we want to use the desktop file, even if the pid that is in the
>> file is no more in use by an emacs session.
>
> I share the sentiment. In fact, I do exactly that in my .emacs.
>
> But the point of the desktop locking mechanism is protecting the user;
> automatically overwriting the desktop is against that idea.
>
>   Juanma
>

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 09:16:46 +0000
Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB39GhIf025719
	for <1474@HIDDEN>; Wed, 3 Dec 2008 01:16:45 -0800
Received: by yw-out-2324.google.com with SMTP id 3so1434657ywj.31
        for <1474@HIDDEN>; Wed, 03 Dec 2008 01:16:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=J6VPHOoGS+QegDSsXKHUQzwa/iIMGN1XQr3QwkzaMjo=;
        b=aXhbirNSewTi8t2Y4SfnwLhTFqK3T5qkYZnh2SqiA7snCN5s5XxvBvGH+x1UDkEQW9
         13FknIW1zgDPZz3acG+Izik4tO5osPa3h2eGSiXkBPBeNQ1WXSfUPdD1kYxakJ3DUTil
         ctruQVwYD5umDzcQw1auvF9LRdTS/0zdf5/Ig=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=V14VYRDQG0Ids774Q8/bgYyPfrIY0R/pT16HH8SAJ4GNiWSvU2El9WWWYI7LhfQ0Lq
         QxWoQ7sN2CG+8B8ZF4XGzkAo12UUjvchXOE762t5B7grl74sx1DG3CQbJIN5ld8iVWLY
         ajxNo+8YphFY+XBD6sijLuhGkz5od9sTVKqPo=
Received: by 10.100.137.12 with SMTP id k12mr7490508and.55.1228295803116;
        Wed, 03 Dec 2008 01:16:43 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 01:16:43 -0800 (PST)
Message-ID: <f7ccd24b0812030116r3facbbbau9b098fcb9e47c81d@HIDDEN>
Date: Wed, 3 Dec 2008 10:16:43 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Ulrich Mueller" <ulm@HIDDEN>
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>,
        1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
In-Reply-To: <18742.19976.920879.266804@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>
	 <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	 <87zljdkbne.fsf@HIDDEN>
	 <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	 <18742.19976.920879.266804@HIDDEN>

On Wed, Dec 3, 2008 at 10:14, Ulrich Mueller <ulm@HIDDEN> wrote:

> So in addition to the process id, the lock file should also contain
> the host name, so that the most common usage case can be handled.

That's an idea worth pursuing.

> And instead of a lock file with new syntax, couldn't desktop.el use a
> symlink, identical to what is done for file locking? (Or even use
> functions "lock-buffer" etc.?)

Only if you want to remove functionality for users of Emacs on Windows.

  Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-7.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 09:16:48 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB39Gj8F025722
	for <submit@HIDDEN>; Wed, 3 Dec 2008 01:16:46 -0800
Received: from mail.gnu.org ([199.232.76.166]:58452 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7nqE-0004Qt-Iz
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 04:16:18 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7nqe-0004os-R9
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 04:16:45 -0500
Received: from yx-out-1718.google.com ([74.125.44.158]:32011)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7nqe-0004om-K0
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 04:16:44 -0500
Received: by yx-out-1718.google.com with SMTP id 34so3143583yxf.66
        for <emacs-pretest-bug@HIDDEN>; Wed, 03 Dec 2008 01:16:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=J6VPHOoGS+QegDSsXKHUQzwa/iIMGN1XQr3QwkzaMjo=;
        b=aXhbirNSewTi8t2Y4SfnwLhTFqK3T5qkYZnh2SqiA7snCN5s5XxvBvGH+x1UDkEQW9
         13FknIW1zgDPZz3acG+Izik4tO5osPa3h2eGSiXkBPBeNQ1WXSfUPdD1kYxakJ3DUTil
         ctruQVwYD5umDzcQw1auvF9LRdTS/0zdf5/Ig=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=V14VYRDQG0Ids774Q8/bgYyPfrIY0R/pT16HH8SAJ4GNiWSvU2El9WWWYI7LhfQ0Lq
         QxWoQ7sN2CG+8B8ZF4XGzkAo12UUjvchXOE762t5B7grl74sx1DG3CQbJIN5ld8iVWLY
         ajxNo+8YphFY+XBD6sijLuhGkz5od9sTVKqPo=
Received: by 10.100.137.12 with SMTP id k12mr7490508and.55.1228295803116;
        Wed, 03 Dec 2008 01:16:43 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 01:16:43 -0800 (PST)
Message-ID: <f7ccd24b0812030116r3facbbbau9b098fcb9e47c81d@HIDDEN>
Date: Wed, 3 Dec 2008 10:16:43 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Ulrich Mueller" <ulm@HIDDEN>
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>,
        1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
In-Reply-To: <18742.19976.920879.266804@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>
	 <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	 <87zljdkbne.fsf@HIDDEN>
	 <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	 <18742.19976.920879.266804@HIDDEN>
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
X-CrossAssassin-Score: 2

On Wed, Dec 3, 2008 at 10:14, Ulrich Mueller <ulm@HIDDEN> wrote:

> So in addition to the process id, the lock file should also contain
> the host name, so that the most common usage case can be handled.

That's an idea worth pursuing.

> And instead of a lock file with new syntax, couldn't desktop.el use a
> symlink, identical to what is done for file locking? (Or even use
> functions "lock-buffer" etc.?)

Only if you want to remove functionality for users of Emacs on Windows.

  Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.3 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 09:15:20 +0000
Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.184])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB39FGxT025257
	for <1474@HIDDEN>; Wed, 3 Dec 2008 01:15:17 -0800
Received: by rn-out-0910.google.com with SMTP id j66so3051370rne.20
        for <1474@HIDDEN>; Wed, 03 Dec 2008 01:15:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=BC90XuZjT6uzPdx3FEsXwHtLQjkNn4xXK3XzuqxAXfE=;
        b=Ydodj6TumMZYBpvl4xdfEaUjoHNnb6ekLp5lBAZI/wyLiwfIjI/ZUVkR59anOCh7+/
         /PaiXqU4Ddlpwe+4TzacMzLAWfU0UGOxyPgRWJ3Or5m6dBoV0NHC/U0zybu6UmaDiD3l
         8rcDg+RafBEk5f2iE3JY7XamHmSBOjQ2Sz9+U=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=FI0wibqOljV2S6hIc23UIQyBevx0oyFfGju7PMako4wthT2rgANAL8t820bCt/Rqwk
         My1RJMCFMBg6Ren+1iqYAxVQEK1CKb2dLwToQpz2cSh/1H/oL7qe+pTYhe7wxmx9V4ff
         epzETSmSyB96rZ0uJIzi2MslLBvTFP88YK5Vw=
Received: by 10.100.41.9 with SMTP id o9mr7488515ano.39.1228295716031;
        Wed, 03 Dec 2008 01:15:16 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 01:15:15 -0800 (PST)
Message-ID: <f7ccd24b0812030115s68926b2ag81050b0ef47a7945@HIDDEN>
Date: Wed, 3 Dec 2008 10:15:15 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
In-Reply-To: <87ej0pve4l.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>
	 <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	 <87zljdkbne.fsf@HIDDEN>
	 <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	 <87ej0pve4l.fsf@HIDDEN>

On Wed, Dec 3, 2008 at 09:47, Thierry Volpiatto
<thierry.volpiatto@HIDDEN> wrote:

> I am sorry but I don't understand why emacs would find a process on
> another computer.

No, I'm saying that Emacs *won't* find a process in another computer.

> In which case ?

The user can customize desktop.el so the desktop file (and desktop
file lock) are anywhere, even in a shared directory in a remote disk.

> I just want emacs to check if the process that is in the lock file is
> own by another emacs process.

Yes, I understand. And I'm saying that in the presence of distributed
filesystems, you cannot guarantee that a desktop lock file in a local
disk is owned by a local process, or that a local Emacs is saving the
desktop locally.

> * If no emacs process with this pid is found ==> load desktop
>
> * If an emacs process with this pid is found ==> ask (default) if we load
>  desktop or not
>
> Actually when the .emacs.desktop.lock is found, emacs lock desktop and
> ask if we want to use the desktop file, even if the pid that is in the
> file is no more in use by an emacs session.

I share the sentiment. In fact, I do exactly that in my .emacs.

But the point of the desktop locking mechanism is protecting the user;
automatically overwriting the desktop is against that idea.

  Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-4.7 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 09:14:59 +0000
Received: from a1iwww1.kph.uni-mainz.de (a1iwww1.kph.uni-mainz.de [134.93.134.1])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB39EtCR024507
	for <1474@HIDDEN>; Wed, 3 Dec 2008 01:14:56 -0800
Received: from a1ihome1.kph.uni-mainz.de (a1ihome1.kph.uni-mainz.de [134.93.134.75])
	by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id mB39Endf010799;
	Wed, 3 Dec 2008 10:14:49 +0100
Received: from a1ihome1.kph.uni-mainz.de (localhost [127.0.0.1])
	by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.1) with ESMTP id mB39En4N020316;
	Wed, 3 Dec 2008 10:14:49 +0100
Received: (from ulm@localhost)
	by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.0/Submit) id mB39EnWH020311;
	Wed, 3 Dec 2008 10:14:49 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <18742.19976.920879.266804@HIDDEN>
Date: Wed, 3 Dec 2008 10:14:48 +0100
To: "Juanma Barranquero" <lekktu@HIDDEN>
Cc: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>,
        1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
In-Reply-To: <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	<87zljdkbne.fsf@HIDDEN>
	<f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
X-Mailer: VM 8.0.2-487 under Emacs 22.2.1 (i686-pc-linux-gnu)
From: Ulrich Mueller <ulm@HIDDEN>

>>>>> On Wed, 3 Dec 2008, Juanma Barranquero wrote:

> Please explain: if the desktop file that Emacs finds out is locked
> by a process running in another computer, what do you want the local
> Emacs to do?

So in addition to the process id, the lock file should also contain
the host name, so that the most common usage case can be handled.

And instead of a lock file with new syntax, couldn't desktop.el use a
symlink, identical to what is done for file locking? (Or even use
functions "lock-buffer" etc.?)

Ulrich




Acknowledgement sent to Ulrich Mueller <ulm@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-6.6 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 09:15:21 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB39FHx7025284
	for <submit@HIDDEN>; Wed, 3 Dec 2008 01:15:18 -0800
Received: from mail.gnu.org ([199.232.76.166]:58421 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7noo-0002kv-Nu
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 04:14:50 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7npE-0004iC-Mh
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 04:15:17 -0500
Received: from an-out-0708.google.com ([209.85.132.250]:13412)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7npE-0004i8-EK
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 04:15:16 -0500
Received: by an-out-0708.google.com with SMTP id c38so3573613ana.21
        for <emacs-pretest-bug@HIDDEN>; Wed, 03 Dec 2008 01:15:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=BC90XuZjT6uzPdx3FEsXwHtLQjkNn4xXK3XzuqxAXfE=;
        b=Ydodj6TumMZYBpvl4xdfEaUjoHNnb6ekLp5lBAZI/wyLiwfIjI/ZUVkR59anOCh7+/
         /PaiXqU4Ddlpwe+4TzacMzLAWfU0UGOxyPgRWJ3Or5m6dBoV0NHC/U0zybu6UmaDiD3l
         8rcDg+RafBEk5f2iE3JY7XamHmSBOjQ2Sz9+U=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=FI0wibqOljV2S6hIc23UIQyBevx0oyFfGju7PMako4wthT2rgANAL8t820bCt/Rqwk
         My1RJMCFMBg6Ren+1iqYAxVQEK1CKb2dLwToQpz2cSh/1H/oL7qe+pTYhe7wxmx9V4ff
         epzETSmSyB96rZ0uJIzi2MslLBvTFP88YK5Vw=
Received: by 10.100.41.9 with SMTP id o9mr7488515ano.39.1228295716031;
        Wed, 03 Dec 2008 01:15:16 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 01:15:15 -0800 (PST)
Message-ID: <f7ccd24b0812030115s68926b2ag81050b0ef47a7945@HIDDEN>
Date: Wed, 3 Dec 2008 10:15:15 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
In-Reply-To: <87ej0pve4l.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>
	 <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	 <87zljdkbne.fsf@HIDDEN>
	 <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	 <87ej0pve4l.fsf@HIDDEN>
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
X-CrossAssassin-Score: 2

On Wed, Dec 3, 2008 at 09:47, Thierry Volpiatto
<thierry.volpiatto@HIDDEN> wrote:

> I am sorry but I don't understand why emacs would find a process on
> another computer.

No, I'm saying that Emacs *won't* find a process in another computer.

> In which case ?

The user can customize desktop.el so the desktop file (and desktop
file lock) are anywhere, even in a shared directory in a remote disk.

> I just want emacs to check if the process that is in the lock file is
> own by another emacs process.

Yes, I understand. And I'm saying that in the presence of distributed
filesystems, you cannot guarantee that a desktop lock file in a local
disk is owned by a local process, or that a local Emacs is saving the
desktop locally.

> * If no emacs process with this pid is found ==> load desktop
>
> * If an emacs process with this pid is found ==> ask (default) if we load
>  desktop or not
>
> Actually when the .emacs.desktop.lock is found, emacs lock desktop and
> ask if we want to use the desktop file, even if the pid that is in the
> file is no more in use by an emacs session.

I share the sentiment. In fact, I do exactly that in my .emacs.

But the point of the desktop locking mechanism is protecting the user;
automatically overwriting the desktop is against that idea.

  Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 09:15:10 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB39F6pM024755
	for <submit@HIDDEN>; Wed, 3 Dec 2008 01:15:08 -0800
Received: from mail.gnu.org ([199.232.76.166]:58419 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <ulm@HIDDEN>)
	id 1L7nod-0002Vu-Jq
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 04:14:39 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <ulm@HIDDEN>)
	id 1L7np3-0004hQ-Dc
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 04:15:05 -0500
Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:41553)
	by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60)
	(envelope-from <ulm@HIDDEN>)
	id 1L7np2-0004hE-Vs
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 04:15:05 -0500
Received: from a1ihome1.kph.uni-mainz.de (a1ihome1.kph.uni-mainz.de [134.93.134.75])
	by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id mB39Endf010799;
	Wed, 3 Dec 2008 10:14:49 +0100
Received: from a1ihome1.kph.uni-mainz.de (localhost [127.0.0.1])
	by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.1) with ESMTP id mB39En4N020316;
	Wed, 3 Dec 2008 10:14:49 +0100
Received: (from ulm@localhost)
	by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.0/Submit) id mB39EnWH020311;
	Wed, 3 Dec 2008 10:14:49 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <18742.19976.920879.266804@HIDDEN>
Date: Wed, 3 Dec 2008 10:14:48 +0100
To: "Juanma Barranquero" <lekktu@HIDDEN>
Cc: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>,
        1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
In-Reply-To: <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	<87zljdkbne.fsf@HIDDEN>
	<f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
X-Mailer: VM 8.0.2-487 under Emacs 22.2.1 (i686-pc-linux-gnu)
From: Ulrich Mueller <ulm@HIDDEN>
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1)
X-CrossAssassin-Score: 2

>>>>> On Wed, 3 Dec 2008, Juanma Barranquero wrote:

> Please explain: if the desktop file that Emacs finds out is locked
> by a process running in another computer, what do you want the local
> Emacs to do?

So in addition to the process id, the lock file should also contain
the host name, so that the most common usage case can be handled.

And instead of a lock file with new syntax, couldn't desktop.el use a
symlink, identical to what is done for file locking? (Or even use
functions "lock-buffer" etc.?)

Ulrich




Acknowledgement sent to Ulrich Mueller <ulm@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.3 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 08:52:55 +0000
Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.179])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB38qpZE018786
	for <1474@HIDDEN>; Wed, 3 Dec 2008 00:52:52 -0800
Received: by ik-out-1112.google.com with SMTP id c28so3303463ika.1
        for <1474@HIDDEN>; Wed, 03 Dec 2008 00:52:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:references
         :date:in-reply-to:message-id:user-agent:mime-version:content-type;
        bh=X1fr4SzcXW47yqYXI5gkE+QYUYxNh2EBQJNheSiQQ1I=;
        b=Irwr7zrUIWZtiIRcKI1j3bVDTLUpsS98/JXxyas8h78yMzhhYFB3GJPO+lhwWWgk8s
         L9YI3SzSMoUvlJmTQ2RnBE/fyJ4Pr4BwC2CFpCHR6UunoJk0T8VzXCpJXu22qDcYPZcJ
         2g2vdjtTdkeMaS5QrL5VDePTbsN85yLuXUOAY=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:cc:subject:references:date:in-reply-to:message-id
         :user-agent:mime-version:content-type;
        b=SKYec0XfCSAoDp1A6VWNfpuO0hZtamI0hbmY6FYMeqUv8m8zCFQTLvfiBNZQUcrw+l
         9n4eRAxVmpilDFp+AJ79R440x7AioPwYGdh0R2g+Sy0zCiBrrRo+CjRlPD5rUwgtP7So
         J97ejwDps1mnt2HE6htSr2dgN7KHHHC+MIa4U=
Received: by 10.103.220.18 with SMTP id x18mr5794057muq.135.1228294370441;
        Wed, 03 Dec 2008 00:52:50 -0800 (PST)
Received: from tux.homenetwork ([79.88.78.49])
        by mx.google.com with ESMTPS id e10sm9009628muf.22.2008.12.03.00.52.49
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Wed, 03 Dec 2008 00:52:50 -0800 (PST)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: "Juanma Barranquero" <lekktu@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	<87zljdkbne.fsf@HIDDEN>
	<f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
Date: Wed, 03 Dec 2008 09:47:54 +0100
In-Reply-To: <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	(Juanma Barranquero's message of "Wed, 3 Dec 2008 09:25:01 +0100")
Message-ID: <87ej0pve4l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-CrossAssassin-Score: 2

"Juanma Barranquero" <lekktu@HIDDEN> writes:

> On Wed, Dec 3, 2008 at 07:36, Thierry Volpiatto
> <thierry.volpiatto@HIDDEN> wrote:
>
>> If emacs process number <owner> doesn't exist, the "else" block is used.
>
> Please explain: if the desktop file that Emacs finds out is locked by
> a process running in another computer, what do you want the local
> Emacs to do?

I am sorry but I don't understand why emacs would find a process on
another computer. In which case ?

I just want emacs to check if the process that is in the lock file is
own by another emacs process.

* If no emacs process with this pid is found ==> load desktop

* If an emacs process with this pid is found ==> ask (default) if we load
  desktop or not

Actually when the .emacs.desktop.lock is found, emacs lock desktop and
ask if we want to use the desktop file, even if the pid that is in the
file is no more in use by an emacs session.

Emacs should do that only if user start a second emacs session, in this
case the lock file will do his work and tell user this desktop is
already in use.

To reproduce, start emacs with (desktop-save 1) in your .emacs
open some buffers, then kill emacs with a killall or similar.
Now no emacs process exist right?
start emacs again, it will tell you an emacs process is using desktop:
thats wrong.

I hope it's clear,
thanks.

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-7.1 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 08:52:56 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB38qrfU018788
	for <submit@HIDDEN>; Wed, 3 Dec 2008 00:52:54 -0800
Received: from mx10.gnu.org ([199.232.76.166]:57766)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7nT7-0002IR-Uh
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 03:52:26 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7nTX-0002kN-Rd
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 03:52:52 -0500
Received: from nf-out-0910.google.com ([64.233.182.189]:20437)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7nTX-0002kH-FC
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 03:52:51 -0500
Received: by nf-out-0910.google.com with SMTP id c7so2056062nfi.26
        for <emacs-pretest-bug@HIDDEN>; Wed, 03 Dec 2008 00:52:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:references
         :date:in-reply-to:message-id:user-agent:mime-version:content-type;
        bh=X1fr4SzcXW47yqYXI5gkE+QYUYxNh2EBQJNheSiQQ1I=;
        b=Irwr7zrUIWZtiIRcKI1j3bVDTLUpsS98/JXxyas8h78yMzhhYFB3GJPO+lhwWWgk8s
         L9YI3SzSMoUvlJmTQ2RnBE/fyJ4Pr4BwC2CFpCHR6UunoJk0T8VzXCpJXu22qDcYPZcJ
         2g2vdjtTdkeMaS5QrL5VDePTbsN85yLuXUOAY=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:cc:subject:references:date:in-reply-to:message-id
         :user-agent:mime-version:content-type;
        b=SKYec0XfCSAoDp1A6VWNfpuO0hZtamI0hbmY6FYMeqUv8m8zCFQTLvfiBNZQUcrw+l
         9n4eRAxVmpilDFp+AJ79R440x7AioPwYGdh0R2g+Sy0zCiBrrRo+CjRlPD5rUwgtP7So
         J97ejwDps1mnt2HE6htSr2dgN7KHHHC+MIa4U=
Received: by 10.103.220.18 with SMTP id x18mr5794057muq.135.1228294370441;
        Wed, 03 Dec 2008 00:52:50 -0800 (PST)
Received: from tux.homenetwork ([79.88.78.49])
        by mx.google.com with ESMTPS id e10sm9009628muf.22.2008.12.03.00.52.49
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Wed, 03 Dec 2008 00:52:50 -0800 (PST)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: "Juanma Barranquero" <lekktu@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	<87zljdkbne.fsf@HIDDEN>
	<f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
Date: Wed, 03 Dec 2008 09:47:54 +0100
In-Reply-To: <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
	(Juanma Barranquero's message of "Wed, 3 Dec 2008 09:25:01 +0100")
Message-ID: <87ej0pve4l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)

"Juanma Barranquero" <lekktu@HIDDEN> writes:

> On Wed, Dec 3, 2008 at 07:36, Thierry Volpiatto
> <thierry.volpiatto@HIDDEN> wrote:
>
>> If emacs process number <owner> doesn't exist, the "else" block is used.
>
> Please explain: if the desktop file that Emacs finds out is locked by
> a process running in another computer, what do you want the local
> Emacs to do?

I am sorry but I don't understand why emacs would find a process on
another computer. In which case ?

I just want emacs to check if the process that is in the lock file is
own by another emacs process.

* If no emacs process with this pid is found ==> load desktop

* If an emacs process with this pid is found ==> ask (default) if we load
  desktop or not

Actually when the .emacs.desktop.lock is found, emacs lock desktop and
ask if we want to use the desktop file, even if the pid that is in the
file is no more in use by an emacs session.

Emacs should do that only if user start a second emacs session, in this
case the lock file will do his work and tell user this desktop is
already in use.

To reproduce, start emacs with (desktop-save 1) in your .emacs
open some buffers, then kill emacs with a killall or similar.
Now no emacs process exist right?
start emacs again, it will tell you an emacs process is using desktop:
thats wrong.

I hope it's clear,
thanks.

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-4.6 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 08:25:05 +0000
Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB38P29W011327
	for <1474@HIDDEN>; Wed, 3 Dec 2008 00:25:03 -0800
Received: by an-out-0708.google.com with SMTP id c38so1360322ana.31
        for <1474@HIDDEN>; Wed, 03 Dec 2008 00:25:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=15540KqlGRy6nIgWlM2I4JSgUN6kIRJD7WrMOp3Tzyw=;
        b=HU76qr4y7LrAqR1XaOdkrwYVsvG8m6DqFzvhl8LIJ80A0hNqMb8xEglWv4YMvCmv3y
         ifO9UaktLHfchGSxU71vE8Sf7KIvbnfpk9fSv0KiiTCEyiZABSmcb5rce3NIM9EHwaV7
         6WEk6j4fi3XQi0vvgQ3qTgUbAPSlClnblLomY=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=d7Y3F7HQ3ZJ0WxX8U5I4i/QJ8s1/qYJagKW3bqvH1B/3uNRpaGse+xJu2wD/698B+p
         Rf98yZBpkS5LGuakRZDFhbzLutm37lSzLvRGUcODDj6S5lTlSluDxatAsC4ZYcVt+uEO
         8awrYiuqqgWl0Ce5UZXSPJPmisfDpFbp3/6d8=
Received: by 10.100.136.18 with SMTP id j18mr7461525and.103.1228292701720;
        Wed, 03 Dec 2008 00:25:01 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 00:25:01 -0800 (PST)
Message-ID: <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
Date: Wed, 3 Dec 2008 09:25:01 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
In-Reply-To: <87zljdkbne.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>
	 <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	 <87zljdkbne.fsf@HIDDEN>

On Wed, Dec 3, 2008 at 07:36, Thierry Volpiatto
<thierry.volpiatto@HIDDEN> wrote:

> If emacs process number <owner> doesn't exist, the "else" block is used.

Please explain: if the desktop file that Emacs finds out is locked by
a process running in another computer, what do you want the local
Emacs to do?

  Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-7.0 required=4.0 tests=AWL,BAYES_00,GMAIL,
	HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 08:25:11 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB38P86Q011689
	for <submit@HIDDEN>; Wed, 3 Dec 2008 00:25:09 -0800
Received: from mx10.gnu.org ([199.232.76.166]:56705)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7n2H-0002il-4J
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 03:24:41 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7n2e-0008CW-WF
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 03:25:07 -0500
Received: from yx-out-1718.google.com ([74.125.44.152]:28143)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7n2e-0008CI-NY
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 03:25:04 -0500
Received: by yx-out-1718.google.com with SMTP id 34so3104864yxf.66
        for <emacs-pretest-bug@HIDDEN>; Wed, 03 Dec 2008 00:25:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=15540KqlGRy6nIgWlM2I4JSgUN6kIRJD7WrMOp3Tzyw=;
        b=HU76qr4y7LrAqR1XaOdkrwYVsvG8m6DqFzvhl8LIJ80A0hNqMb8xEglWv4YMvCmv3y
         ifO9UaktLHfchGSxU71vE8Sf7KIvbnfpk9fSv0KiiTCEyiZABSmcb5rce3NIM9EHwaV7
         6WEk6j4fi3XQi0vvgQ3qTgUbAPSlClnblLomY=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=d7Y3F7HQ3ZJ0WxX8U5I4i/QJ8s1/qYJagKW3bqvH1B/3uNRpaGse+xJu2wD/698B+p
         Rf98yZBpkS5LGuakRZDFhbzLutm37lSzLvRGUcODDj6S5lTlSluDxatAsC4ZYcVt+uEO
         8awrYiuqqgWl0Ce5UZXSPJPmisfDpFbp3/6d8=
Received: by 10.100.136.18 with SMTP id j18mr7461525and.103.1228292701720;
        Wed, 03 Dec 2008 00:25:01 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Wed, 3 Dec 2008 00:25:01 -0800 (PST)
Message-ID: <f7ccd24b0812030025m96e51e0o93edb245139d7b11@HIDDEN>
Date: Wed, 3 Dec 2008 09:25:01 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
In-Reply-To: <87zljdkbne.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>
	 <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	 <87zljdkbne.fsf@HIDDEN>
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
X-CrossAssassin-Score: 2

On Wed, Dec 3, 2008 at 07:36, Thierry Volpiatto
<thierry.volpiatto@HIDDEN> wrote:

> If emacs process number <owner> doesn't exist, the "else" block is used.

Please explain: if the desktop file that Emacs finds out is locked by
a process running in another computer, what do you want the local
Emacs to do?

  Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.2 required=4.0 tests=AWL,BAYES_00,FOURLA,GMAIL,
	HAS_BUG_NUMBER,PUSSY autolearn=no version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 06:41:54 +0000
Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB36foNd017939
	for <1474@HIDDEN>; Tue, 2 Dec 2008 22:41:51 -0800
Received: by ey-out-2122.google.com with SMTP id 4so1632525eyf.13
        for <1474@HIDDEN>; Tue, 02 Dec 2008 22:41:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:references
         :date:in-reply-to:message-id:user-agent:mime-version:content-type;
        bh=4aGOXuSwoEphyuFICZP1TZZkez1YpARknNUs2wmEgR8=;
        b=i+38qhUpu+Td0kvMCfqCI7EVdeIz8yd+T/wAnhcBECit1v6m3LHKcO4OoeSecoyEs5
         iHVViYmtlP2Epxs9L6BUPJXBmaE92F/f1oGS9f1doSFI6pye4KdSJhfGIM2QY/vnMHA7
         H+fjsydYimQ1kkJDHT2bZj09jTEJF+z2ALiV8=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:cc:subject:references:date:in-reply-to:message-id
         :user-agent:mime-version:content-type;
        b=FoPWSFCxRFjyowh3VPbtueJsC8kQGIo5RjWh5of/tZou2oMF9yBUKEpT/0/AjkyWzn
         UIFDwKCtkFn2pveP+8VwclNyfQAH8RmjMaOrKAep8yQV9kdO4oKy5RnO+tZVskVBum2J
         37Bq1wMF80mrUd6yrxv3dvByxElYvlavWwMLQ=
Received: by 10.103.218.19 with SMTP id v19mr5755998muq.46.1228286509493;
        Tue, 02 Dec 2008 22:41:49 -0800 (PST)
Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49])
        by mx.google.com with ESMTPS id 23sm11813955mun.58.2008.12.02.22.41.48
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Tue, 02 Dec 2008 22:41:49 -0800 (PST)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: "Juanma Barranquero" <lekktu@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
Date: Wed, 03 Dec 2008 07:36:53 +0100
In-Reply-To: <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	(Juanma Barranquero's message of "Tue, 2 Dec 2008 23:39:52 +0100")
Message-ID: <87zljdkbne.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

"Juanma Barranquero" <lekktu@HIDDEN> writes:

> On Tue, Dec 2, 2008 at 22:43, Thierry Volpiatto
> <thierry.volpiatto@HIDDEN> wrote:
>
>> | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner)))
>
> In Emacs 23.X I think you could use `system-process-attributes'
> instead of running an external ps process.

Yes, here is the code that can be used in desktop.el:

,----
| (and (system-process-attributes owner)
|      (string-match "emacs"
|                    (cdr (assq 'comm
|                               (system-process-attributes owner)))))
`----

> But one way or the other, what if the desktop lock file resides in a
> non-local drive?

If emacs process number <owner> doesn't exist, the "else" block is used.
  
-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,FOURLA,GMAIL,
	HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 06:41:56 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB36frc0017942
	for <submit@HIDDEN>; Tue, 2 Dec 2008 22:41:54 -0800
Received: from mx10.gnu.org ([199.232.76.166]:54863)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7lQM-0003bS-0m
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 01:41:26 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7lQl-0001Sz-TS
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 01:41:52 -0500
Received: from fk-out-0910.google.com ([209.85.128.190]:13289)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7lQl-0001Sl-F4
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 01:41:51 -0500
Received: by fk-out-0910.google.com with SMTP id 18so2893185fkq.10
        for <emacs-pretest-bug@HIDDEN>; Tue, 02 Dec 2008 22:41:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:references
         :date:in-reply-to:message-id:user-agent:mime-version:content-type;
        bh=4aGOXuSwoEphyuFICZP1TZZkez1YpARknNUs2wmEgR8=;
        b=i+38qhUpu+Td0kvMCfqCI7EVdeIz8yd+T/wAnhcBECit1v6m3LHKcO4OoeSecoyEs5
         iHVViYmtlP2Epxs9L6BUPJXBmaE92F/f1oGS9f1doSFI6pye4KdSJhfGIM2QY/vnMHA7
         H+fjsydYimQ1kkJDHT2bZj09jTEJF+z2ALiV8=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:cc:subject:references:date:in-reply-to:message-id
         :user-agent:mime-version:content-type;
        b=FoPWSFCxRFjyowh3VPbtueJsC8kQGIo5RjWh5of/tZou2oMF9yBUKEpT/0/AjkyWzn
         UIFDwKCtkFn2pveP+8VwclNyfQAH8RmjMaOrKAep8yQV9kdO4oKy5RnO+tZVskVBum2J
         37Bq1wMF80mrUd6yrxv3dvByxElYvlavWwMLQ=
Received: by 10.103.218.19 with SMTP id v19mr5755998muq.46.1228286509493;
        Tue, 02 Dec 2008 22:41:49 -0800 (PST)
Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49])
        by mx.google.com with ESMTPS id 23sm11813955mun.58.2008.12.02.22.41.48
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Tue, 02 Dec 2008 22:41:49 -0800 (PST)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: "Juanma Barranquero" <lekktu@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
References: <87bpvufe28.fsf@HIDDEN>
	<f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
Date: Wed, 03 Dec 2008 07:36:53 +0100
In-Reply-To: <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
	(Juanma Barranquero's message of "Tue, 2 Dec 2008 23:39:52 +0100")
Message-ID: <87zljdkbne.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
X-CrossAssassin-Score: 2

"Juanma Barranquero" <lekktu@HIDDEN> writes:

> On Tue, Dec 2, 2008 at 22:43, Thierry Volpiatto
> <thierry.volpiatto@HIDDEN> wrote:
>
>> | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner)))
>
> In Emacs 23.X I think you could use `system-process-attributes'
> instead of running an external ps process.

Yes, here is the code that can be used in desktop.el:

,----
| (and (system-process-attributes owner)
|      (string-match "emacs"
|                    (cdr (assq 'comm
|                               (system-process-attributes owner)))))
`----

> But one way or the other, what if the desktop lock file resides in a
> non-local drive?

If emacs process number <owner> doesn't exist, the "else" block is used.
  
-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.4 required=4.0 tests=AWL,BAYES_00,FOURLA,
	HAS_BUG_NUMBER,PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 3 Dec 2008 06:35:25 +0000
Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.185])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB36ZMvX016555
	for <1474@HIDDEN>; Tue, 2 Dec 2008 22:35:23 -0800
Received: by fk-out-0910.google.com with SMTP id f40so3395900fka.1
        for <1474@HIDDEN>; Tue, 02 Dec 2008 22:35:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:references
         :date:in-reply-to:message-id:user-agent:mime-version:content-type;
        bh=tDfV7DzoKNzSNs5sSkPmLZsbdA/pi3G6CHefZOFyP6A=;
        b=bZcq6nfRG95a3rFV+kMC1/QZwq5TmKHOL4C8NKQqrdrW/BG978KwOUaljUpqgLFAKx
         SYIPYMG+4+EF+bnT4pwO5UyPpNvj9LSDLajhY4aQB7GyiuZlMyAeySw9e0cyberThLbF
         0wIWdvLi9oyI/6oiTdtcWYk0cLFLRb5rqX7Ek=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:cc:subject:references:date:in-reply-to:message-id
         :user-agent:mime-version:content-type;
        b=uNV93VsGG0Mh5QPv+ocG0PTap2JMM5mT9QR9B1gdSCxVfCnoXqDv51ZAgMhzeWDsjI
         xLBRYEvor3dglQ+m3jIAI+qr4P+v5EWHcnDfoVtFJ+L0qj9LK1xf3Oe4Ky2ZwUXLuJ6N
         axjtyVdtL+8brsU93OiCotLMVH+YCB8MSr+RI=
Received: by 10.103.248.17 with SMTP id a17mr5745140mus.97.1228286121581;
        Tue, 02 Dec 2008 22:35:21 -0800 (PST)
Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49])
        by mx.google.com with ESMTPS id i7sm6468914mue.45.2008.12.02.22.35.20
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Tue, 02 Dec 2008 22:35:21 -0800 (PST)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
References: <87bpvufe28.fsf@HIDDEN>
	<jwvskp62ntj.fsf-monnier+emacsbugreports@HIDDEN>
Date: Wed, 03 Dec 2008 07:30:26 +0100
In-Reply-To: <jwvskp62ntj.fsf-monnier+emacsbugreports@HIDDEN> (Stefan
	Monnier's message of "Tue, 02 Dec 2008 17:52:11 -0500")
Message-ID: <874p1llqil.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Stefan Monnier <monnier@HIDDEN> writes:

>> (Gentoo provide an init script to start emacs --daemon as service with openrc)
>
> That sounds "brain-dead" since Emacs is not useful to the system, only
> to its users.

The init script is started in a by user process with a symlink, in the
same manner as net.eth1 is a symlink of net.lo.
So the init script is started as /etc/init.d/emacs.<USER> and the
process is started as <USER>.
That's a concept, it's interesting, and can interest other users.
-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-7.1 required=4.0 tests=AWL,BAYES_00,FOURLA,
	HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 3 Dec 2008 06:35:28 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB36ZP8T016561
	for <submit@HIDDEN>; Tue, 2 Dec 2008 22:35:26 -0800
Received: from mail.gnu.org ([199.232.76.166]:54751 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7lK6-0003VU-2N
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 01:34:58 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7lKV-00016X-TU
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 01:35:24 -0500
Received: from nf-out-0910.google.com ([64.233.182.189]:2033)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7lKV-00016Q-Ej
	for emacs-pretest-bug@HIDDEN; Wed, 03 Dec 2008 01:35:23 -0500
Received: by nf-out-0910.google.com with SMTP id c7so2036495nfi.26
        for <emacs-pretest-bug@HIDDEN>; Tue, 02 Dec 2008 22:35:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:references
         :date:in-reply-to:message-id:user-agent:mime-version:content-type;
        bh=tDfV7DzoKNzSNs5sSkPmLZsbdA/pi3G6CHefZOFyP6A=;
        b=bZcq6nfRG95a3rFV+kMC1/QZwq5TmKHOL4C8NKQqrdrW/BG978KwOUaljUpqgLFAKx
         SYIPYMG+4+EF+bnT4pwO5UyPpNvj9LSDLajhY4aQB7GyiuZlMyAeySw9e0cyberThLbF
         0wIWdvLi9oyI/6oiTdtcWYk0cLFLRb5rqX7Ek=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:cc:subject:references:date:in-reply-to:message-id
         :user-agent:mime-version:content-type;
        b=uNV93VsGG0Mh5QPv+ocG0PTap2JMM5mT9QR9B1gdSCxVfCnoXqDv51ZAgMhzeWDsjI
         xLBRYEvor3dglQ+m3jIAI+qr4P+v5EWHcnDfoVtFJ+L0qj9LK1xf3Oe4Ky2ZwUXLuJ6N
         axjtyVdtL+8brsU93OiCotLMVH+YCB8MSr+RI=
Received: by 10.103.248.17 with SMTP id a17mr5745140mus.97.1228286121581;
        Tue, 02 Dec 2008 22:35:21 -0800 (PST)
Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49])
        by mx.google.com with ESMTPS id i7sm6468914mue.45.2008.12.02.22.35.20
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Tue, 02 Dec 2008 22:35:21 -0800 (PST)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
References: <87bpvufe28.fsf@HIDDEN>
	<jwvskp62ntj.fsf-monnier+emacsbugreports@HIDDEN>
Date: Wed, 03 Dec 2008 07:30:26 +0100
In-Reply-To: <jwvskp62ntj.fsf-monnier+emacsbugreports@HIDDEN> (Stefan
	Monnier's message of "Tue, 02 Dec 2008 17:52:11 -0500")
Message-ID: <874p1llqil.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
X-CrossAssassin-Score: 2

Stefan Monnier <monnier@HIDDEN> writes:

>> (Gentoo provide an init script to start emacs --daemon as service with openrc)
>
> That sounds "brain-dead" since Emacs is not useful to the system, only
> to its users.

The init script is started in a by user process with a symlink, in the
same manner as net.eth1 is a symlink of net.lo.
So the init script is started as /etc/init.d/emacs.<USER> and the
process is started as <USER>.
That's a concept, it's interesting, and can interest other users.
-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-6.1 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 2 Dec 2008 23:07:17 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2N7ExI030336
	for <submit@HIDDEN>; Tue, 2 Dec 2008 15:07:16 -0800
Received: from mail.gnu.org ([199.232.76.166]:43153 helo=mx10.gnu.org)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <ulm@HIDDEN>)
	id 1L7eKO-0006zQ-3v
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 18:06:48 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <ulm@HIDDEN>)
	id 1L7eKm-0005im-Qp
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 18:07:13 -0500
Received: from a1iwww1.kph.uni-mainz.de ([134.93.134.1]:53227)
	by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60)
	(envelope-from <ulm@HIDDEN>)
	id 1L7eKm-0005iL-E6
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 18:07:12 -0500
Received: from a1ihome1.kph.uni-mainz.de (a1ihome1.kph.uni-mainz.de [134.93.134.75])
	by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id mB2N70Ns024098;
	Wed, 3 Dec 2008 00:07:00 +0100
Received: from a1ihome1.kph.uni-mainz.de (localhost [127.0.0.1])
	by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.1) with ESMTP id mB2N70rX001729;
	Wed, 3 Dec 2008 00:07:00 +0100
Received: (from ulm@localhost)
	by a1ihome1.kph.uni-mainz.de (8.14.0/8.14.0/Submit) id mB2N70IZ001724;
	Wed, 3 Dec 2008 00:07:00 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <18741.49043.845780.297156@HIDDEN>
Date: Wed, 3 Dec 2008 00:06:59 +0100
To: Stefan Monnier <monnier@HIDDEN>
Cc: Thierry Volpiatto <thierry.volpiatto@HIDDEN>, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
In-Reply-To: <jwvskp62ntj.fsf-monnier+emacsbugreports@HIDDEN>
References: <87bpvufe28.fsf@HIDDEN>
	<jwvskp62ntj.fsf-monnier+emacsbugreports@HIDDEN>
X-Mailer: VM 8.0.2-487 under Emacs 22.2.1 (i686-pc-linux-gnu)
From: Ulrich Mueller <ulm@HIDDEN>
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1)

>>>>> On Tue, 02 Dec 2008, Stefan Monnier wrote:

>> (Gentoo provide an init script to start emacs --daemon as service
>> with openrc)

> That sounds "brain-dead" since Emacs is not useful to the system,
> only to its users.

Of course the rc script has a multiplexed configuration, so that the
started Emacs daemons will run under the users' id. Otherwise it
wouldn't make much sense.

Ulrich




Acknowledgement sent to Ulrich Mueller <ulm@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 2 Dec 2008 22:52:16 +0000
Received: from chene.dit.umontreal.ca (chene.dit.umontreal.ca [132.204.246.20])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2MqDD4025907
	for <1474@HIDDEN>; Tue, 2 Dec 2008 14:52:14 -0800
Received: from alfajor.home (vpn-132-204-232-176.acd.umontreal.ca [132.204.232.176])
	by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mB2MqBxK025943;
	Tue, 2 Dec 2008 17:52:11 -0500
Received: by alfajor.home (Postfix, from userid 20848)
	id AC0BC1C1D9; Tue,  2 Dec 2008 17:52:11 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Message-ID: <jwvskp62ntj.fsf-monnier+emacsbugreports@HIDDEN>
References: <87bpvufe28.fsf@HIDDEN>
Date: Tue, 02 Dec 2008 17:52:11 -0500
In-Reply-To: <87bpvufe28.fsf@HIDDEN> (Thierry Volpiatto's message of
	"Tue, 02 Dec 2008 22:43:43 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV3160=0

> (Gentoo provide an init script to start emacs --daemon as service with openrc)

That sounds "brain-dead" since Emacs is not useful to the system, only
to its users.


        Stefan




Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-7.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	PUSSY,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 2 Dec 2008 22:52:34 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2MqVSP025920
	for <submit@HIDDEN>; Tue, 2 Dec 2008 14:52:32 -0800
Received: from mx10.gnu.org ([199.232.76.166]:42775)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <monnier@HIDDEN>)
	id 1L7e68-0006Se-LH
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 17:52:04 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <monnier@HIDDEN>)
	id 1L7e6X-0004LQ-S0
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 17:52:30 -0500
Received: from chene.dit.umontreal.ca ([132.204.246.20]:39364)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <monnier@HIDDEN>)
	id 1L7e6X-0004LE-GS
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 17:52:29 -0500
Received: from alfajor.home (vpn-132-204-232-176.acd.umontreal.ca [132.204.232.176])
	by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mB2MqBxK025943;
	Tue, 2 Dec 2008 17:52:11 -0500
Received: by alfajor.home (Postfix, from userid 20848)
	id AC0BC1C1D9; Tue,  2 Dec 2008 17:52:11 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
Cc: 1474 <at> debbugs.gnu.org, emacs-pretest-bug@HIDDEN,
        emacs@HIDDEN
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Message-ID: <jwvskp62ntj.fsf-monnier+emacsbugreports@HIDDEN>
References: <87bpvufe28.fsf@HIDDEN>
Date: Tue, 02 Dec 2008 17:52:11 -0500
In-Reply-To: <87bpvufe28.fsf@HIDDEN> (Thierry Volpiatto's message of
	"Tue, 02 Dec 2008 22:43:43 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV3160=0
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3)
X-CrossAssassin-Score: 2

> (Gentoo provide an init script to start emacs --daemon as service with openrc)

That sounds "brain-dead" since Emacs is not useful to the system, only
to its users.


        Stefan




Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.0 required=4.0 tests=AWL,BAYES_00,FOURLA,GMAIL,
	HAS_BUG_NUMBER,PUSSY autolearn=no version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1474) by emacsbugs.donarmstrong.com; 2 Dec 2008 22:39:56 +0000
Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2Mdq2n022282
	for <1474@HIDDEN>; Tue, 2 Dec 2008 14:39:54 -0800
Received: by yx-out-2324.google.com with SMTP id 8so1353912yxg.31
        for <1474@HIDDEN>; Tue, 02 Dec 2008 14:39:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=1mnNQmZ7JmOjmJM2TmCHL6+0dP+zSsPmvq9qzcKpN0k=;
        b=V92QTkVPK3jBrqaqU2f8JZtgGbhN/B+aBiKGX6va7aH5ju8nJWzzrAEbfgoi7tMlZF
         uvRegPviK67I88AwS94Km6mrXK4012VfRN0sd9/LCcSF0x6A3s/z+jSVjKtwar3/t/rv
         fJ1iyhmKiaMeLIz6THMlk45PhTSIptpsqbD0s=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=MUsYhwh2whYwyA7CGrP6zAF9DJCdy34zPB2VBy0TYjKjC1GhmXSG+F7HYUiHqt6JwX
         BvYZ80sJ9bBTq+E6bcS3u6e0XpIR4TN20GotrJ8nyFO/pH0qJ3YfRMVDQBDJP68OThVD
         9CmQozdSdqZweL7ok3Cd7vW1g0CRpIUuQui00=
Received: by 10.101.68.19 with SMTP id v19mr7216992ank.62.1228257592527;
        Tue, 02 Dec 2008 14:39:52 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Tue, 2 Dec 2008 14:39:52 -0800 (PST)
Message-ID: <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
Date: Tue, 2 Dec 2008 23:39:52 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>,
        1474 <at> debbugs.gnu.org
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: emacs-pretest-bug@HIDDEN, emacs@HIDDEN
In-Reply-To: <87bpvufe28.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>

On Tue, Dec 2, 2008 at 22:43, Thierry Volpiatto
<thierry.volpiatto@HIDDEN> wrote:

> | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner)))

In Emacs 23.X I think you could use `system-process-attributes'
instead of running an external ps process.

But one way or the other, what if the desktop lock file resides in a
non-local drive?

  Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-6.5 required=4.0 tests=AWL,BAYES_00,FOURLA,GMAIL,
	HAS_BUG_NUMBER,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 2 Dec 2008 22:39:58 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2Mdti5022285
	for <submit@HIDDEN>; Tue, 2 Dec 2008 14:39:56 -0800
Received: from mx10.gnu.org ([199.232.76.166]:42454)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7dtw-00066p-Hm
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 17:39:28 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7duL-0003Hs-UW
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 17:39:54 -0500
Received: from an-out-0708.google.com ([209.85.132.245]:24213)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <lekktu@HIDDEN>)
	id 1L7duL-0003Hm-NA
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 17:39:53 -0500
Received: by an-out-0708.google.com with SMTP id c38so3430290ana.21
        for <emacs-pretest-bug@HIDDEN>; Tue, 02 Dec 2008 14:39:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:message-id:date:from:to
         :subject:cc:in-reply-to:mime-version:content-type
         :content-transfer-encoding:content-disposition:references;
        bh=1mnNQmZ7JmOjmJM2TmCHL6+0dP+zSsPmvq9qzcKpN0k=;
        b=V92QTkVPK3jBrqaqU2f8JZtgGbhN/B+aBiKGX6va7aH5ju8nJWzzrAEbfgoi7tMlZF
         uvRegPviK67I88AwS94Km6mrXK4012VfRN0sd9/LCcSF0x6A3s/z+jSVjKtwar3/t/rv
         fJ1iyhmKiaMeLIz6THMlk45PhTSIptpsqbD0s=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
         :content-type:content-transfer-encoding:content-disposition
         :references;
        b=MUsYhwh2whYwyA7CGrP6zAF9DJCdy34zPB2VBy0TYjKjC1GhmXSG+F7HYUiHqt6JwX
         BvYZ80sJ9bBTq+E6bcS3u6e0XpIR4TN20GotrJ8nyFO/pH0qJ3YfRMVDQBDJP68OThVD
         9CmQozdSdqZweL7ok3Cd7vW1g0CRpIUuQui00=
Received: by 10.101.68.19 with SMTP id v19mr7216992ank.62.1228257592527;
        Tue, 02 Dec 2008 14:39:52 -0800 (PST)
Received: by 10.100.13.13 with HTTP; Tue, 2 Dec 2008 14:39:52 -0800 (PST)
Message-ID: <f7ccd24b0812021439n1e153c0cy312c63522c47c65@HIDDEN>
Date: Tue, 2 Dec 2008 23:39:52 +0100
From: "Juanma Barranquero" <lekktu@HIDDEN>
To: "Thierry Volpiatto" <thierry.volpiatto@HIDDEN>,
        1474 <at> debbugs.gnu.org
Subject: Re: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Cc: emacs-pretest-bug@HIDDEN, emacs@HIDDEN
In-Reply-To: <87bpvufe28.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <87bpvufe28.fsf@HIDDEN>
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
X-CrossAssassin-Score: 2

On Tue, Dec 2, 2008 at 22:43, Thierry Volpiatto
<thierry.volpiatto@HIDDEN> wrote:

> | (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner)))

In Emacs 23.X I think you could use `system-process-attributes'
instead of running an external ps process.

But one way or the other, what if the desktop lock file resides in a
non-local drive?

  Juanma




Acknowledgement sent to "Juanma Barranquero" <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Status: No, score=-5.9 required=4.0 tests=BAYES_00,FOURLA,
	MURPHY_DRUGS_REL8,PUSSY,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 2 Dec 2008 21:48:50 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB2LmkbX009400
	for <submit@HIDDEN>; Tue, 2 Dec 2008 13:48:47 -0800
Received: from mx10.gnu.org ([199.232.76.166]:40954)
	by fencepost.gnu.org with esmtp (Exim 4.67)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7d6R-0004Yd-5f
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 16:48:19 -0500
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7d6q-00072d-40
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 16:48:45 -0500
Received: from gv-out-0910.google.com ([216.239.58.189]:31721)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <thierry.volpiatto@HIDDEN>)
	id 1L7d6p-00072J-JC
	for emacs-pretest-bug@HIDDEN; Tue, 02 Dec 2008 16:48:43 -0500
Received: by gv-out-0910.google.com with SMTP id i36so685309gve.17
        for <emacs-pretest-bug@HIDDEN>; Tue, 02 Dec 2008 13:48:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:cc:subject:date
         :message-id:user-agent:mime-version:content-type;
        bh=w9RmEsgbh2s5uLdnInR2+cvWwXmdingQ0f1povXezY8=;
        b=s2r63Dc7/meba8NLFWNH2dOcWP/4FnYAQrLLPKhSZbtNgQRlC7DKLtlGJ8+sxbCxRr
         NzMkqUX943gyydqE6B+brBJj1Ac9APmrozpVPVPyQMKzLAD7/+XV0x2B+wvoEAJU94hr
         BJZY2codAIv2qVp+k8s8E1qeBF1BAi6B/aQFw=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:cc:subject:date:message-id:user-agent:mime-version
         :content-type;
        b=R0+czhij4mYN6ZHMSsZr/EutiNVjxVpgUd0cHS/wCV0G5rbsFUAMCq/rP/UI4CZjBC
         zB3ea8sUBat/VCm/yB9ixaG4DawJkzAB/0NNdNVVWJmozStQfNPcBCtCF4J0NydpXKn2
         5/TRwPs9IE33gdRBtkFqGdOAdvgTmP7SLPIt4=
Received: by 10.103.252.17 with SMTP id e17mr5590667mus.14.1228254520212;
        Tue, 02 Dec 2008 13:48:40 -0800 (PST)
Received: from tux.homenetwork (49.78.88-79.rev.gaoland.net [79.88.78.49])
        by mx.google.com with ESMTPS id 7sm8647735mup.24.2008.12.02.13.48.39
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Tue, 02 Dec 2008 13:48:39 -0800 (PST)
From: Thierry Volpiatto <thierry.volpiatto@HIDDEN>
To: emacs-pretest-bug@HIDDEN
Cc: emacs@HIDDEN
Subject: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Date: Tue, 02 Dec 2008 22:43:43 +0100
Message-ID: <87bpvufe28.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the emacs-pretest-bug@HIDDEN mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

When killing emacs --daemon or emacs brutally with killall for example,
when reloading emacs or emacs --daemon, emacs ask if we want to load
desktop file or not (pid is already in use...).
I think emacs should check if the PID that is in his lock file is always
in use.
i made a quick hack for that:
That go after line 967 in desktop.el in function desktop-read.

,----
| (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs | grep %d" (getenv "USER") owner)))
`----

I can make a patch if you want, just tell me.

This bug is not really a bug if we consider using emacs normally:
we have just to answer yes or no.
But that particularly anoying with new feature emacs --daemon.
If this one is started as a service it can hang the system and booting
the machine come impossible until file .emacs.desktop.lock is removed.
(Gentoo provide an init script to start emacs --daemon as service with openrc)

Thank you.
Thierry

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.0.60/etc/DEBUG for instructions.


In GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.14.5)
 of 2008-12-02 on tux
Windowing system distributor `The X.Org Foundation', version 11.0.10300000
configured using `configure  '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--program-suffix=-emacs-23' '--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x' '--without-toolkit-scroll-bars' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xpm' '--with-freetype' '--with-xft' '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' '--build=i686-pc-linux-gnu' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=i686 -pipe -O2' 'LDFLAGS=-Wl,-O1''

Important settings:
  value of $LC_ALL: fr_FR.UTF-8
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_FR.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: ERC

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  icomplete-mode: t
  icicle-mode: t
  delete-selection-mode: t
  minibuffer-depth-indicate-mode: t
  auto-image-file-mode: t
  partial-completion-mode: t
  shell-dirtrack-mode: t
  display-wireless-mode: t
  display-battery-mode: t
  display-time-mode: t
  diff-auto-refine-mode: t
  recentf-mode: t
  savehist-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
m e ! ) <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> C-e 
<return> A n y SPC <backspace> w a y SPC i SPC w i 
l l SPC s u b m i t SPC a SPC b u g SPC a l s o . <return> 
T h a n k s . <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <right> <right> 
<right> <backspace> <left> <left> <left> <left> <left> 
g m a n e . <right> <right> <right> <right> <right> 
<right> <left> . <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<tab> <tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <tab> <tab> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <down> 
<down> <down> <down> <down> <down> C-SPC C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-x r s a C-g C-g C-c C-c y 
q q n <return> <return> q <return> <return> q q y <switch-frame> 
h k B s t : <backspace> <left> <left> <left> <left> 
<left> H i ! SPC <right> <right> <right> <right> <right> 
<return> M-x e m a c s - s u b m i <tab> <backspace> 
<backspace> <backspace> <backspace> <backspace> <tab> 
b u g <tab> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
b u g <S-iso-lefttab> <down> <down> <down> <down> <down> 
C-g M-x r e p o r t - e <tab> b u g <return>

Recent messages:
Scoring...done
Generating summary...done
No more unread articles
No more unread newsgroups
Are you sure you want to quit reading news? (y or n) 
Wrote /home/thierry/.newsrc
Saving /home/thierry/.newsrc.eld...
Wrote /home/thierry/.newsrc.eld
Saving /home/thierry/.newsrc.eld...done
Computing completion candidates... [5 times]

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




Acknowledgement sent to Thierry Volpiatto <thierry.volpiatto@HIDDEN>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1474; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 24 Jan 2020 17:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.