[OS X Emacs] Warning: Desktop file appears to be in use by PID ...

Jack Repenning jrepenning at collab.net
Mon Sep 19 14:36:23 EDT 2011


On Sep 19, 2011, at 1:07 AM, Hofert Jan Marius wrote:

>> If you have some need to shut down without answering questions, then set desktop-save to t rather than 'ask or several other possibilities (again, the Customize menu is probably the easiest path).
> 
> okay, I will do that. 

Since  you report that you do, at least sometimes, get some sort of question, this is a very promising change, and may solve the whole problem for you.

>> Also, be sure that desktop-dirname and desktop-base-file-name are set sensibly.
> 
> the entry "Desktop Base File Name" says ".emacs.desktop". I couldn't find an entry for desktop-dirname. I tried to search for it via "C-h a", but there were no matches. How can I display that?

Try "C-h v" (describe-variable), since this is a variable. By default (and so, probably in your case), "C-h a" is "command-apropos," only shows you commands, not variables.

> I also just saw this: http://www.emacswiki.org/emacs/DeskTop
> There is a section called "Auto-Saving the Desktop". Is this a good defun to use? 

There's some interesting stuff there, particularly in your context the "Stale Locks" stuff, but the dependence on "defadvice" is a red flag for the novice user. At the least, I'd suggest you not go there until you're sure the desktop-save change is inadequate.

(Here's why I warn against defadvice: the "advice" mechanism is a way to modify Elisp functions, without changing their actual text. So, for example, the "Stale Locks" example you cited has a "defadvice desktop-owner ... after ...." That means "change the existing desktop-owner function, so that this other code runs after the official version is done." There are also "before" and "around" structures available. There are several red flags here. For one, if you've "advised" a function and then ask for help because it's not behaving as expected, you're not likely to recall making that change, and someone trying to help you is likely to bust their brains trying to figure out why these other things are happening that just aren't in the function definition. As well, there are some tricky bits about loading functions and then defining them, which ultimately mean that there's a new failure mode possible: sometimes, it might happen that your advice gets applied,  sometimes not, and that's another big pain-in-the for debugging. And of course, there's always the possibility that the advised code itself has a bug.)

-==-
Jack Repenning
Technologist
CollabNet Cloud Services
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
office: +1 650.228.2562
twitter: http://twitter.com/jrep













More information about the MacOSX-Emacs mailing list