Function: desktop-owner

desktop-owner is a byte-compiled function defined in desktop.el.gz.

Signature

(desktop-owner &optional DIRNAME)

Documentation

Return the PID of the Emacs process that owns the desktop file in DIRNAME.

Return nil if no desktop file found or no Emacs process is using it. DIRNAME omitted or nil means use desktop-dirname.

Source Code

;; Defined in /usr/src/emacs/lisp/desktop.el.gz
(defun desktop-owner (&optional dirname)
  "Return the PID of the Emacs process that owns the desktop file in DIRNAME.
Return nil if no desktop file found or no Emacs process is using it.
DIRNAME omitted or nil means use `desktop-dirname'."
  (let (owner
	(file (desktop-full-lock-name dirname)))
    (and (file-exists-p file)
	 (ignore-errors
	   (with-temp-buffer
	     (insert-file-contents-literally file)
	     (goto-char (point-min))
	     (setq owner (read (current-buffer)))
	     (integerp owner)))
	 owner)))