bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is alw


From: Thierry Volpiatto
Subject: bug#1474: 23.0.60; desktop.el don't check if pid in his lock file is always in use
Date: Wed, 03 Dec 2008 07:36:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

"Juanma Barranquero" <address@hidden> writes:

> On Tue, Dec 2, 2008 at 22:43, Thierry Volpiatto
> <address@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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]