From d47f896da835d07a6e99867adf811aae71505371 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 11 Feb 2002 13:50:48 +0000 Subject: [PATCH] Don't call ediff when there is nothing to diff. --- misc/ChangeLog | 5 +++++ misc/po-mode.el | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index 98ad55572..757161210 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,8 @@ +2002-02-11 Karl Eichwalder + + * po-mode.el (po-subedit-ediff): When variants are equal don't call + 'po-ediff-buffers-exit-recursive'. + 2002-02-09 Karl Eichwalder * po-mode.el (po-send-mail): Set coding-system-for-read and diff --git a/misc/po-mode.el b/misc/po-mode.el index c48f139ff..c932318d9 100644 --- a/misc/po-mode.el +++ b/misc/po-mode.el @@ -2093,8 +2093,10 @@ For more info cf. `po-subedit-ediff'." (defun po-subedit-ediff () "Edit the subedit buffer using `ediff'. `po-subedit-ediff' calls `po-ediff-buffers-exit-recursive' to edit translation -variants side by side. `msgcat' is able to produce those variants; every -variant is marked with: +variants side by side if they are actually different; if variants are equal just +delete the first one. + +`msgcat' is able to produce those variants; every variant is marked with: #-#-#-#-# file name reference #-#-#-#-# @@ -2139,7 +2141,12 @@ When done with the `ediff' session press \\[exit-recursive-edit] exit to (erase-buffer) (insert-buffer-substring oldbuf start-2 end-2)) - (po-ediff-buffers-exit-recursive buf1 buf2 oldbuf end-2))))) + (if (not (string-equal (buffer-substring-no-properties start-1 end-1) + (buffer-substring-no-properties start-2 end-2))) + (po-ediff-buffers-exit-recursive buf1 buf2 oldbuf end-2) + (message "Variants are equal; delete %s" buf1) + (forward-line -1) + (delete-region (point-min) (point))))))) (defun po-subedit-abort () "Exit the subedit buffer, merely discarding its contents." -- 2.47.2