summaryrefslogtreecommitdiff
path: root/lisp/diff.el
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1994-03-02 10:27:36 +0000
committerRoland McGrath <roland@gnu.org>1994-03-02 10:27:36 +0000
commitd26d2a5327b88be966517d68efee7a59735415a8 (patch)
tree60b2000f478f225bd4ceedf729e7b3ad6b72a031 /lisp/diff.el
parent6d4906263a681d968be1469799374494dddd82ef (diff)
downloademacs-d26d2a5327b88be966517d68efee7a59735415a8.tar.gz
(diff-latest-backup-file): Check for a file-name-handler and run it.
Diffstat (limited to 'lisp/diff.el')
-rw-r--r--lisp/diff.el45
1 files changed, 24 insertions, 21 deletions
diff --git a/lisp/diff.el b/lisp/diff.el
index 3f35c1167b2..a6793dca51f 100644
--- a/lisp/diff.el
+++ b/lisp/diff.el
@@ -1,6 +1,6 @@
;;; diff.el --- Run `diff' in compilation-mode.
-;; Copyright (C) 1992 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1994 Free Software Foundation, Inc.
;; Keywords: unix, tools
@@ -254,26 +254,29 @@ The backup file is the first file given to `diff'."
(defun diff-latest-backup-file (fn) ; actually belongs into files.el
"Return the latest existing backup of FILE, or nil."
- ;; First try simple backup, then the highest numbered of the
- ;; numbered backups.
- ;; Ignore the value of version-control because we look for existing
- ;; backups, which maybe were made earlier or by another user with
- ;; a different value of version-control.
- (setq fn (file-chase-links (expand-file-name fn)))
- (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) ".~"))
- (bv-length (length base-versions)))
- (concat dir
- (car (sort
- (file-name-all-completions base-versions dir)
- ;; bv-length is a fluid var for backup-extract-version:
- (function
- (lambda (fn1 fn2)
- (> (backup-extract-version fn1)
- (backup-extract-version fn2))))))))))
+ (let ((handler (find-file-name-handler fn)))
+ (if handler
+ (funcall handler fn)
+ ;; First try simple backup, then the highest numbered of the
+ ;; numbered backups.
+ ;; Ignore the value of version-control because we look for existing
+ ;; backups, which maybe were made earlier or by another user with
+ ;; a different value of version-control.
+ (setq fn (file-chase-links (expand-file-name fn)))
+ (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) ".~"))
+ (bv-length (length base-versions)))
+ (concat dir
+ (car (sort
+ (file-name-all-completions base-versions dir)
+ ;; bv-length is a fluid var for backup-extract-version:
+ (function
+ (lambda (fn1 fn2)
+ (> (backup-extract-version fn1)
+ (backup-extract-version fn2))))))))))))
(provide 'diff)