summaryrefslogtreecommitdiff
path: root/lisp/diff.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-07-11 04:31:40 +0000
committerRichard M. Stallman <rms@gnu.org>1994-07-11 04:31:40 +0000
commitcf2d98df973411a8d18190e0cb7fc9c180d3e22e (patch)
tree8c1fb76c2abe995de8b3408458ca4f7745817061 /lisp/diff.el
parent3ec5651bc0d3f92927b1ecf58707d0d0b1e7fe28 (diff)
downloademacs-cf2d98df973411a8d18190e0cb7fc9c180d3e22e.tar.gz
(diff-latest-backup-file): Cope with backups stored
in a different directory.
Diffstat (limited to 'lisp/diff.el')
-rw-r--r--lisp/diff.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/diff.el b/lisp/diff.el
index 891fb970449..ff7906a80c4 100644
--- a/lisp/diff.el
+++ b/lisp/diff.el
@@ -266,8 +266,12 @@ The backup file is the first file given to `diff'."
(or
(let ((bak (make-backup-file-name fn)))
(if (file-exists-p bak) bak))
- (let* ((dir (file-name-directory fn))
- (base-versions (concat (file-name-nondirectory fn) ".~"))
+ ;; We use BACKUPNAME to cope with backups stored in a different dir.
+ (let* ((backupname (car (find-backup-file-name fn)))
+ (dir (file-name-directory backupname))
+ (base-versions (concat (file-name-sans-versions
+ (file-name-nondirectory backupname))
+ ".~"))
(bv-length (length base-versions)))
(concat dir
(car (sort