emacs-devel
[Top][All Lists]
Advanced

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

Re: desktop.el and his lock file


From: Thierry Volpiatto
Subject: Re: desktop.el and his lock file
Date: Wed, 03 Dec 2008 08:26:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Miles Bader <address@hidden> writes:

> Thierry Volpiatto <address@hidden> writes:
>> here is the code i put after line 967 in desktop.el:
>>
>> the function is desktop-read
>> ,----
>> | (if (and owner
>> |          (eq 0 (call-process-shell-command (format "ps -u %s | grep emacs 
>> | grep %d" (getenv "USER") owner)))
>> |          .....
>> `----
>
> It might be better to use the `signal-process' function with signal
> number 0 -- that will just check to see if the process exists and return
> an appropriate exit code (0 = exists, -1 = doesn't exist), without
> actually sending any signal.
>
> [I guess it won't work on windows, but presumably neither does your
> pipeline... :-]

yes:

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

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




reply via email to

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