changeset 65647:611891ba4a43

(message_dolog): Add warning about GC and Lisp strings. (message2): Fix commentary. Ok to use alloca'ed memory. Still not ok to use Lisp string data (because of GC). (set_message): Add comment why GC cannot happen.
author Kim F. Storm <storm@cua.dk>
date Thu, 22 Sep 2005 09:39:01 +0000
parents 539a345d1f54
children cb6f533e7296
files src/xdisp.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Thu Sep 22 09:38:45 2005 +0000
+++ b/src/xdisp.c	Thu Sep 22 09:39:01 2005 +0000
@@ -6752,7 +6752,10 @@
    terminated with a newline when NLFLAG is non-zero.  MULTIBYTE, if
    nonzero, means interpret the contents of M as multibyte.  This
    function calls low-level routines in order to bypass text property
-   hooks, etc. which might not be safe to run.  */
+   hooks, etc. which might not be safe to run.
+
+   This may GC (insert may run before/after change hooks),
+   so the buffer M must NOT point to a Lisp string.  */
 
 void
 message_dolog (m, nbytes, nlflag, multibyte)
@@ -6963,10 +6966,7 @@
    out any existing message, and let the mini-buffer text show
    through.
 
-   The buffer M must continue to exist until after the echo area gets
-   cleared or some other message gets displayed there.  This means do
-   not pass text that is stored in a Lisp string; do not pass text in
-   a buffer that was alloca'd.  */
+   This may GC, so the buffer M must NOT point to a Lisp string.  */
 
 void
 message2 (m, nbytes, multibyte)
@@ -8023,7 +8023,11 @@
 
    If S is not null, set the message to the first LEN bytes of S.  LEN
    zero means use the whole string.  MULTIBYTE_P non-zero means S is
-   multibyte.  Display the message multibyte in that case.  */
+   multibyte.  Display the message multibyte in that case.
+
+   Doesn't GC, as with_echo_area_buffer binds Qinhibit_modification_hooks
+   to t before calling set_message_1 (which calls insert).
+  */
 
 void
 set_message (s, string, nbytes, multibyte_p)