comparison lispref/backups.texi @ 22138:d4ac295a98b3

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Tue, 19 May 1998 03:45:57 +0000
parents 90da2489c498
children 40089afa2b1d
comparison
equal deleted inserted replaced
22137:2b0e6a1e7fb9 22138:d4ac295a98b3
287 @defun make-backup-file-name filename 287 @defun make-backup-file-name filename
288 This function returns a string that is the name to use for a 288 This function returns a string that is the name to use for a
289 non-numbered backup file for file @var{filename}. On Unix, this is just 289 non-numbered backup file for file @var{filename}. On Unix, this is just
290 @var{filename} with a tilde appended. 290 @var{filename} with a tilde appended.
291 291
292 The standard definition of this function is as follows: 292 The standard definition of this function, on most operating systems, is
293 as follows:
293 294
294 @smallexample 295 @smallexample
295 @group 296 @group
296 (defun make-backup-file-name (file) 297 (defun make-backup-file-name (file)
297 "Create the non-numeric backup file name for FILE@enddots{}" 298 "Create the non-numeric backup file name for FILE@enddots{}"
304 to prepend a @samp{.} in addition to appending a tilde: 305 to prepend a @samp{.} in addition to appending a tilde:
305 306
306 @smallexample 307 @smallexample
307 @group 308 @group
308 (defun make-backup-file-name (filename) 309 (defun make-backup-file-name (filename)
309 (concat "." filename "~")) 310 (expand-file-name
311 (concat "." (file-name-nondirectory filename) "~")
312 (file-name-directory filename)))
310 @end group 313 @end group
311 314
312 @group 315 @group
313 (make-backup-file-name "backups.texi") 316 (make-backup-file-name "backups.texi")
314 @result{} ".backups.texi~" 317 @result{} ".backups.texi~"
315 @end group 318 @end group
316 @end smallexample 319 @end smallexample
320
321 Some parts of Emacs, including some Dired commands, assume that backup
322 file names end with @samp{~}. If you do not follow that convention, it
323 will not cause serious problems, but these commands may give
324 less-than-desirable results.
317 @end defun 325 @end defun
318 326
319 @defun find-backup-file-name filename 327 @defun find-backup-file-name filename
320 This function computes the file name for a new backup file for 328 This function computes the file name for a new backup file for
321 @var{filename}. It may also propose certain existing backup files for 329 @var{filename}. It may also propose certain existing backup files for