weiner@novavax.UUCP (Bob Weiner) (09/26/89)
;;; Substitute these for the initial definitions in em-config.el.
(defconst emc-file "~/.em-config"
"Default file into which to save Emacs session data.")
(defvar emc-start-file nil
"Last file to read in each time the default Emacs configuration is loaded.
This makes it the first file seen by the user.")
(defun emc-save (&optional file)
"Save Emacs configuration to optional FILE or 'emc-file'."
(interactive "FSave Emacs configuration to: ")
(run-hooks 'emc-save-hook)
(if (or (equal file "") (null file))
(setq file emc-file))
(let ((standard-output (set-buffer (find-file-noselect file))))
(erase-buffer)
;;; (emc-save-session-data)
(emc-save-buffer-data)
;;; (emc-save-window-data)
(set-buffer standard-output)
(save-buffer)
))
(defun emc-restore (&optional file)
"Restore Emacs configuration from optional FILE or 'emc-file'.
Adds buffers to current buffer list. Returns t if the file is found,
otherwise nil."
(interactive "fRestore Emacs configuration from: ")
(run-hooks 'emc-restore-hook)
(if (or (equal file "") (null file))
(setq file emc-file))
(if (file-exists-p file)
(let ((standard-input (set-buffer (find-file-noselect emc-file))))
(goto-char (point-min))
;;; (emc-restore-session-data)
(emc-restore-buffer-data)
;;; (emc-restore-window-data)
(kill-buffer standard-input)
(and emc-start-file (equal file emc-file)
(file-exists-p emc-start-file) (find-file emc-start-file))
t)))
--
Bob Weiner, Motorola, Inc., USENET: ...!gatech!uflorida!novavax!weiner
(407) 738-2087