(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.")
(message "Parsing differences...")
;; Don't reparse diffs already seen at last parse.
- (goto-char compilation-parsing-end)
+ (if compilation-parsing-end (goto-char compilation-parsing-end))
;; Construct in REGEXP a regexp composed of all those in dired-regexp-alist.
(let ((regexp (mapconcat (lambda (elt)
(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))
(> (backup-extract-version fn1)
(backup-extract-version fn2))))))))))
+(provide 'diff)
+
;;; diff.el ends here