aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2018-02-17 14:26:49 +0200
committerEli Zaretskii2018-02-17 14:26:49 +0200
commit4429f97b58653540985387caa554fc0f25f90000 (patch)
treeee5e93292f7f0269824e93bee2ce98348ab8f283 /src
parent24acb31c04b4048b85311d794e600ecd7ce60d3b (diff)
downloademacs-4429f97b58653540985387caa554fc0f25f90000.tar.gz
emacs-4429f97b58653540985387caa554fc0f25f90000.zip
Make echo-area buffers almost always multibyte
* src/xdisp.c (setup_echo_area_for_printing, set_message_1): Ensure the echo-area buffer is multibyte, unless unibyte-display-via-language-environment is non-nil, and the text we are to display is or could be unibyte. (Bug#30405)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 7c90d32db69..f6fcdec6624 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10982,10 +10982,18 @@ setup_echo_area_for_printing (bool multibyte_p)
10982 } 10982 }
10983 TEMP_SET_PT_BOTH (BEG, BEG_BYTE); 10983 TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
10984 10984
10985 /* Set up the buffer for the multibyteness we need. */ 10985 /* Set up the buffer for the multibyteness we need. We always
10986 if (multibyte_p 10986 set it to be multibyte, except when
10987 != !NILP (BVAR (current_buffer, enable_multibyte_characters))) 10987 unibyte-display-via-language-environment is non-nil and the
10988 Fset_buffer_multibyte (multibyte_p ? Qt : Qnil); 10988 buffer from which we are called is unibyte, because in that
10989 case unibyte characters should not be displayed as octal
10990 escapes. */
10991 if (unibyte_display_via_language_environment
10992 && !multibyte_p
10993 && !NILP (BVAR (current_buffer, enable_multibyte_characters)))
10994 Fset_buffer_multibyte (Qnil);
10995 else if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
10996 Fset_buffer_multibyte (Qt);
10989 10997
10990 /* Raise the frame containing the echo area. */ 10998 /* Raise the frame containing the echo area. */
10991 if (minibuffer_auto_raise) 10999 if (minibuffer_auto_raise)
@@ -11431,10 +11439,17 @@ set_message_1 (ptrdiff_t a1, Lisp_Object string)
11431{ 11439{
11432 eassert (STRINGP (string)); 11440 eassert (STRINGP (string));
11433 11441
11434 /* Change multibyteness of the echo buffer appropriately. */ 11442 /* Change multibyteness of the echo buffer appropriately. We always
11435 if (message_enable_multibyte 11443 set it to be multibyte, except when
11436 != !NILP (BVAR (current_buffer, enable_multibyte_characters))) 11444 unibyte-display-via-language-environment is non-nil and the
11437 Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil); 11445 string to display is unibyte, because in that case unibyte
11446 characters should not be displayed as octal escapes. */
11447 if (!message_enable_multibyte
11448 && unibyte_display_via_language_environment
11449 && !NILP (BVAR (current_buffer, enable_multibyte_characters)))
11450 Fset_buffer_multibyte (Qnil);
11451 else if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
11452 Fset_buffer_multibyte (Qt);
11438 11453
11439 bset_truncate_lines (current_buffer, message_truncate_lines ? Qt : Qnil); 11454 bset_truncate_lines (current_buffer, message_truncate_lines ? Qt : Qnil);
11440 if (!NILP (BVAR (current_buffer, bidi_display_reordering))) 11455 if (!NILP (BVAR (current_buffer, bidi_display_reordering)))