[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Load specific files at startup?
From: |
ken |
Subject: |
Re: Load specific files at startup? |
Date: |
Sat, 09 Aug 2008 02:41:19 -0400 |
User-agent: |
Thunderbird 2.0.0.0 (X11/20070326) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 08/08/2008 11:55 PM ssecorp wrote:
| How can I set emacs to open some specific files at startup, maybe even
| split the windows for me?
|
| Can I save the state of shutdown so I can reopen and just continue
| where I left off?
|
| This would be nice since I work with the same project almost the whole
| time.
|
|
| Could this even be set as a menu where I could have different projects
| that I could choose to load?
Except for the menu for different projects, this does what you're asking
for. I've been using it for years. Perhaps it could be hacked a bit to
provide a menu.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Save the current emacs session for the next emacs session.
;; automatically save the desktop to a user-specified file periodically,
like auto-save
(defun desktop-save-in-home-dir ()
~ "save current emacs desktop in file in home directory"
~ (if (buffer-file-name) ;; do only for real files
~ (let (find-file-hooks ;; must - do not loop on this
function
~ kill-buffer-hook) ;; must - do not loop on this
function
~ (desktop-save "~/")
~ ))
~ nil)
(add-hook 'find-file-hooks 'desktop-save-in-home-dir t)
(add-hook 'kill-buffer-hook 'desktop-save-in-home-dir t)
(defun desktop-auto-save ()
~ "Added to auto-save-hook so the desktop is not lost."
~ (desktop-save "~/")
; (message "Wrote desktop.")
~ )
(add-hook 'auto-save-hook 'desktop-auto-save t)
;; load the desktop on startup
(desktop-load-default)
;; automatically save the desktop on exit.
(setq desktop-enable t)
;;Manually, just do M-x desktop-read to load the last saved desktop.
;;; end auto-saving of desktop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- --
Please note that I will be changing this email address soon. The PGP
signature should ensure for everyone that, though the email address
will be different, I will be the same person.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFInTwL8CeNiFrQkecRArqIAJ9g3zcOnysptPI/KsydhhN3bFRWuACdF8Hs
Il7spZh9iXlnafk16073a80=
=Je9P
-----END PGP SIGNATURE-----