2 "Check a difference in fuzzy contents."
4 (let (begin end prevfile newfile diffbuf)
6 (re-search-backward "^$" nil t)
8 (re-search-forward "^msgstr " nil t)
12 (if (not (and (re-search-forward "^#| msgid " nil t)
14 (error "Valid fuzzy section not found."))
17 ;; cut text from the original buffer
18 (kill-ring-save begin end)
22 (goto-char (point-min))
23 (re-search-forward "^msgid " nil t)
24 (move-beginning-of-line nil)
25 (kill-region (point) (point-max))
27 (goto-char (point-min))
28 (replace-regexp "^#| " "" nil (point-min) (point-max))
29 (replace-regexp "^msgid " "" nil (point-min) (point-max))
30 (replace-regexp "^\"" "" nil (point-min) (point-max))
31 (replace-regexp "\"$" "" nil (point-min) (point-max))
33 (setq prevfile (make-temp-file "podiff"))
34 (write-region (point-min) (point-max) prevfile))
38 (goto-char (point-min))
39 (replace-regexp "^msgid " "" nil (point-min) (point-max))
40 (replace-regexp "^\"" "" nil (point-min) (point-max))
41 (replace-regexp "\"$" "" nil (point-min) (point-max))
43 (setq newfile (make-temp-file "podiff"))
44 (write-region (point-min) (point-max) newfile))
46 (setq diffbuf (diff prevfile newfile "-c" 'no-async))
49 (set-buffer-modified-p nil)
50 (pop-to-buffer diffbuf)
53 (delete-file prevfile)
54 (delete-file newfile))))