Commit 294c6f5f authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(lyskom-create-text-buffer): New helper function.

(kom-compare-texts): Use blocking-do-multiple for efficiency and
	lyskom-create-text-buffer to simplify the code.
parent 29703deb
2002-02-18 Per Cederqvist <ceder@moria>
* commands2.el (lyskom-create-text-buffer): New helper function.
(kom-compare-texts): Use blocking-do-multiple for efficiency and
lyskom-create-text-buffer to simplify the code.
2002-02-09 Per Cederqvist <ceder@lysator.liu.se>
New command: "Compare two texts".
......
......@@ -2551,6 +2551,15 @@ configurable variable `kom-review-marks-texts-as-read' in the current buffer."
;;; Author: Per Cederqvist
(defun lyskom-create-text-buffer (text-no text text-stat)
"Create and return a buffer containing TEXT."
(let ((buf (generate-new-buffer (format "%d" text-no))))
(set-buffer buf)
(insert (text->decoded-text-mass text text-stat))
(set-buffer-modified-p nil)
buf))
(def-kom-command kom-compare-texts (old new)
"Show differences between text OLD and NEW.
When called interactively, it will prompt for the NEW text first,
......@@ -2565,16 +2574,10 @@ to the first text that NEW is a comment or footnote to."
(lyskom-error (lyskom-get-string 'no-such-text-no n))
(car (lyskom-text-stat-commented-texts new-stat))))))
(list o n)))
(let* ((old-text (blocking-do 'get-text old))
(old-text-stat (blocking-do 'get-text-stat old))
(new-text (blocking-do 'get-text new))
(new-text-stat (blocking-do 'get-text-stat new))
(old-buf (generate-new-buffer (format "%d" old)))
(new-buf (generate-new-buffer (format "%d" new))))
(set-buffer old-buf)
(insert (text->decoded-text-mass old-text old-text-stat))
(set-buffer-modified-p nil)
(set-buffer new-buf)
(insert (text->decoded-text-mass new-text new-text-stat))
(set-buffer-modified-p nil)
(ediff-buffers old-buf new-buf)))
(blocking-do-multiple ((old-text (get-text old))
(new-text (get-text new))
(old-text-stat (get-text-stat old))
(new-text-stat (get-text-stat new)))
(ediff-buffers
(lyskom-create-text-buffer old old-text old-text-stat)
(lyskom-create-text-buffer new new-text new-text-stat))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment