[Top][All Lists]

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

Re: [h-e-w] Alt-tab does not switch tasks

From: Eli Zaretskii
Subject: Re: [h-e-w] Alt-tab does not switch tasks
Date: Fri, 01 Aug 2008 13:38:05 +0300

> Date: Thu, 31 Jul 2008 14:48:25 -0500
> From: "Raynor, Bill" <address@hidden>
> cc: address@hidden
> Yes. 
> Commenting out various pieces of my .emacs file narrows the problem to
> the (desktop-save-mode 1) line. If that is commented out the PID problem
> goes away. If I leave it in, the problem occurs.

Yes, but removing that line means you cannot preserve and restore your
session, so this is not a solution.

I cannot reproduce your problem using today's CVS Emacs on my Windows
XP machine.  So I describe below how does this feature works, and I'm
asking you to look which parts of the description below don't work on
your system.

When the Desktop package is loaded, and Emacs visits the
`.emacs.desktop' file at startup, it places in the directory of
`.emacs.desktop' a file called `.emacs.desktop.lock'.  In that file,
you should see a single number: the PID of the running Emacs which is
using the `.emacs.desktop' file.

When Emacs exits, it removes the `.emacs.desktop.lock' file as part of
its shutdown process.  This works because desktop.el has this line:

  (add-hook 'kill-emacs-hook 'desktop-kill)

and `desktop-kill' does this as its last line:

  (when (eq (emacs-pid) (desktop-owner)) (desktop-release-lock))

Here's the function `desktop-release-lock':

  (defun desktop-release-lock (&optional dirname)
    "Remove the lock file for the desktop in DIRNAME.
  DIRNAME omitted or nil means use `desktop-dirname'."
    (let ((file (desktop-full-lock-name dirname)))
      (when (file-exists-p file) (delete-file file))))

As you see, it should delete the `.emacs.desktop.lock' file.

Can you see which parts of this machinery don't work on your system,
and why?  For starters, is the PID recorded in `.emacs.desktop.lock'
match the PID of Emacs that is running?

reply via email to

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