aboutsummaryrefslogtreecommitdiffstats
path: root/src/composite.c
diff options
context:
space:
mode:
authorAndreas Schwab2010-04-30 12:00:48 -0400
committerChong Yidong2010-04-30 12:00:48 -0400
commit5dcde606e32d1794f8268ea51cd2d1746e45a311 (patch)
tree2b6048930549ed5862366c766d73a611e4e1669c /src/composite.c
parent9822590ba8018dd651a01081957d6fb60191d38f (diff)
downloademacs-5dcde606e32d1794f8268ea51cd2d1746e45a311.tar.gz
emacs-5dcde606e32d1794f8268ea51cd2d1746e45a311.zip
Fix for Bug#5984.
* composite.c (autocmp_chars): Save point as marker before calling auto-composition-function. * lisp.h (restore_point_unwind): Add prototype. * fileio.c (restore_point_unwind): Remove static attribute.
Diffstat (limited to 'src/composite.c')
-rw-r--r--src/composite.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/composite.c b/src/composite.c
index 632c9f90d12..1295a03e9f6 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -990,6 +990,14 @@ autocmp_chars (cft_element, charpos, bytepos, limit, win, face, string)
990 { 990 {
991 Lisp_Object args[6]; 991 Lisp_Object args[6];
992 992
993 /* Save point as marker before calling out to lisp. */
994 if (NILP (string))
995 {
996 Lisp_Object m = Fmake_marker ();
997 set_marker_both (m, Qnil, pt, pt_byte);
998 record_unwind_protect (restore_point_unwind, m);
999 }
1000
993 args[0] = Vauto_composition_function; 1001 args[0] = Vauto_composition_function;
994 args[1] = AREF (elt, 2); 1002 args[1] = AREF (elt, 2);
995 args[2] = pos; 1003 args[2] = pos;
@@ -998,8 +1006,10 @@ autocmp_chars (cft_element, charpos, bytepos, limit, win, face, string)
998 args[5] = string; 1006 args[5] = string;
999 gstring = safe_call (6, args); 1007 gstring = safe_call (6, args);
1000 } 1008 }
1001 if (NILP (string)) 1009 else if (NILP (string))
1002 TEMP_SET_PT_BOTH (pt, pt_byte); 1010 {
1011 TEMP_SET_PT_BOTH (pt, pt_byte);
1012 }
1003 return unbind_to (count, gstring); 1013 return unbind_to (count, gstring);
1004 } 1014 }
1005 } 1015 }