[Top][All Lists]

[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 (X11/20070326)

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
~                 kill-buffer-hook)     ;; must - do not loop on this
~               (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
;; 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.
Version: GnuPG v1.4.0 (GNU/Linux)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]