diff options
| author | Eli Zaretskii <eliz@gnu.org> | 2013-11-16 12:23:09 +0200 |
|---|---|---|
| committer | Eli Zaretskii <eliz@gnu.org> | 2013-11-16 12:23:09 +0200 |
| commit | d17f4dba9c497179ace6c1076fbd636c1c9a86c4 (patch) | |
| tree | 6c49da5948d6f61b17b1bf515880bb2812f53a76 /src | |
| parent | 3d6dec8d1ef99202a00c58a6ebdc3aaac7d83de6 (diff) | |
| download | emacs-d17f4dba9c497179ace6c1076fbd636c1c9a86c4.tar.gz | |
Don't let unusual after-change-functions overwrite " prin1" buffer in use.
src/doc.c (Fsubstitute_command_keys): Inhibit modification hooks
while we are using Vprin1_to_string_buffer.
Fixes: debbugs:15907
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/doc.c | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 696475c17e5..60a965e0d2f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2013-11-16 Eli Zaretskii <eliz@gnu.org> + * doc.c (Fsubstitute_command_keys): Inhibit modification hooks + while we are using Vprin1_to_string_buffer. + * keymap.c (describe_map): Don't crash if PT is 1 both before and after inserting the description string. (Bug#15907) diff --git a/src/doc.c b/src/doc.c index d3f8fde08f6..b6f1569c2d8 100644 --- a/src/doc.c +++ b/src/doc.c @@ -850,6 +850,7 @@ Otherwise, return a new string, without any text properties. */) /* This is for computing the SHADOWS arg for describe_map_tree. */ Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil); Lisp_Object earlier_maps; + ptrdiff_t count = SPECPDL_INDEX (); changed = 1; strp += 2; /* skip \{ or \< */ @@ -886,6 +887,10 @@ Otherwise, return a new string, without any text properties. */) /* Now switch to a temp buffer. */ oldbuf = current_buffer; set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); + /* This is for an unusual case where some after-change + function uses 'format' or 'prin1' or something else that + will thrash Vprin1_to_string_buffer we are using. */ + specbind (Qinhibit_modification_hooks, Qt); if (NILP (tem)) { @@ -910,6 +915,7 @@ Otherwise, return a new string, without any text properties. */) tem = Fbuffer_string (); Ferase_buffer (); set_buffer_internal (oldbuf); + unbind_to (count, Qnil); subst_string: start = SDATA (tem); |
