changeset 13811:66fa6267358e

(command-line-1): Use auto-save-list-file-prefix when checking for existing files. (normal-top-level): Don't set auto-save-list-file-name if auto-save-list-file-prefix is nil. (normal-top-level): Don't set auto-save-list-file-name if it was already set non-nil (by .emacs, for example). (auto-save-list-file-prefix): Doc fix.
author Karl Heuer <kwzh@gnu.org>
date Thu, 21 Dec 1995 18:10:03 +0000
parents 64679d67fde9
children fdbace398b5e
files lisp/startup.el
diffstat 1 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Thu Dec 21 18:08:12 1995 +0000
+++ b/lisp/startup.el	Thu Dec 21 18:10:03 1995 +0000
@@ -228,9 +228,12 @@
 after your init file is read, in case it sets `mail-host-address'.")
 
 (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.")
+  "Prefix for generating `auto-save-list-file-name'.
+This is used after reading your `.emacs' file to initialize
+`auto-save-list-file-name', by appending Emacs's pid and the system name,
+if you have not already set `auto-save-list-file-name' yourself.
+Set this to nil if you want to prevent `auto-save-list-file-name'
+from being initialized.")
 
 (defvar init-file-debug nil)
 
@@ -284,12 +287,14 @@
 	(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))))
+	(or auto-save-list-file-name
+	    (and 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))
@@ -658,7 +663,13 @@
 			   window-system)
 		       (insert "\n
 C-mouse-3 (third mouse button, with Control) gets a mode-specific menu."))
-		   (if (directory-files "~/" nil "\\`\\.saves-" t)
+		   (if (directory-files (file-name-directory auto-save-list-file-prefix)
+					nil
+					(concat "\\`"
+						(regexp-quote
+						 (file-name-nondirectory
+						  auto-save-list-file-prefix)))
+					t)
 		       (insert "\n\nIf an Emacs session crashed recently,\n"
 			       "type M-x recover-session RET to recover"
 			       " the files you were editing."))