Pārlūkot izejas kodu

Move desktop-save to the end of the init file

Having it sooner means it can try eval()'ing modes that might not yet be setup.
master
Mitchell Tishmack pirms 5 gadiem
vecāks
revīzija
9ffea3fea2
1 mainītis faili ar 30 papildinājumiem un 22 dzēšanām
  1. +30
    -22
      emacs.org

+ 30
- 22
emacs.org Parādīt failu

@@ -1158,28 +1158,6 @@ Make buffer names unique based on their directory and not have <N> or other nons
(custom-set-variables '(uniquify-buffer-name-style 'post-forward))
#+END_SRC

*** desktop-save

Desktop saving of session information handy to keep the same buffers between sessions.

#+BEGIN_SRC emacs-lisp
(require 'desktop)

(desktop-save-mode 1)

(custom-set-variables
'(desktop-restore-eager 5)
'(desktop-path '("~/.emacs.d"))
'(desktop-dirname "~/.emacs.d")
'(desktop-base-file-name "desktop")
)

(defun local-desktop-save ()
(interactive)
(if (eq (desktop-owner) (emacs-pid))
(desktop-save desktop-dirname)))
#+END_SRC

*** TODO super-save :validation:testing:

REMOVE ME && TODO IF THIS WORKS
@@ -1697,6 +1675,36 @@ Create *auto-insert-alist* so all the mode lists are the same
auto-insert-alist)
)
#+END_SRC

*** desktop-save

Note: this is at the end so that anything that might get eval()'d from the desktop file can have been loaded by this point. Important as my org mode setup ordering requires some shenanigans.

Desktop saving of session information handy to keep the same buffers between sessions.

#+BEGIN_SRC emacs-lisp
(defun desktop-setup ()

(require 'desktop)

(desktop-save-mode 1)

(custom-set-variables
'(desktop-restore-eager 5)
'(desktop-path '("~/.emacs.d"))
'(desktop-dirname "~/.emacs.d")
'(desktop-base-file-name "desktop")
)

(defun local-desktop-save ()
(interactive)
(if (eq (desktop-owner) (emacs-pid))
(desktop-save desktop-dirname)))
)

;;(add-hook 'after-init-hook 'desktop-setup)
#+END_SRC

* custom

Load this up last to allow for local customization if needed and to keep from custom writing to the init.el file.


Notiek ielāde…
Atcelt
Saglabāt