aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2005-09-22 09:39:01 +0000
committerKim F. Storm2005-09-22 09:39:01 +0000
commitf291069afb7e8001b4f2a266849a010a8705bc33 (patch)
tree1de6b0be8d7aa33e735ef295f6edc13a9efabd56 /src
parent5db60f31311007e77fa41af3c979997052267246 (diff)
downloademacs-f291069afb7e8001b4f2a266849a010a8705bc33.tar.gz
emacs-f291069afb7e8001b4f2a266849a010a8705bc33.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index e5b6980e033..29b75c42e6d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6752,7 +6752,10 @@ message_log_maybe_newline ()
6752 terminated with a newline when NLFLAG is non-zero. MULTIBYTE, if 6752 terminated with a newline when NLFLAG is non-zero. MULTIBYTE, if
6753 nonzero, means interpret the contents of M as multibyte. This 6753 nonzero, means interpret the contents of M as multibyte. This
6754 function calls low-level routines in order to bypass text property 6754 function calls low-level routines in order to bypass text property
6755 hooks, etc. which might not be safe to run. */ 6755 hooks, etc. which might not be safe to run.
6756
6757 This may GC (insert may run before/after change hooks),
6758 so the buffer M must NOT point to a Lisp string. */
6756 6759
6757void 6760void
6758message_dolog (m, nbytes, nlflag, multibyte) 6761message_dolog (m, nbytes, nlflag, multibyte)
@@ -6963,10 +6966,7 @@ message_log_check_duplicate (prev_bol, prev_bol_byte, this_bol, this_bol_byte)
6963 out any existing message, and let the mini-buffer text show 6966 out any existing message, and let the mini-buffer text show
6964 through. 6967 through.
6965 6968
6966 The buffer M must continue to exist until after the echo area gets 6969 This may GC, so the buffer M must NOT point to a Lisp string. */
6967 cleared or some other message gets displayed there. This means do
6968 not pass text that is stored in a Lisp string; do not pass text in
6969 a buffer that was alloca'd. */
6970 6970
6971void 6971void
6972message2 (m, nbytes, multibyte) 6972message2 (m, nbytes, multibyte)
@@ -8023,7 +8023,11 @@ truncate_message_1 (nchars, a2, a3, a4)
8023 8023
8024 If S is not null, set the message to the first LEN bytes of S. LEN 8024 If S is not null, set the message to the first LEN bytes of S. LEN
8025 zero means use the whole string. MULTIBYTE_P non-zero means S is 8025 zero means use the whole string. MULTIBYTE_P non-zero means S is
8026 multibyte. Display the message multibyte in that case. */ 8026 multibyte. Display the message multibyte in that case.
8027
8028 Doesn't GC, as with_echo_area_buffer binds Qinhibit_modification_hooks
8029 to t before calling set_message_1 (which calls insert).
8030 */
8027 8031
8028void 8032void
8029set_message (s, string, nbytes, multibyte_p) 8033set_message (s, string, nbytes, multibyte_p)