summaryrefslogtreecommitdiff
path: root/lisp/vc/diff.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/diff.el')
-rw-r--r--lisp/vc/diff.el29
1 files changed, 14 insertions, 15 deletions
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el
index fd24558da6a..b1c334ddcfc 100644
--- a/lisp/vc/diff.el
+++ b/lisp/vc/diff.el
@@ -1,6 +1,6 @@
-;;; diff.el --- run `diff'
+;;; diff.el --- run `diff' -*- lexical-binding: t -*-
-;; Copyright (C) 1992, 1994, 1996, 2001-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1994, 1996, 2001-2012 Free Software Foundation, Inc.
;; Author: Frank Bresz
;; (according to authors.el)
@@ -30,7 +30,7 @@
;;; Code:
-(eval-when-compile (require 'cl))
+(declare-function diff-setup-whitespace "diff-mode" ())
(defgroup diff nil
"Comparing files with `diff'."
@@ -64,6 +64,8 @@ If optional args OLD-TEMP-FILE and/or NEW-TEMP-FILE are non-nil,
delete the temporary files so named."
(if old-temp-file (delete-file old-temp-file))
(if new-temp-file (delete-file new-temp-file))
+ (diff-setup-whitespace)
+ (goto-char (point-min))
(save-excursion
(goto-char (point-max))
(let ((inhibit-read-only t))
@@ -144,11 +146,8 @@ specified in `diff-switches' are passed to the diff command."
(buffer-enable-undo (current-buffer))
(diff-mode)
(set (make-local-variable 'revert-buffer-function)
- (lexical-let ((old old) (new new)
- (switches switches)
- (no-async no-async))
- (lambda (ignore-auto noconfirm)
- (diff-no-select old new switches no-async (current-buffer)))))
+ (lambda (_ignore-auto _noconfirm)
+ (diff-no-select old new switches no-async (current-buffer))))
(setq default-directory thisdir)
(let ((inhibit-read-only t))
(insert command "\n"))
@@ -156,12 +155,11 @@ specified in `diff-switches' are passed to the diff command."
(let ((proc (start-process "Diff" buf shell-file-name
shell-command-switch command)))
(set-process-filter proc 'diff-process-filter)
- (lexical-let ((old-alt old-alt) (new-alt new-alt))
- (set-process-sentinel
- proc (lambda (proc msg)
- (with-current-buffer (process-buffer proc)
- (diff-sentinel (process-exit-status proc)
- old-alt new-alt))))))
+ (set-process-sentinel
+ proc (lambda (proc _msg)
+ (with-current-buffer (process-buffer proc)
+ (diff-sentinel (process-exit-status proc)
+ old-alt new-alt)))))
;; Async processes aren't available.
(let ((inhibit-read-only t))
(diff-sentinel
@@ -199,7 +197,8 @@ With prefix arg, prompt for diff switches."
ori file))
(diff bak ori switches)))
-(defun diff-latest-backup-file (fn) ; actually belongs into files.el
+;;;###autoload
+(defun diff-latest-backup-file (fn)
"Return the latest existing backup of FILE, or nil."
(let ((handler (find-file-name-handler fn 'diff-latest-backup-file)))
(if handler