emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115120: Don't let unusual after-change-functions ov


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r115120: Don't let unusual after-change-functions overwrite " prin1" buffer in use.
Date: Sat, 16 Nov 2013 10:24:44 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115120
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15907
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2013-11-16 12:23:09 +0200
message:
  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.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/doc.c                      doc.c-20091113204419-o5vbwnq5f7feedwu-250
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-11-16 09:27:19 +0000
+++ b/src/ChangeLog     2013-11-16 10:23:09 +0000
@@ -1,5 +1,8 @@
 2013-11-16  Eli Zaretskii  <address@hidden>
 
+       * 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)
 

=== modified file 'src/doc.c'
--- a/src/doc.c 2013-08-11 01:30:20 +0000
+++ b/src/doc.c 2013-11-16 10:23:09 +0000
@@ -850,6 +850,7 @@
          /* 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 @@
          /* 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 @@
          tem = Fbuffer_string ();
          Ferase_buffer ();
          set_buffer_internal (oldbuf);
+         unbind_to (count, Qnil);
 
        subst_string:
          start = SDATA (tem);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]