tags 1474 + patch thanks Thierry Volpiatto 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