emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 4429f97: Make echo-area buffers almost always multi


From: Eli Zaretskii
Subject: [Emacs-diffs] master 4429f97: Make echo-area buffers almost always multibyte
Date: Sat, 17 Feb 2018 07:27:58 -0500 (EST)

branch: master
commit 4429f97b58653540985387caa554fc0f25f90000
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 src/xdisp.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 7c90d32..f6fcdec 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10982,10 +10982,18 @@ setup_echo_area_for_printing (bool multibyte_p)
        }
       TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
 
-      /* Set up the buffer for the multibyteness we need.  */
-      if (multibyte_p
-         != !NILP (BVAR (current_buffer, enable_multibyte_characters)))
-       Fset_buffer_multibyte (multibyte_p ? Qt : Qnil);
+      /* Set up the buffer for the multibyteness we need.  We always
+        set it to be multibyte, except when
+        unibyte-display-via-language-environment is non-nil and the
+        buffer from which we are called is unibyte, because in that
+        case unibyte characters should not be displayed as octal
+        escapes.  */
+      if (unibyte_display_via_language_environment
+         && !multibyte_p
+         && !NILP (BVAR (current_buffer, enable_multibyte_characters)))
+       Fset_buffer_multibyte (Qnil);
+      else if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
+       Fset_buffer_multibyte (Qt);
 
       /* Raise the frame containing the echo area.  */
       if (minibuffer_auto_raise)
@@ -11431,10 +11439,17 @@ set_message_1 (ptrdiff_t a1, Lisp_Object string)
 {
   eassert (STRINGP (string));
 
-  /* Change multibyteness of the echo buffer appropriately.  */
-  if (message_enable_multibyte
-      != !NILP (BVAR (current_buffer, enable_multibyte_characters)))
-    Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil);
+  /* Change multibyteness of the echo buffer appropriately.  We always
+     set it to be multibyte, except when
+     unibyte-display-via-language-environment is non-nil and the
+     string to display is unibyte, because in that case unibyte
+     characters should not be displayed as octal escapes.  */
+  if (!message_enable_multibyte
+      && unibyte_display_via_language_environment
+      && !NILP (BVAR (current_buffer, enable_multibyte_characters)))
+    Fset_buffer_multibyte (Qnil);
+  else if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
+    Fset_buffer_multibyte (Qt);
 
   bset_truncate_lines (current_buffer, message_truncate_lines ? Qt : Qnil);
   if (!NILP (BVAR (current_buffer, bidi_display_reordering)))



reply via email to

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