Also, be more consistent about calls to 'Fmessage' vs 'message'.
* src/alloc.c (Fgc_status):
Prefer AUTO_STRING to build_string for Fmessage call.
* src/data.c (Fmake_variable_buffer_local)
(Fmake_local_variable, Fmake_variable_frame_local):
* src/doc.c (store_function_docstring):
Use Fmessage, not message, since the argument can contain
non-ASCII characters, and this can cause the resulting message
to be incorrectly encoded for the current environment.
* src/fns.c (maybe_resize_hash_table):
* src/xselect.c (x_clipboard_manager_save_all):
Use message, not Fmessage, since Fmessage's power isn't needed here.
* src/process.c (Fmake_network_process): Reword message to avoid %s.
* src/xdisp.c (vmessage): Document restrictions on message contents.
(message_nolog) [false]: Remove unused code.
Lisp_Object zombie_list = Qnil;
for (int i = 0; i < min (MAX_ZOMBIES, nzombies); i++)
zombie_list = Fcons (zombies[i], zombie_list);
- return CALLN (Fmessage,
- build_string ("%d GCs, avg live/zombies = %.2f/%.2f"
- " (%f%%), max %d/%d\nzombies: %S"),
+ AUTO_STRING (format, ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%),"
+ " max %d/%d\nzombies: %S"));
+ return CALLN (Fmessage, format,
make_number (ngcs), make_float (avg_live),
make_float (avg_zombies),
make_float (avg_zombies / avg_live / 100),
Lisp_Object symbol;
XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */
if (let_shadows_global_binding_p (symbol))
- message ("Making %s buffer-local while let-bound!",
- SDATA (SYMBOL_NAME (variable)));
+ {
+ AUTO_STRING (format, "Making %s buffer-local while let-bound!");
+ CALLN (Fmessage, format, SYMBOL_NAME (variable));
+ }
}
}
Lisp_Object symbol;
XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */
if (let_shadows_global_binding_p (symbol))
- message ("Making %s local to %s while let-bound!",
- SDATA (SYMBOL_NAME (variable)),
- SDATA (BVAR (current_buffer, name)));
+ {
+ AUTO_STRING (format, "Making %s local to %s while let-bound!");
+ CALLN (Fmessage, format, SYMBOL_NAME (variable),
+ BVAR (current_buffer, name));
+ }
}
}
if (NILP (tem))
{
if (let_shadows_buffer_binding_p (sym))
- message ("Making %s buffer-local while locally let-bound!",
- SDATA (SYMBOL_NAME (variable)));
+ {
+ AUTO_STRING (format,
+ "Making %s buffer-local while locally let-bound!");
+ CALLN (Fmessage, format, SYMBOL_NAME (variable));
+ }
/* Swap out any local binding for some other buffer, and make
sure the current value is permanently recorded, if it's the
Lisp_Object symbol;
XSETSYMBOL (symbol, sym); /* In case `variable' is aliased. */
if (let_shadows_global_binding_p (symbol))
- message ("Making %s frame-local while let-bound!",
- SDATA (SYMBOL_NAME (variable)));
+ {
+ AUTO_STRING (format, "Making %s frame-local while let-bound!");
+ CALLN (Fmessage, format, SYMBOL_NAME (variable));
+ }
}
return variable;
}
if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_DOC_STRING)
ASET (fun, COMPILED_DOC_STRING, make_number (offset));
else
- message ("No docstring slot for %s",
- SYMBOLP (obj) ? SSDATA (SYMBOL_NAME (obj)) : "<anonymous>");
+ {
+ AUTO_STRING (format, "No docstring slot for %s");
+ CALLN (Fmessage, format,
+ (SYMBOLP (obj)
+ ? SYMBOL_NAME (obj)
+ : build_string ("<anonymous>")));
+ }
}
}
#ifdef ENABLE_CHECKING
if (HASH_TABLE_P (Vpurify_flag)
&& XHASH_TABLE (Vpurify_flag) == h)
- CALLN (Fmessage, build_string ("Growing hash table to: %d"),
- make_number (new_size));
+ message ("Growing hash table to: %"pI"d", new_size);
#endif
set_hash_key_and_value (h, larger_vector (h->key_and_value,
{
if (!NILP (host))
{
- message (":family local ignores the :host \"%s\" property",
- SDATA (host));
+ message (":family local ignores the :host property");
contact = Fplist_put (contact, QChost, Qnil);
host = Qnil;
}
/* Dump an informative message to the minibuf. If M is 0, clear out
- any existing message, and let the mini-buffer text show through. */
+ any existing message, and let the mini-buffer text show through.
+
+ The message must be safe ASCII only. If strings may contain escape
+ sequences or non-ASCII characters, convert them to Lisp strings and
+ use Fmessage. */
static void ATTRIBUTE_FORMAT_PRINTF (1, 0)
vmessage (const char *m, va_list ap)
}
-#if false
-/* The non-logging version of message. */
-
-void
-message_nolog (const char *m, ...)
-{
- Lisp_Object old_log_max;
- va_list ap;
- va_start (ap, m);
- old_log_max = Vmessage_log_max;
- Vmessage_log_max = Qnil;
- vmessage (m, ap);
- Vmessage_log_max = old_log_max;
- va_end (ap);
-}
-#endif
-
-
/* Display the current message in the current mini-buffer. This is
only called from error handlers in process.c, and is not time
critical. */
local_frame = XCAR (XCDR (XCDR (XCDR (local_selection))));
if (FRAME_LIVE_P (XFRAME (local_frame)))
{
- AUTO_STRING (saving, "Saving clipboard to X clipboard manager...");
- Fmessage (1, &saving);
+ message ("Saving clipboard to X clipboard manager...");
internal_condition_case_1 (x_clipboard_manager_save, local_frame,
Qt, x_clipboard_manager_error_2);
}