branch: master
commit 58d530bc30293663761067f17c61660280bfe1ef
Author: Justin Burkett <[email protected]>
Commit: Justin Burkett <[email protected]>
Add vdiff-temp-files
Fixes #26
---
vdiff.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/vdiff.el b/vdiff.el
index 29c02a4..eff7363 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -1930,6 +1930,18 @@ arguments."
(find-file-noselect file-b)
rotate on-quit))
+(defun vdiff-temp-files ()
+ "Start a vidff session for two new temp files.
+
+This might be useful if you want to paste compare text pasted
+from another source."
+ (interactive)
+ (let ((file-a (make-temp-file "vdiff-"))
+ (file-b (make-temp-file "vdiff-")))
+ (write-region "\n" nil file-a)
+ (write-region "\n" nil file-b)
+ (vdiff-files file-a file-b)))
+
(defcustom vdiff-2way-layout-function 'vdiff-2way-layout-function-default
"Function to layout windows in 2way diffs.