Commit bab3eee1 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(insert, insert_and_inherit, insert_before_markers)

(insert_before_markers_and_inherit): Make sure FROM is correct when
`after-change-functions' are called.
parent 1fafa158
2005-12-23 Martin Rudalics <rudalics@gmx.at> (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 <jan.h.d@swipnet.se> 2005-12-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
   
* xfns.c (Fx_uses_old_gtk_dialog): New function. * xfns.c (Fx_uses_old_gtk_dialog): New function.
......
...@@ -749,9 +749,10 @@ insert (string, nbytes) ...@@ -749,9 +749,10 @@ insert (string, nbytes)
{ {
if (nbytes > 0) if (nbytes > 0)
{ {
int opoint = PT; int len = chars_in_text (string, nbytes), opoint;
insert_1 (string, nbytes, 0, 1, 0); insert_1_both (string, len, nbytes, 0, 1, 0);
signal_after_change (opoint, 0, PT - opoint); opoint = PT - len;
signal_after_change (opoint, 0, len);
update_compositions (opoint, PT, CHECK_BORDER); update_compositions (opoint, PT, CHECK_BORDER);
} }
} }
...@@ -765,9 +766,10 @@ insert_and_inherit (string, nbytes) ...@@ -765,9 +766,10 @@ insert_and_inherit (string, nbytes)
{ {
if (nbytes > 0) if (nbytes > 0)
{ {
int opoint = PT; int len = chars_in_text (string, nbytes), opoint;
insert_1 (string, nbytes, 1, 1, 0); insert_1_both (string, len, nbytes, 1, 1, 0);
signal_after_change (opoint, 0, PT - opoint); opoint = PT - len;
signal_after_change (opoint, 0, len);
update_compositions (opoint, PT, CHECK_BORDER); update_compositions (opoint, PT, CHECK_BORDER);
} }
} }
...@@ -813,10 +815,10 @@ insert_before_markers (string, nbytes) ...@@ -813,10 +815,10 @@ insert_before_markers (string, nbytes)
{ {
if (nbytes > 0) if (nbytes > 0)
{ {
int opoint = PT; int len = chars_in_text (string, nbytes), opoint;
insert_1_both (string, len, nbytes, 0, 1, 1);
insert_1 (string, nbytes, 0, 1, 1); opoint = PT - len;
signal_after_change (opoint, 0, PT - opoint); signal_after_change (opoint, 0, len);
update_compositions (opoint, PT, CHECK_BORDER); update_compositions (opoint, PT, CHECK_BORDER);
} }
} }
...@@ -830,10 +832,10 @@ insert_before_markers_and_inherit (string, nbytes) ...@@ -830,10 +832,10 @@ insert_before_markers_and_inherit (string, nbytes)
{ {
if (nbytes > 0) if (nbytes > 0)
{ {
int opoint = PT; int len = chars_in_text (string, nbytes), opoint;
insert_1_both (string, len, nbytes, 1, 1, 1);
insert_1 (string, nbytes, 1, 1, 1); opoint = PT - len;
signal_after_change (opoint, 0, PT - opoint); signal_after_change (opoint, 0, len);
update_compositions (opoint, PT, CHECK_BORDER); update_compositions (opoint, PT, CHECK_BORDER);
} }
} }
......
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