emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto-save-file-name-transforms too simple?


From: Kai Großjohann
Subject: Re: auto-save-file-name-transforms too simple?
Date: Tue, 20 Nov 2001 22:23:49 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.50 (i686-pc-linux-gnu)

"Eli Zaretskii" <address@hidden> writes:

>> From: address@hidden (Kai =?iso-8859-1?q?Gro=DFjohann?=)
>> Date: Tue, 20 Nov 2001 18:46:17 +0100
>> 
>> For one thing, the default value is set up to put some auto-save
>> files in the /tmp directory.  This will fail on systems where /tmp
>> does not exist, I think.  Can we expect all systems to have that
>> directory?  What about Windows and MacOS?
>
> It should use temporary-file-directory instead of the literal "/tmp".

Like this?

Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.3058
diff -u -r1.3058 ChangeLog
--- lisp/ChangeLog      2001/11/20 18:36:15     1.3058
+++ lisp/ChangeLog      2001/11/20 21:23:20
@@ -1,3 +1,8 @@
+2001-11-20  Kai Gro,A_(Bjohann  <address@hidden>
+
+       * files.el (auto-save-file-name-transforms): Put remote files in
+       temporary-file-directory rather than /tmp.
+
 2001-11-20  Eli Zaretskii  <address@hidden>
 
        * play/landmark.el: Mark lm-mode as special.  Suggested by Klaus

Index: lisp/files.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/files.el,v
retrieving revision 1.536
diff -u -r1.536 files.el
--- lisp/files.el       2001/11/11 01:53:50     1.536
+++ lisp/files.el       2001/11/20 21:22:12
@@ -286,7 +286,8 @@
   :group 'auto-save)
 
 (defcustom auto-save-file-name-transforms
-  '(("\\`/[^/]*:\\(.+/\\)*\\(.*\\)" "/tmp/\\2"))
+  `(("\\`/[^/]*:\\(.+/\\)*\\(.*\\)"
+     ,(format "%s\\2" (file-name-as-directory temporary-file-directory))))
   "*Transforms to apply to buffer file name before making auto-save file name.
 Each transform is a list (REGEXP REPLACEMENT):
 REGEXP is a regular expression to match against the file name.
@@ -296,8 +297,9 @@
 When one transform applies, its result is final;
 no further transforms are tried.
 
-The default value is set up to put the auto-save file into `/tmp'
-for editing a remote file."
+The default value is set up to put the auto-save file into the
+temporary directory (see the variable `temporary-file-directory') for
+editing a remote file."
   :group 'auto-save
   :type '(repeat (list (string :tag "Regexp") (string :tag "Replacement")))
   :version "21.1")


kai
-- 
Simplification good!  Oversimplification bad!  (Larry Wall)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]