Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
65864ae0
Commit
65864ae0
authored
Sep 12, 1992
by
Richard M. Stallman
Browse files
*** empty log message ***
parent
e2b40c23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
lisp/files.el
lisp/files.el
+19
-6
No files found.
lisp/files.el
View file @
65864ae0
...
...
@@ -787,11 +787,16 @@ the modes of the new file to agree with the old modes."
(
let
((
attr
(
file-attributes
real-file-name
)))
(
or
(
nth
9
attr
)
(
/=
(
nth
2
attr
)
(
user-uid
))))))
(
copy-file
real-file-name
backupname
t
t
)
; rename-file should delete old backup.
; (condition-case ()
; (delete-file backupname)
; (file-error nil))
(
condition-case
()
(
copy-file
real-file-name
backupname
t
t
)
(
file-error
;; If copying fails because file BACKUPNAME
;; is not writable, delete that file and try again.
(
if
(
and
(
file-exists-p
backupname
)
(
not
(
file-writable-p
backupname
)))
(
delete-file
backupname
))
(
copy-file
real-file-name
backupname
t
t
)))
;; rename-file should delete old backup.
(
rename-file
real-file-name
backupname
t
)
(
setq
setmodes
(
file-modes
backupname
)))
(
file-error
...
...
@@ -799,7 +804,15 @@ the modes of the new file to agree with the old modes."
(
setq
backupname
(
expand-file-name
"~/%backup%~"
))
(
message
"Cannot write backup file; backing up in ~/%%backup%%~"
)
(
sleep-for
1
)
(
copy-file
real-file-name
backupname
t
t
)))
(
condition-case
()
(
copy-file
real-file-name
backupname
t
t
)
(
file-error
;; If copying fails because file BACKUPNAME
;; is not writable, delete that file and try again.
(
if
(
and
(
file-exists-p
backupname
)
(
not
(
file-writable-p
backupname
)))
(
delete-file
backupname
))
(
copy-file
real-file-name
backupname
t
t
)))))
(
setq
buffer-backed-up
t
)
;; Now delete the old versions, if desired.
(
if
delete-old-versions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment