Reputation: 46
I use emacs on ubuntu 15.04,and my emacs config file is from https://github.com/purcell/emacs.d, with some of my own configuration file.
When I run emacs from shell or start icon, it start normal, show some loading information, and ask a question about desktop file already been used by some pid. Neither answer yes or no, the frame goes on until the last step, it just disappears. There are process pid still, but the emacs frame can not be found no where.
If I start emacs from shell command, and use -q parameter, not loading configuration files, everything is just fine. And I can even load the configuration file by hand after that.
If I start emacs from shell command, with -nw parameter, also it can work.
Any one have any ideas about what is really going on here?
Upvotes: 2
Views: 529
Reputation: 2685
I know exactly what your issue is. I had the same problem myself.
Emacs desktop tries to restore the same windows in the same location as you opened them last time. But the last time you opened Emacs successfully you started it in a different DISPLAY
(DISPLAY
is an environment variable in Linux that more or less controls which window manager new windows should be appear in). So, the wrong DISPLAY
is stored in your .emacs.desktop
file. When you open Emacs, desktop helpfully opens Emacs in the old DISPLAY
, which you have no way of viewing.
with Emacs closed, open ~/.emacs.d/.emacs.desktop
. Inside, you'll see
(setq desktop-saved-frameset ... (display . ":1.0") ...)
Change that to (display . ":0.0")
, and open Emacs again.
Put this in your .emacs
:
(setq desktop-restore-frames nil)
Upvotes: 4