I would like to have “Wrap at Window Edge” enabled for all but text-mode buffers (for the latter I have auto-fill turned on via (add-hook 'text-mode-hook 'turn-on-auto-fill)). I couldn’t manage to achieve this and finally reduced the contents of my .emacs file stepwise to see where the problem is. Under my setup (see below), I could start with an empty .emacs and obtained by default (as it should be) Wrap at Window Edge with the little squiggle arrows if a line is wrapped over. Everything fine. Now I added the single line (desktop-save-mode 1) to .emacs. Suddenly, the default switches to “Word Wrap (Visual Line mode)”. If I then (by hand) set it to “Wrap at Window Edge” (via Options -> Line Wrapping in This Buffer), I obtain the right wrapping but the little squiggle arrows are missing.
What is wrong?
I would really like to use desktop-save-mode but I didn’t know that it has such a wide impact on other things.
Here is my setup:
I work with GNU Emacs 24.0.95.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) [installed as Emacs-pretest-24.0.91-universal-10.6.7.dmg from http://emacsformacosx.com/builds%5D on Mac OS X 10.7.3.
The Desktop library not only restores buffers from a session, but it sets the same modes which were active in that session as well, and some variables as well.
It is therefore possible for changes made in your init file to appear to not take effect, because the pre-change versions from the Desktop file are clobbering them.
For details, see the commentary in the desktop library, and the manual:
find-libraryRETdesktopRET(info "(emacs) Saving Emacs Sessions")RET(info "(elisp) Desktop Save Mode")RETFor individual file buffers, simply reverting/reloading the file will generally sort things out. For global settings, updating the setting and re-saving the desktop file would usually be enough.
In theory, you should be able to wipe the slate clean with:
M-x
desktop-clearRETFailing that, shut down Emacs and delete the
.emacs.desktopand.emacs.desktop.lockfiles before restarting.