Mercurial > hg > xemacs-beta
comparison lisp/packages/auto-save.el @ 120:cca96a509cfe r20-1b12
Import from CVS: tag r20-1b12
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:25:29 +0200 |
parents | 4be1180a9e89 |
children | 34a5b81f86ba |
comparison
equal
deleted
inserted
replaced
119:d101af7320b8 | 120:cca96a509cfe |
---|---|
1 ;; -*- Emacs-Lisp -*- | 1 ;; -*- Emacs-Lisp -*- |
2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3 ;; | 3 ;; |
4 ;; File: auto-save.el | 4 ;; File: auto-save.el |
5 ;; Version: $Revision: 1.2 $ | 5 ;; Version: $Revision: 1.3 $ |
6 ;; RCS: | 6 ;; RCS: |
7 ;; Description: Safer autosaving with support for efs and /tmp. | 7 ;; Description: Safer autosaving with support for efs and /tmp. |
8 ;; This version of auto-save is designed to work with efs, | 8 ;; This version of auto-save is designed to work with efs, |
9 ;; instead of ange-ftp. | 9 ;; instead of ange-ftp. |
10 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>, | 10 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>, |
11 ;; | 11 ;; |
12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
13 | 13 |
14 (defconst auto-save-version (substring "$Revision: 1.2 $" 11 -2) | 14 (defconst auto-save-version (substring "$Revision: 1.3 $" 11 -2) |
15 "Version number of auto-save.") | 15 "Version number of auto-save.") |
16 | 16 |
17 ;;; Copyright (C) 1992 by Sebastian Kremer <sk@thp.uni-koeln.de> | 17 ;;; Copyright (C) 1992 by Sebastian Kremer <sk@thp.uni-koeln.de> |
18 | 18 |
19 ;;; This program is free software; you can redistribute it and/or modify | 19 ;;; This program is free software; you can redistribute it and/or modify |
97 | 97 |
98 (provide 'auto-save) | 98 (provide 'auto-save) |
99 | 99 |
100 ;;;; CUSTOMIZATION ===================================================== | 100 ;;;; CUSTOMIZATION ===================================================== |
101 | 101 |
102 (defvar auto-save-directory nil | 102 (defgroup auto-save nil |
103 "Autosaving with support for efs and /tmp" | |
104 :group 'data) | |
105 | |
106 (put 'auto-save-interval 'custom-type 'integer) | |
107 (put 'auto-save-interval 'factory-value '(300)) | |
108 (custom-add-to-group 'auto-save 'auto-save-interval 'custom-variable) | |
109 | |
110 (defcustom auto-save-directory nil | |
103 | 111 |
104 ;;; Don't make this user-variable-p, it should be set in .emacs and | 112 ;;; Don't make this user-variable-p, it should be set in .emacs and |
105 ;;; left at that. In particular, it should remain constant across | 113 ;;; left at that. In particular, it should remain constant across |
106 ;;; several Emacs session to make recover-all-files work. | 114 ;;; several Emacs session to make recover-all-files work. |
107 | 115 |
138 AUTO-SAVE-DIRECTORY/#\\!home\\!sk\\!lib\\!emacs\\!lisp\\!auto-save.el# | 146 AUTO-SAVE-DIRECTORY/#\\!home\\!sk\\!lib\\!emacs\\!lisp\\!auto-save.el# |
139 | 147 |
140 as auto save file. | 148 as auto save file. |
141 | 149 |
142 See also variables `auto-save-directory-fallback', | 150 See also variables `auto-save-directory-fallback', |
143 `efs-auto-save' and `efs-auto-save-remotely'.") | 151 `efs-auto-save' and `efs-auto-save-remotely'." |
144 | 152 :type '(choice (const :tag "same as file" nil) |
145 (defvar auto-save-hash-p nil | 153 directory) |
154 :group 'auto-save) | |
155 | |
156 | |
157 (defcustom auto-save-hash-p nil | |
146 "If non-nil, hashed autosave names of length 14 are used. | 158 "If non-nil, hashed autosave names of length 14 are used. |
147 This is to avoid autosave filenames longer than 14 characters. | 159 This is to avoid autosave filenames longer than 14 characters. |
148 The directory used is `auto-save-hash-directory' regardless of | 160 The directory used is `auto-save-hash-directory' regardless of |
149 `auto-save-directory'. | 161 `auto-save-directory'. |
150 Hashing defeats `recover-all-files', you have to recover files | 162 Hashing defeats `recover-all-files', you have to recover files |
151 individually by doing `recover-file'.") | 163 individually by doing `recover-file'." |
164 :type 'boolean | |
165 :group 'auto-save) | |
152 | 166 |
153 ;;; This defvar is in efs.el now, but doesn't hurt to give it here as | 167 ;;; This defvar is in efs.el now, but doesn't hurt to give it here as |
154 ;;; well so that loading first auto-save.el does not abort. | 168 ;;; well so that loading first auto-save.el does not abort. |
155 (or (boundp 'efs-auto-save) (defvar efs-auto-save 0)) | 169 (or (boundp 'efs-auto-save) (defvar efs-auto-save 0)) |
156 (or (boundp 'efs-auto-save-remotely) (defvar efs-auto-save-remotely nil)) | 170 (or (boundp 'efs-auto-save-remotely) (defvar efs-auto-save-remotely nil)) |
157 | 171 |
158 (defvar auto-save-offer-delete nil | 172 (defcustom auto-save-offer-delete nil |
159 "*If non-nil, `recover-all-files' offers to delete autosave files | 173 "*If non-nil, `recover-all-files' offers to delete autosave files |
160 that are out of date or were dismissed for recovering. | 174 that are out of date or were dismissed for recovering. |
161 Special value 'always deletes those files silently.") | 175 Special value 'always deletes those files silently." |
176 :type '(choice (const :tag "on" t) | |
177 (const :tag "off" nil) | |
178 (const :tag "delete silently" always)) | |
179 :group 'auto-save) | |
162 | 180 |
163 ;;;; end of customization | 181 ;;;; end of customization |
164 | 182 |
165 | 183 |
166 ;;; Preparations to be done at load time | 184 ;;; Preparations to be done at load time |