diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2010-04-30 12:00:48 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-04-30 12:00:48 -0400 |
commit | 5dcde606e32d1794f8268ea51cd2d1746e45a311 (patch) | |
tree | 2b6048930549ed5862366c766d73a611e4e1669c | |
parent | 9822590ba8018dd651a01081957d6fb60191d38f (diff) | |
download | emacs-5dcde606e32d1794f8268ea51cd2d1746e45a311.tar.gz |
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.
-rw-r--r-- | src/ChangeLog | 9 | ||||
-rw-r--r-- | src/composite.c | 14 | ||||
-rw-r--r-- | src/fileio.c | 2 | ||||
-rw-r--r-- | src/lisp.h | 1 |
4 files changed, 23 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d061857bc3a..29506bee67e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2010-04-30 Andreas Schwab <schwab@linux-m68k.org> + + * composite.c (autocmp_chars): Save point as marker before calling + auto-composition-function (Bug#5984). + + * lisp.h (restore_point_unwind): Add prototype. + + * fileio.c (restore_point_unwind): Remove static attribute. + 2010-04-23 Kenichi Handa <handa@m17n.org> * ftfont.c (M17N_FLT_USE_NEW_FEATURE): Define it if we can use the 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) { Lisp_Object args[6]; + /* Save point as marker before calling out to lisp. */ + if (NILP (string)) + { + Lisp_Object m = Fmake_marker (); + set_marker_both (m, Qnil, pt, pt_byte); + record_unwind_protect (restore_point_unwind, m); + } + args[0] = Vauto_composition_function; args[1] = AREF (elt, 2); args[2] = pos; @@ -998,8 +1006,10 @@ autocmp_chars (cft_element, charpos, bytepos, limit, win, face, string) args[5] = string; gstring = safe_call (6, args); } - if (NILP (string)) - TEMP_SET_PT_BOTH (pt, pt_byte); + else if (NILP (string)) + { + TEMP_SET_PT_BOTH (pt, pt_byte); + } return unbind_to (count, gstring); } } diff --git a/src/fileio.c b/src/fileio.c index a80ba11bcab..440a726b26b 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -302,7 +302,7 @@ close_file_unwind (fd) /* Restore point, having saved it as a marker. */ -static Lisp_Object +Lisp_Object restore_point_unwind (location) Lisp_Object location; { diff --git a/src/lisp.h b/src/lisp.h index 7f5d5df66c6..6cbf35c7880 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3018,6 +3018,7 @@ EXFUN (Ffile_readable_p, 1); EXFUN (Ffile_executable_p, 1); EXFUN (Fread_file_name, 6); extern Lisp_Object close_file_unwind P_ ((Lisp_Object)); +extern Lisp_Object restore_point_unwind P_ ((Lisp_Object)); extern void report_file_error P_ ((const char *, Lisp_Object)) NO_RETURN; extern int internal_delete_file P_ ((Lisp_Object)); extern void syms_of_fileio P_ ((void)); |