Bad-ptr / persp-mode.el

named perspectives(set of buffers/window configs) for emacs
401 stars 44 forks source link

Dired buffers not stored correctly? #37

Closed cpaulik closed 8 years ago

cpaulik commented 8 years ago

When doing persp-save-state-to-file dired buffers are stored as e.g. (def-buffer "cp" nil dired-mode) which does not load them correctly. Replacing this by (def-buffer "cp" "/home/cp" dired-mode) makes it work.

This is in spacemacs with persp-mode-20160425.2309

Bad-ptr commented 8 years ago

Try this:

(with-eval-after-load "persp-mode"
  (add-to-list 'persp-save-buffer-functions
               #'(lambda (b)
                   (when (eq 'dired-mode (buffer-local-value 'major-mode b))
                     `(def-buffer ,(buffer-name b)
                        ,(buffer-local-value 'default-directory b)
                        ,(buffer-local-value 'major-mode b))))))
cpaulik commented 8 years ago

Thanks, that works. Should this be default or should I keep it in my own config?

Bad-ptr commented 8 years ago

Should this be default or should I keep it in my own config?

I think it should be(and so it will be) a part of the persp-mode.

Bad-ptr commented 8 years ago

Now it's in the persp-mode 59ab217948808b486e2983d1b68235d999f90f39.