diff options
Diffstat (limited to 'lisp/vc/diff.el')
| -rw-r--r-- | lisp/vc/diff.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el index e79e72c8b0d..1a835b59994 100644 --- a/lisp/vc/diff.el +++ b/lisp/vc/diff.el | |||
| @@ -108,11 +108,16 @@ specified in `diff-switches' are passed to the diff command." | |||
| 108 | (read-file-name "Diff original file: " | 108 | (read-file-name "Diff original file: " |
| 109 | (file-name-directory newf) nil t))) | 109 | (file-name-directory newf) nil t))) |
| 110 | (list oldf newf (diff-switches)))) | 110 | (list oldf newf (diff-switches)))) |
| 111 | (diff-into-buffer nil old new switches no-async)) | ||
| 112 | |||
| 113 | (defun diff-into-buffer (buf old new &optional switches no-async) | ||
| 114 | ;; Noninteractive helper for creating and reverting diff buffers. | ||
| 111 | (setq new (expand-file-name new) | 115 | (setq new (expand-file-name new) |
| 112 | old (expand-file-name old)) | 116 | old (expand-file-name old)) |
| 113 | (or switches (setq switches diff-switches)) ; If not specified, use default. | 117 | (or switches (setq switches diff-switches)) ; If not specified, use default. |
| 118 | (or buf (setq buf (get-buffer-create "*Diff*"))) | ||
| 114 | (let* ((old-alt (file-local-copy old)) | 119 | (let* ((old-alt (file-local-copy old)) |
| 115 | (new-alt (file-local-copy new)) | 120 | (new-alt (file-local-copy new)) |
| 116 | (command | 121 | (command |
| 117 | (mapconcat 'identity | 122 | (mapconcat 'identity |
| 118 | `(,diff-command | 123 | `(,diff-command |
| @@ -123,7 +128,6 @@ specified in `diff-switches' are passed to the diff command." | |||
| 123 | ,(shell-quote-argument (or old-alt old)) | 128 | ,(shell-quote-argument (or old-alt old)) |
| 124 | ,(shell-quote-argument (or new-alt new))) | 129 | ,(shell-quote-argument (or new-alt new))) |
| 125 | " ")) | 130 | " ")) |
| 126 | (buf (get-buffer-create "*Diff*")) | ||
| 127 | (thisdir default-directory) | 131 | (thisdir default-directory) |
| 128 | proc) | 132 | proc) |
| 129 | (save-excursion | 133 | (save-excursion |