unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: ken <gebser@speakeasy.net>
To: GNU Emacs List <help-gnu-emacs@gnu.org>
Subject: Re: Load specific files at startup?
Date: Sat, 09 Aug 2008 02:41:19 -0400	[thread overview]
Message-ID: <489D3C0F.5080702@speakeasy.net> (raw)
In-Reply-To: <5005c865-1513-4ac8-aabe-9e359480afc6@x35g2000hsb.googlegroups.com>

-----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-----




  parent reply	other threads:[~2008-08-09  6:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-09  3:55 Load specific files at startup? ssecorp
2008-08-09  6:40 ` Peter Dyballa
2008-08-09  6:41 ` ken [this message]
2008-08-09  9:24   ` Peter Dyballa
     [not found] ` <mailman.16163.1218264049.18990.help-gnu-emacs@gnu.org>
2008-08-11 10:19   ` Xah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=489D3C0F.5080702@speakeasy.net \
    --to=gebser@speakeasy.net \
    --cc=gebser@mousecar.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).