I am trying to get session to work, and I am especially keen on having my registers persistent between sessions. I installed the package sessions.el via Melpa (M-x list-packages) and I added this to my .emacs
(require 'session)
(add-hook 'after-init-hook 'session-initialize)
and I also added this as recommended in the session.el file (even though desktop is not enabled)
(setq desktop-globals-to-save '(desktop-missing-file-warning))
This doesn't seem to be working though. I tried saving my registers but they are not persistent across sessions. I tried changing the value of session-globals-include via M-x customize-group RET session RET to include register. This is what emacs added to my .emacs file after the changes in custom
'(session-globals-include
(quote
((kill-ring 10 nil)
(session-file-alist 100 t)
(file-name-history 200 nil)
search-ring regexp-search-ring
(register-alist 100 t))))
'(session-use-package t nil (session)))
Still, when I try to invoke a register using C-x r j r (the set register from the previous session), it says "Register doesn't contain a buffer position or configuration". I am not even sure anything is being saved between sessions. What am I doing wrong?
(desktop-save-mode)to your init.el or .emacs, the package is also documented in Emacs manual ((info "(emacs) Saving Emacs Sessions")). – xuchunyang Sep 25 '15 at 14:42(desktop-save-mode)is the same as(desktop-save-mode 1)for relatively new Emacs version (24?) according to its docstring "If called from Lisp, enable the mode if ARG is omitted or nil.", you can read its docstring withC-h fto make sure that, – xuchunyang Sep 25 '15 at 14:51