# HG changeset patch # User Roland McGrath # Date 762604056 0 # Node ID f89879182407613abb4e80cd564ffd4eb87c13b0 # Parent 1a2a8ef9b4af5b36dc1d20cab546fad05ce5753c (diff-latest-backup-file): Check for a file-name-handler and run it. diff -r 1a2a8ef9b4af -r f89879182407 lisp/diff.el --- a/lisp/diff.el Wed Mar 02 07:57:04 1994 +0000 +++ b/lisp/diff.el Wed Mar 02 10:27:36 1994 +0000 @@ -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 @@ (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)