(require 'compile)
+;;; This is duplicated in vc.el.
(defvar diff-switches "-c"
"*A string or list of strings specifying switches to be be passed to diff.")
(match-beginning subexpr)
(match-end subexpr)))))
(save-excursion
- (set-buffer (find-file-noselect file))
+ (save-match-data
+ (set-buffer (find-file-noselect file)))
(save-excursion
(goto-line line)
(point-marker)))))
(let ((command
(mapconcat 'identity
(append '("diff")
- (if (consp diff-switches)
- diff-switches
- (list diff-switches))
+ ;; Use explicitly specified switches
+ (if switches
+ (if (consp switches)
+ switches (list switches))
+ ;; If not specified, use default.
+ (if (consp diff-switches)
+ diff-switches
+ (list diff-switches)))
(if (or old-alt new-alt)
(list "-L" old "-L" new))
(list (or old-alt old))