From: Eli Zaretskii Date: Fri, 23 Dec 2005 17:37:50 +0000 (+0000) Subject: (insert, insert_and_inherit, insert_before_markers) X-Git-Tag: emacs-pretest-22.0.90~5103 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bab3eee1568a8899b8a42b5350b3e9e66e88a824;p=emacs.git (insert, insert_and_inherit, insert_before_markers) (insert_before_markers_and_inherit): Make sure FROM is correct when `after-change-functions' are called. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5e5fa3d62c4..69bc634be06 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-12-23 Martin Rudalics (tiny change) + + * insdel.c (insert, insert_and_inherit, insert_before_markers) + (insert_before_markers_and_inherit): Make sure FROM is correct + when `after-change-functions' are called. + 2005-12-23 Jan Dj,Ad(Brv * xfns.c (Fx_uses_old_gtk_dialog): New function. diff --git a/src/insdel.c b/src/insdel.c index fd416037241..a63dce14928 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -749,9 +749,10 @@ insert (string, nbytes) { if (nbytes > 0) { - int opoint = PT; - insert_1 (string, nbytes, 0, 1, 0); - signal_after_change (opoint, 0, PT - opoint); + int len = chars_in_text (string, nbytes), opoint; + insert_1_both (string, len, nbytes, 0, 1, 0); + opoint = PT - len; + signal_after_change (opoint, 0, len); update_compositions (opoint, PT, CHECK_BORDER); } } @@ -765,9 +766,10 @@ insert_and_inherit (string, nbytes) { if (nbytes > 0) { - int opoint = PT; - insert_1 (string, nbytes, 1, 1, 0); - signal_after_change (opoint, 0, PT - opoint); + int len = chars_in_text (string, nbytes), opoint; + insert_1_both (string, len, nbytes, 1, 1, 0); + opoint = PT - len; + signal_after_change (opoint, 0, len); update_compositions (opoint, PT, CHECK_BORDER); } } @@ -813,10 +815,10 @@ insert_before_markers (string, nbytes) { if (nbytes > 0) { - int opoint = PT; - - insert_1 (string, nbytes, 0, 1, 1); - signal_after_change (opoint, 0, PT - opoint); + int len = chars_in_text (string, nbytes), opoint; + insert_1_both (string, len, nbytes, 0, 1, 1); + opoint = PT - len; + signal_after_change (opoint, 0, len); update_compositions (opoint, PT, CHECK_BORDER); } } @@ -830,10 +832,10 @@ insert_before_markers_and_inherit (string, nbytes) { if (nbytes > 0) { - int opoint = PT; - - insert_1 (string, nbytes, 1, 1, 1); - signal_after_change (opoint, 0, PT - opoint); + int len = chars_in_text (string, nbytes), opoint; + insert_1_both (string, len, nbytes, 1, 1, 1); + opoint = PT - len; + signal_after_change (opoint, 0, len); update_compositions (opoint, PT, CHECK_BORDER); } }