Yoshiki Hayashi <yoshiki(a)xemacs.org> writes:
I also think it is a good plan. I'll implement it after I
get bored with Mule maze. I'm currently trying to make
encoded-kb.el work with XEmacs. Functions used there are
full of incompatibilities...
Here's the patch.
2000-10-27 Yoshiki Hayashi <yoshiki(a)xemacs.org>
* fileio.c (Vauto_save_list_file_prefix): Moved from startup.el.
(Vinhibit_auto_save_session): New variable.
(vars_of_fileio): Declare and initialize them.
* fileio.c (Fdo_auto_save): Don't create session file if
Vinhibit_auto_save_session or Vauto_save_list_file_prefix is non-nil.
2000-10-27 Yoshiki Hayashi <yoshiki(a)xemacs.org>
* startup.el (auto-save-list-file-prefix): Moved to fileio.c.
* startup.el (normal-top-level): Setup auto-save-list-file-name
if auto-save-list-file-prefix is non-nil.
Index: src/fileio.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/fileio.c,v
retrieving revision 1.51.2.28
diff -u -r1.51.2.28 fileio.c
--- fileio.c 2000/10/12 04:59:07 1.51.2.28
+++ fileio.c 2000/10/27 10:26:40
@@ -94,6 +94,12 @@
/* File name in which we write a list of all our auto save files. */
Lisp_Object Vauto_save_list_file_name;
+/* Prefix used to construct Vauto_save_list_file_name. */
+Lisp_Object Vauto_save_list_file_prefix;
+
+/* When non-nil, it prevents auto-save list file creation. */
+Lisp_Object Vinhibit_auto_save_session;
+
int disable_auto_save_when_buffer_shrinks;
Lisp_Object Vdirectory_sep_char;
@@ -3982,7 +3988,9 @@
/* Open the auto-save list file, if necessary.
We only do this now so that the file only exists
if we actually auto-saved any files. */
- if (!auto_saved && STRINGP (listfile) && listdesc < 0)
+ if (!auto_saved && !Vinhibit_auto_save_session
+ && !NILP (Vauto_save_list_file_prefix)
+ && STRINGP (listfile) && listdesc < 0)
{
listdesc = open ((char *) XSTRING_DATA (listfile),
O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY,
@@ -4297,6 +4305,18 @@
File name in which we write a list of all auto save file names.
*/ );
Vauto_save_list_file_name = Qnil;
+
+ DEFVAR_LISP ("auto-save-list-file-prefix", &Vauto_save_list_file_prefix
/*
+Prefix for generating auto-save-list-file-name.
+Emacs's pid and the system name will be appended to
+this prefix to create a unique file name.
+*/ );
+ Vauto_save_list_file_prefix = build_string ("~/.saves-");
+
+ DEFVAR_BOOL ("inhibit-auto-save-session", &Vinhibit_auto_save_session /*
+When non-nil, inhibit auto save list file creation.
+*/ );
+ Vinhibit_auto_save_session = 0;
DEFVAR_BOOL ("disable-auto-save-when-buffer-shrinks",
&disable_auto_save_when_buffer_shrinks /*
Index: lisp/startup.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/startup.el,v
retrieving revision 1.24.2.22
diff -u -r1.24.2.22 startup.el
--- startup.el 2000/10/12 07:22:43 1.24.2.22
+++ startup.el 2000/10/27 10:26:41
@@ -171,11 +171,6 @@
:type 'string
:group 'mail)
-(defvar auto-save-list-file-prefix "~/.saves-"
- "Prefix for generating auto-save-list-file-name.
-Emacs's pid and the system name will be appended to
-this prefix to create a unique file name.")
-
(defvar init-file-debug nil)
(defvar init-file-had-error nil)
@@ -443,12 +438,13 @@
(setq default-directory (abbreviate-file-name default-directory))
;; Specify the file for recording all the auto save files of
;; this session. This is used by recover-session.
- (setq auto-save-list-file-name
- (expand-file-name
- (format "%s%d-%s"
- auto-save-list-file-prefix
- (emacs-pid)
- (system-name))))
+ (if auto-save-list-file-prefix
+ (setq auto-save-list-file-name
+ (expand-file-name
+ (format "%s%d-%s"
+ auto-save-list-file-prefix
+ (emacs-pid)
+ (system-name)))))
(run-hooks 'emacs-startup-hook)
(and term-setup-hook
(run-hooks 'term-setup-hook))
--
Yoshiki Hayashi