annotate lisp/auto-save.el @ 351:1057b58c392a r21-1-5

Import from CVS: tag r21-1-5
author cvs
date Mon, 13 Aug 2007 10:54:53 +0200
parents 19dcec799385
children cc15677e0335
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
1 ;;; auto-save.el -- Safer autosaving for EFS and tmp.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
2
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
4 ;; Copyright (C) 1992 by Sebastian Kremer <sk@thp.uni-koeln.de>
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
5
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
6 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
7 ;; Maintainer: XEmacs Development Team
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
8 ;; Keywords: extensions, dumped
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
9 ;; Version: 1.26
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
10
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 1, or (at your option)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
14 ;; any later version.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
15
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
19 ;; General Public License for more details.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
20
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
24 ;; 02111-1307, USA.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
25
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
26 ;;; Synched up with: Not in FSF
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
27
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
28 ;;; Commentary:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
29
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
30 ;; This file is dumped with XEmacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
31
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
32 ;; Combines autosaving for efs (to a local or remote directory)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
33 ;; with the ability to do autosaves to a fixed directory on a local
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
34 ;; disk, in case NFS is slow. The auto-save file used for
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
35 ;; /usr/foo/bar/baz.txt
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
36 ;; will be
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
37 ;; AUTOSAVE/#\!usr\!foo\!bar\!baz.txt#
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
38 ;; assuming AUTOSAVE is the non-nil value of the variable
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
39 ;; `auto-save-directory'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
40
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
41 ;; Takes care that autosave files for non-file-buffers (e.g. *mail*)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
42 ;; from two simultaneous Emacses don't collide.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
43
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
44 ;; Autosaves even if the current directory is not writable.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
45
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
46 ;; Can limit autosave names to 14 characters using a hash function,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
47 ;; see `auto-save-hash-p'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
48
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
49 ;; See `auto-save-directory' and `make-auto-save-file-name' and
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
50 ;; references therein for complete documentation.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
51
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
52 ;; `M-x recover-all-files' will effectively do recover-file on all
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
53 ;; files whose autosave file is newer (one of the benefits of having
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
54 ;; all autosave files in the same place).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
55
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
56 ;; This file is dumped with XEmacs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
57
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
58 ;; If you want to autosave in the fixed directory /tmp/USER-autosave/
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
59 ;; (setq auto-save-directory
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
60 ;; (concat "/tmp/" (user-login-name) "-autosave/"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
61
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
62 ;; If you don't want to save in /tmp (e.g., because it is swap
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
63 ;; mounted) but rather in ~/autosave/
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
64 ;; (setq auto-save-directory (expand-file-name "~/.autosave/"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
65
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
66 ;; If you want to save each file in its own directory (the default)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
67 ;; (setq auto-save-directory nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
68 ;; You still can take advantage of autosaving efs remote files
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
69 ;; in a fixed local directory, `auto-save-directory-fallback' will
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
70 ;; be used.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
71
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
72 ;; If you want to use 14 character hashed autosave filenames
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
73 ;; (setq auto-save-hash-p t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
74
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
75 ;; Finally, put this line after the others in your ~/.emacs:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
76 ;; (require 'auto-save)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
77
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
78
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
79 ;;; Acknowledgement:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
80
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
81 ;; This code is loosely derived from autosave-in-tmp.el by Jamie
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
82 ;; Zawinski <jwz@netscape.com> (the version I had was last modified 22
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
83 ;; dec 90 jwz) and code submitted to ange-ftp-lovers on Sun, 5 Apr
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
84 ;; 92 23:20:47 EDT by drw@BOURBAKI.MIT.EDU (Dale R. Worley).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
85 ;; auto-save.el tries to cover the functionality of those two
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
86 ;; packages.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
87
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
88 ;; Valuable comments and help from Dale Worley, Andy Norman, Jamie
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
89 ;; Zawinski and Sandy Rutherford are gratefully acknowledged.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
90
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
91 (defconst auto-save-version "1.26"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
92 "Version number of auto-save.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
93
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
94 (provide 'auto-save)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
95
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
96
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
97 ;;; Customization:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
98
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
99 (defgroup auto-save nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
100 "Autosaving with support for efs and /tmp."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
101 :group 'data)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
102
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
103 (put 'auto-save-interval 'custom-type 'integer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
104 (put 'auto-save-interval 'factory-value '(300))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
105 (custom-add-to-group 'auto-save 'auto-save-interval 'custom-variable)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
106
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
107 (defcustom auto-save-directory nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
108
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
109 ;; Don't make this user-variable-p, it should be set in .emacs and
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
110 ;; left at that. In particular, it should remain constant across
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
111 ;; several Emacs session to make recover-all-files work.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
112
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
113 ;; However, it's OK for it to be customizable, as most of the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
114 ;; customizable variables are set at the time `.emacs' is read.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
115 ;; -hniksic
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
116
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
117 "If non-nil, fixed directory for autosaving: all autosave files go
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
118 there. If this directory does not yet exist at load time, it is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
119 created and its mode is set to 0700 so that nobody else can read your
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
120 autosave files.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
121
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
122 If nil, each autosave files goes into the same directory as its
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
123 corresponding visited file.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
124
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
125 A non-nil `auto-save-directory' could be on a local disk such as in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
126 /tmp, then auto-saves will always be fast, even if NFS or the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
127 automounter is slow. In the usual case of /tmp being locally mounted,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
128 note that if you run emacs on two different machines, they will not
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
129 see each other's auto-save files.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
130
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
131 The value \(expand-file-name \"~/.autosave/\"\) might be better if /tmp
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
132 is mounted from swap (possible in SunOS, type `df /tmp' to find out)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
133 and thus vanishes after a reboot, or if your system is particularly
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
134 thorough when cleaning up /tmp, clearing even non-empty subdirectories.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
135
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
136 It should never be an efs remote filename because that would
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
137 defeat `efs-auto-save-remotely'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
138
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
139 Unless you set `auto-save-hash-p', you shouldn't set this to a
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
140 directory in a filesystem that does not support long filenames, since
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
141 a file named
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
142
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
143 /home/sk/lib/emacs/lisp/auto-save.el
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
144
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
145 will have a longish filename like
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
146
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
147 AUTO-SAVE-DIRECTORY/#\\!home\\!sk\\!lib\\!emacs\\!lisp\\!auto-save.el#
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
148
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
149 as auto save file.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
150
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
151 See also variables `auto-save-directory-fallback',
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
152 `efs-auto-save' and `efs-auto-save-remotely'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
153 :type '(choice (const :tag "Same as file" nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
154 directory)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
155 :group 'auto-save)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
156
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
157
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
158 (defcustom auto-save-hash-p nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
159 "If non-nil, hashed autosave names of length 14 are used.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
160 This is to avoid autosave filenames longer than 14 characters.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
161 The directory used is `auto-save-hash-directory' regardless of
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
162 `auto-save-directory'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
163 Hashing defeats `recover-all-files', you have to recover files
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
164 individually by doing `recover-file'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
165 :type 'boolean
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
166 :group 'auto-save)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
167
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
168 ;;; This defvar is in efs.el now, but doesn't hurt to give it here as
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
169 ;;; well so that loading first auto-save.el does not abort.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
170
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
171 ;; #### Now that `auto-save' is dumped, this is looks obnoxious.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
172 (or (boundp 'efs-auto-save) (defvar efs-auto-save 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
173 (or (boundp 'efs-auto-save-remotely) (defvar efs-auto-save-remotely nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
174
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
175 (defcustom auto-save-offer-delete nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
176 "*If non-nil, `recover-all-files' offers to delete autosave files
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
177 that are out of date or were dismissed for recovering.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
178 Special value 'always deletes those files silently."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
179 :type '(choice (const :tag "on" t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
180 (const :tag "off" nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
181 (const :tag "Delete silently" always))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
182 :group 'auto-save)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
183
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
184 ;;;; end of customization
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
185
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
186
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
187 ;;; Preparations to be done at load time
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
188
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
189 ;; Do not call expand-file-name! This is evaluated at dump time now!
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
190 (defvar auto-save-directory-fallback "~/.autosave/"
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
191 ;; not user-variable-p, see above
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
192 "Directory used for local autosaving of remote files if
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
193 both `auto-save-directory' and `efs-auto-save-remotely' are nil.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
194 Also used if a working directory to be used for autosaving is not writable.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
195 This *must* always be the name of directory that exists or can be
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
196 created by you, never nil.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
197
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
198 (defvar auto-save-hash-directory
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
199 (expand-file-name "hash/" (or auto-save-directory
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
200 auto-save-directory-fallback))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
201 "If non-nil, directory used for hashed autosave filenames.")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
202
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
203 (defun auto-save-checked-directory (dir)
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
204 "Make sure the directory DIR exists and return it expanded if non-nil."
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
205 (when dir
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
206 (setq dir (expand-file-name dir))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
207 ;; Make sure directory exists
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
208 (unless (file-directory-p dir)
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
209 ;; Else we create and chmod 0700 the directory
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
210 (setq dir (directory-file-name dir)) ; some systems need this
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
211 (make-directory dir)
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
212 (set-file-modes dir #o700))
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
213 dir))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
214
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
215 ;; This make no sense at dump time
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
216 ;; (mapc #'auto-save-check-directory
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
217 ; '(auto-save-directory auto-save-directory-fallback))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
218
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
219 ;(and auto-save-hash-p
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
220 ; (auto-save-check-directory 'auto-save-hash-directory))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
221
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
222
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
223 ;;; Computing an autosave name for a file and vice versa
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
224
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
225 ;; #### Now that this file is dumped, we should turn off the routine
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
226 ;; from files.el. But it would make it harder to remove it!
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
227
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
228 (defun make-auto-save-file-name (&optional file-name);; redefines files.el
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
229 ;; auto-save-file-name-p need not be redefined.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
230
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
231 "Return file name to use for auto-saves of current buffer.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
232 Does not consider `auto-save-visited-file-name'; that is checked
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
233 before calling this function.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
234
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
235 Offers to autosave all files in the same `auto-save-directory'. All
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
236 autosave files can then be recovered at once with function
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
237 `recover-all-files'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
238
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
239 Takes care to make autosave files for files accessed through efs
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
240 be local files if variable `efs-auto-save-remotely' is nil.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
241
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
242 Takes care of slashes in buffer names to prevent autosave errors.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
243
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
244 Takes care that autosave files for buffers not visiting any file (such
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
245 as `*mail*') from two simultaneous Emacses don't collide by prepending
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
246 the Emacs pid.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
247
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
248 Uses 14 character autosave names if `auto-save-hash-p' is true.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
249
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
250 Autosaves even if the current directory is not writable, using
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
251 directory `auto-save-directory-fallback'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
252
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
253 You can redefine this for customization (he he :-).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
254 See also function `auto-save-file-name-p'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
255
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
256 ;; We have to be very careful about not signalling an error in this
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
257 ;; function since files.el does not provide for this (e.g. find-file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
258 ;; would fail for each new file).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
259
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
260 (setq file-name (or file-name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
261 buffer-file-truename
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
262 (and buffer-file-name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
263 (expand-file-name buffer-file-name))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
264 (condition-case error-data
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
265 (let (
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
266 ;; So autosavename looks like #%...#, roughly as with the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
267 ;; old make-auto-save-file-name function. The
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
268 ;; make-temp-name inserts the pid of this Emacs: this
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
269 ;; avoids autosaving from two Emacses into the same file.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
270 ;; It cannot be recovered automatically then because in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
271 ;; the next Emacs session (the one after the crash) the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
272 ;; pid will be different, but file-less buffers like
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
273 ;; *mail* must be recovered manually anyway.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
274
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
275 ;; jwz: putting the emacs PID in the auto-save file name is bad
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
276 ;; news, because that defeats auto-save-recovery of *mail*
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
277 ;; buffers -- the (sensible) code in sendmail.el calls
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
278 ;; (make-auto-save-file-name) to determine whether there is
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
279 ;; unsent, auto-saved mail to recover. If that mail came from a
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
280 ;; previous emacs process (far and away the most likely case)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
281 ;; then this can never succeed as the pid differs.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
282 ;;(name-prefix (if file-name nil (make-temp-name "#%")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
283 (name-prefix (if file-name nil "#%"))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
284
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
285 (save-name (or file-name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
286 ;; Prevent autosave errors. Buffername
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
287 ;; (to become non-dir part of filename) will
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
288 ;; be unslashified twice. Don't care.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
289 (auto-save-unslashify-name (buffer-name))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
290 (remote-p (and (stringp file-name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
291 (fboundp 'efs-ftp-path)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
292 (efs-ftp-path file-name))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
293 ;; Return the appropriate auto save file name:
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
294 (expand-file-name;; a buffername needs this, a filename not
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
295 (cond (remote-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
296 (if efs-auto-save-remotely
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
297 (auto-save-name-in-same-directory save-name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
298 ;; We have to use the `fixed-directory' now since the
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
299 ;; `same-directory' would be remote.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
300 ;; It will use the fallback if needed.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
301 (auto-save-name-in-fixed-directory save-name)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
302 ;; Else it is a local file (or a buffer without a file,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
303 ;; hence the name-prefix).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
304 ((or auto-save-directory auto-save-hash-p)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
305 ;; Hashed files always go into the special hash dir,
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
306 ;; never in the same directory, to make recognizing
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
307 ;; reliable.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
308 (auto-save-name-in-fixed-directory save-name name-prefix))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
309 (t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
310 (auto-save-name-in-same-directory save-name name-prefix)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
311
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
312 ;; If any error occurs in the above code, return what the old
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
313 ;; version of this function would have done. It is not ok to
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
314 ;; return nil, e.g., when after-find-file tests
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
315 ;; file-newer-than-file-p, nil would bomb.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
316
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
317 (error (warn "Error caught in `make-auto-save-file-name':\n%s"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
318 (error-message-string error-data))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
319 (if buffer-file-name
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
320 (concat (file-name-directory buffer-file-name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
321 "#"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
322 (file-name-nondirectory buffer-file-name)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
323 "#")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
324 (expand-file-name (concat "#%" (buffer-name) "#"))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
325
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
326 (defun auto-save-original-name (savename)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
327 "Reverse of `make-auto-save-file-name'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
328 Returns nil if SAVENAME was not associated with a file (e.g., it came
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
329 from an autosaved `*mail*' buffer) or does not appear to be an
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
330 autosave file at all.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
331 Hashed files are not understood, see `auto-save-hash-p'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
332 (let ((basename (file-name-nondirectory savename))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
333 (savedir (file-name-directory savename)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
334 (cond ((or (not (auto-save-file-name-p basename))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
335 (string-match "^#%" basename))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
336 nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
337 ;; now we know it looks like #...# thus substring is safe to use
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
338 ((or (equal savedir
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
339 (and auto-save-directory
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
340 (expand-file-name auto-save-directory)))
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
341 ; 2nd arg may be nil
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
342 (equal savedir
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
343 (expand-file-name auto-save-directory-fallback)))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
344 ;; it is of the `-fixed-directory' type
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
345 (auto-save-slashify-name (substring basename 1 -1)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
346 (t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
347 ;; else it is of `-same-directory' type
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
348 (concat savedir (substring basename 1 -1))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
349
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
350 (defun auto-save-name-in-fixed-directory (filename &optional prefix)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
351 ;; Unslashify and enclose the whole FILENAME in `#' to make an auto
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
352 ;; save file in the auto-save-directory, or if that is nil, in
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
353 ;; auto-save-directory-fallback (which must be the name of an
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
354 ;; existing directory). If the results would be too long for 14
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
355 ;; character filenames, and `auto-save-hash-p' is set, hash FILENAME
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
356 ;; into a shorter name.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
357 ;; Optional PREFIX is string to use instead of "#" to prefix name.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
358 (let ((base-name (concat (or prefix "#")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
359 (auto-save-unslashify-name filename)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
360 "#")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
361 (if (and auto-save-hash-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
362 auto-save-hash-directory
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
363 (> (length base-name) 14))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
364 (expand-file-name (auto-save-cyclic-hash-14 filename)
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
365 (auto-save-checked-directory auto-save-hash-directory))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
366 (expand-file-name base-name
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
367 (auto-save-checked-directory
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
368 (or auto-save-directory
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
369 auto-save-directory-fallback))))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
370
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
371 (defun auto-save-name-in-same-directory (filename &optional prefix)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
372 ;; Enclose the non-directory part of FILENAME in `#' to make an auto
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
373 ;; save file in the same directory as FILENAME. But if this
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
374 ;; directory is not writable, use auto-save-directory-fallback.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
375 ;; FILENAME is assumed to be in non-directory form (no trailing slash).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
376 ;; It may be a name without a directory part (pesumably it really
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
377 ;; comes from a buffer name then), the fallback is used then.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
378 ;; Optional PREFIX is string to use instead of "#" to prefix name.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
379 (let ((directory (file-name-directory filename)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
380 (or (null directory)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
381 (file-writable-p directory)
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
382 (setq directory (auto-save-checked-directory
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
383 auto-save-directory-fallback)))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
384 (concat directory ; (concat nil) is ""
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
385 (or prefix "#")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
386 (file-name-nondirectory filename)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
387 "#")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
388
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
389 ;; #### The following two should probably use `replace-in-string'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
390
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
391 (defun auto-save-unslashify-name (s)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
392 ;; "Quote any slashes in string S by replacing them with the two
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
393 ;;characters `\\!'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
394 ;;Also, replace any backslash by double backslash, to make it one-to-one."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
395 (let ((limit 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
396 (while (string-match "[/\\]" s limit)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
397 (setq s (concat (substring s 0 (match-beginning 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
398 (if (string= (substring s
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
399 (match-beginning 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
400 (match-end 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
401 "/")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
402 "\\!"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
403 "\\\\")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
404 (substring s (match-end 0))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
405 (setq limit (1+ (match-end 0)))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
406 s)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
407
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
408 (defun auto-save-slashify-name (s)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
409 ;;"Reverse of `auto-save-unslashify-name'."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
410 (let (pos)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
411 (while (setq pos (string-match "\\\\[\\!]" s pos))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
412 (setq s (concat (substring s 0 pos)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
413 (if (eq ?! (aref s (1+ pos))) "/" "\\")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
414 (substring s (+ pos 2)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
415 pos (1+ pos))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
416 s)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
417
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
418
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
419 ;;; Hashing for autosave names
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
420
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
421 ;;; Hashing function contributed by Andy Norman <ange@hplb.hpl.hp.com>
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
422 ;;; based upon C code from pot@fly.cnuce.cnr.IT (Francesco Potorti`).
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
423
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
424 (defun auto-save-cyclic-hash-14 (s)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
425 ;; "Hash string S into a string of length 14.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
426 ;; A 7-bytes cyclic code for burst correction is calculated on a
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
427 ;; byte-by-byte basis. The polynomial used is D^7 + D^6 + D^3 +1.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
428 ;; The resulting string consists of hexadecimal digits [0-9a-f].
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
429 ;; In particular, it contains no slash, so it can be used as autosave name."
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 209
diff changeset
430 (let ((crc (make-vector 7 ?\0)))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
431 (mapc
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
432 (lambda (new)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
433 (setq new (+ new (aref crc 6)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
434 (aset crc 6 (+ (aref crc 5) new))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
435 (aset crc 5 (aref crc 4))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
436 (aset crc 4 (aref crc 3))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
437 (aset crc 3 (+ (aref crc 2) new))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
438 (aset crc 2 (aref crc 1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
439 (aset crc 1 (aref crc 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
440 (aset crc 0 new))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
441 s)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
442 (format "%02x%02x%02x%02x%02x%02x%02x"
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 209
diff changeset
443 (logand 255 (aref crc 0))
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 209
diff changeset
444 (logand 255 (aref crc 1))
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 209
diff changeset
445 (logand 255 (aref crc 2))
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 209
diff changeset
446 (logand 255 (aref crc 3))
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 209
diff changeset
447 (logand 255 (aref crc 4))
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 209
diff changeset
448 (logand 255 (aref crc 5))
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 209
diff changeset
449 (logand 255 (aref crc 6)))))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
450
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
451 ;; #### It is unclear to me how the following function is useful. It
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
452 ;; should be used in `auto-save-name-in-same-directory', if anywhere.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
453 ;; -hniksic
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
454
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
455 ;; This leaves two characters that could be used to wrap it in `#' or
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
456 ;; make two filenames from it: one for autosaving, and another for a
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
457 ;; file containing the name of the autosaved filed, to make hashing
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
458 ;; reversible.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
459 ;(defun auto-save-cyclic-hash-12 (s)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
460 ; "Outputs the 12-characters ascii hex representation of a 6-bytes
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
461 ;cyclic code for burst correction calculated on STRING on a
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
462 ;byte-by-byte basis. The used polynomial is D^6 + D^5 + D^4 + D^3 +1."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
463 ; (let ((crc (make-string 6 0)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
464 ; (mapc
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
465 ; (lambda (new)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
466 ; (setq new (+ new (aref crc 5)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
467 ; (aset crc 5 (+ (aref crc 4) new))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
468 ; (aset crc 4 (+ (aref crc 3) new))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
469 ; (aset crc 3 (+ (aref crc 2) new))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
470 ; (aset crc 2 (aref crc 1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
471 ; (aset crc 1 (aref crc 0))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
472 ; (aset crc 0 new))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
473 ; s)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
474 ; (format "%02x%02x%02x%02x%02x%02x"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
475 ; (aref crc 0)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
476 ; (aref crc 1)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
477 ; (aref crc 2)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
478 ; (aref crc 3)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
479 ; (aref crc 4)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
480 ; (aref crc 5))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
481
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
482
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
483
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
484 ;;; Recovering files
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
485
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
486 (defun recover-all-files (&optional silent)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
487 "Do recover-file for all autosave files which are current.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
488 Only works if you have a non-nil `auto-save-directory'.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
489
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
490 Optional prefix argument SILENT means to be silent about non-current
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
491 autosave files. This is useful if invoked automatically at Emacs
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
492 startup.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
493
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
494 If `auto-save-offer-delete' is t, this function will offer to delete
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
495 old or rejected autosave files.
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
496
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
497 Hashed files (see `auto-save-hash-p') are not understood, use
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
498 `recover-file' to recover them individually."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
499 (interactive "P")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
500 (let ((savefiles (directory-files auto-save-directory
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
501 t "\\`#" nil t))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
502 afile ; the auto save file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
503 file ; its original file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
504 (total 0) ; # of files offered to recover
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
505 (count 0)) ; # of files actually recovered
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
506 (or (equal (expand-file-name auto-save-directory)
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 278
diff changeset
507 (expand-file-name auto-save-directory-fallback))
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
508 (setq savefiles
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
509 (nconc savefiles
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
510 (directory-files auto-save-directory-fallback
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
511 t "\\`#" nil t))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
512 (while savefiles
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
513 (setq afile (car savefiles)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
514 file (auto-save-original-name afile)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
515 savefiles (cdr savefiles))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
516 (cond ((and file (not (file-newer-than-file-p afile file)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
517 (warn "Autosave file \"%s\" is not current." afile))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
518 (t
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
519 (incf total)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
520 (with-output-to-temp-buffer "*Directory*"
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
521 (apply 'call-process "ls" nil standard-output nil
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
522 "-l" afile (if file (list file))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
523 (if (yes-or-no-p (format "Recover %s from auto save file? "
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
524 (or file "non-file buffer")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
525 (let* ((obuf (current-buffer)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
526 (set-buffer (if file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
527 (find-file-noselect file t)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
528 (generate-new-buffer "*recovered*")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
529 (setq buffer-read-only nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
530 (erase-buffer)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
531 (insert-file-contents afile nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
532 (ignore-errors
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
533 (after-find-file nil))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
534 (setq buffer-auto-save-file-name nil)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
535 (incf count)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
536 (message "\
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
537 Auto-save off in buffer \"%s\" till you do M-x auto-save-mode."
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
538 (buffer-name))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
539 (set-buffer obuf)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
540 (sit-for 1))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
541 ;; If not used for recovering, offer to delete
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
542 ;; autosave file
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
543 (and auto-save-offer-delete
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
544 (or (eq 'always auto-save-offer-delete)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
545 (yes-or-no-p
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
546 (format "Delete autosave file for `%s'? " file)))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
547 (delete-file afile))))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
548 (if (zerop total)
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
549 (or silent (message "Nothing to recover."))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
550 (message "%d/%d file%s recovered." count total (if (= count 1) "" "s"))))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
551 (and (get-buffer "*Directory*")
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
552 (kill-buffer "*Directory*")))
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
553
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents:
diff changeset
554 ;;; auto-save.el ends here