delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/30/01:30:22

Date: Wed, 30 Aug 2000 08:27:24 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: Emacs project file?
In-Reply-To: <8oh6s4$3l1$3@ctb-nnrp2.saix.net>
Message-ID: <Pine.SUN.3.91.1000830082217.7235B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019