summaryrefslogtreecommitdiff
path: root/lisp/vc/diff.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-11-25 16:59:30 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2010-11-25 16:59:30 -0500
commit5a973d51646a208d88d7dd882e32077b9d08298a (patch)
tree55531a0446081f4811e32780b662487573d83676 /lisp/vc/diff.el
parent123652403c2d233dd1cdbfc1d59c8889d86873c3 (diff)
downloademacs-5a973d51646a208d88d7dd882e32077b9d08298a.tar.gz
* diff.el (diff): Fix it for good, hopefully, this time.
Diffstat (limited to 'lisp/vc/diff.el')
-rw-r--r--lisp/vc/diff.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el
index 13c23eea734..5809eee9aef 100644
--- a/lisp/vc/diff.el
+++ b/lisp/vc/diff.el
@@ -84,14 +84,13 @@ When called interactively with a prefix argument, prompt
interactively for diff switches. Otherwise, the switches
specified in `diff-switches' are passed to the diff command."
(interactive
- (let* ((newf (buffer-file-name))
- (oldf (file-newest-backup newf)))
- (setq newf (if (and newf (file-exists-p newf))
+ (let* ((newf (if (and buffer-file-name (file-exists-p buffer-file-name))
(read-file-name
(concat "Diff new file (default "
- (file-name-nondirectory newf) "): ")
- nil newf t)
+ (file-name-nondirectory buffer-file-name) "): ")
+ nil buffer-file-name t)
(read-file-name "Diff new file: " nil nil t)))
+ (oldf (file-newest-backup newf)))
(setq oldf (if (and oldf (file-exists-p oldf))
(read-file-name
(concat "Diff original file (default "