(defvar diff-switches "-c"
"*A string or list of strings specifying switches to be be passed to diff.")
+(defvar diff-command "diff"
+ "*The command to use to run diff.")
+
(defvar diff-regexp-alist
'(
;; -u format: @@ -OLDSTART,OLDEND +NEWSTART,NEWEND @@
(unwind-protect
(let ((command
(mapconcat 'identity
- (append '("diff")
+ (append (list diff-command)
;; Use explicitly specified switches
(if switches
(if (consp switches)
(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