comparison lisp/auto-save.el @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents a300bb07d72d
children 697ef44129c6
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
77 77
78 78
79 ;;; Acknowledgement: 79 ;;; Acknowledgement:
80 80
81 ;; This code is loosely derived from autosave-in-tmp.el by Jamie 81 ;; This code is loosely derived from autosave-in-tmp.el by Jamie
82 ;; Zawinski <jwz@netscape.com> (the version I had was last modified 22 82 ;; Zawinski <jwz@jwz.org> (the version I had was last modified 22
83 ;; dec 90 jwz) and code submitted to ange-ftp-lovers on Sun, 5 Apr 83 ;; dec 90 jwz) and code submitted to ange-ftp-lovers on Sun, 5 Apr
84 ;; 92 23:20:47 EDT by drw@BOURBAKI.MIT.EDU (Dale R. Worley). 84 ;; 92 23:20:47 EDT by drw@BOURBAKI.MIT.EDU (Dale R. Worley).
85 ;; auto-save.el tries to cover the functionality of those two 85 ;; auto-save.el tries to cover the functionality of those two
86 ;; packages. 86 ;; packages.
87 87
371 (defun auto-save-name-in-same-directory (filename &optional prefix) 371 (defun auto-save-name-in-same-directory (filename &optional prefix)
372 ;; Enclose the non-directory part of FILENAME in `#' to make an auto 372 ;; Enclose the non-directory part of FILENAME in `#' to make an auto
373 ;; save file in the same directory as FILENAME. But if this 373 ;; save file in the same directory as FILENAME. But if this
374 ;; directory is not writable, use auto-save-directory-fallback. 374 ;; directory is not writable, use auto-save-directory-fallback.
375 ;; FILENAME is assumed to be in non-directory form (no trailing slash). 375 ;; FILENAME is assumed to be in non-directory form (no trailing slash).
376 ;; It may be a name without a directory part (pesumably it really 376 ;; It may be a name without a directory part (presumably it really
377 ;; comes from a buffer name then), the fallback is used then. 377 ;; comes from a buffer name then), the fallback is used then.
378 ;; Optional PREFIX is string to use instead of "#" to prefix name. 378 ;; Optional PREFIX is string to use instead of "#" to prefix name.
379 (let ((directory (file-name-directory filename))) 379 (let ((directory (file-name-directory filename)))
380 (or (null directory) 380 (or (null directory)
381 (file-writable-p directory) 381 (file-writable-p directory)