Mail Archives: djgpp/2000/08/30/01:30:22
On Tue, 29 Aug 2000, Stefan Viljoen wrote:
> Is it possible to get Emacs to create some kind of project file like SETEDIT
> does? I.e. to make it load a set of files automatically when you restart it,
> like say a set of project files for a program you are currently working on?
Yes, there is such a package for Emacs. It's called `desktop', and is
part of the Emacs distribution. It is also described in the Emacs
manual, see the section "Saving Emacs Sessions".
The way I use it is to say "M-x desktop-save RET RET" once whenever I
start a new project. This leaves an _emacs.desktop (on Windows it's
called .emacs.desktop) file in the directory where I work.
Thereafter, whenever I start Emacs in that directory, it automatically
restores the last session for that directory.
You will need the following magic on your _emacs init file:
(setq desktop-missing-file-warning nil)
(condition-case err
(progn
(load "desktop")
(desktop-load-default)
(if (file-exists-p (concat "./" desktop-basefilename))
(desktop-read)
(desktop-save "./")))
(error
(message "Desktop save/restore error: %s" (error-message-string err))))
Note that this snippet (and many others) is already in the _emacs.xmpl
example init file that is part of the DJGPP Emacs distribution,
emNNNNb.zip.
- Raw text -