From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#30405: 26.0.91; Incorrect apostrophe translation in ImageMagick error message Date: Sun, 11 Feb 2018 12:36:47 -0800 Organization: UCLA Computer Science Department Message-ID: <3db2fa4f-fe6b-a5db-599e-b0bcd0b8511b@cs.ucla.edu> References: <874lmpzx1t.fsf@runbox.com> <87po5dczl1.fsf@users.sourceforge.net> <83tvup2q7u.fsf@gnu.org> <2061ef0c-de4d-d8c1-aea8-786223e59c7e@cs.ucla.edu> <83wozk1qsy.fsf@gnu.org> <8337271jz0.fsf@gnu.org> <83zi4fz91t.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------88729A014A09AAC29442035A" X-Trace: blaine.gmane.org 1518381341 13949 195.159.176.226 (11 Feb 2018 20:35:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Feb 2018 20:35:41 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: gazally@runbox.com, 30405@debbugs.gnu.org, npostavs@users.sourceforge.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 11 21:35:36 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekyL8-0001gm-Vb for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Feb 2018 21:35:11 +0100 Original-Received: from localhost ([::1]:52930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekyN9-0003z6-Jp for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Feb 2018 15:37:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekyN1-0003wv-Bp for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 15:37:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekyMw-0002w7-Or for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 15:37:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58970) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ekyMw-0002vb-KU for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 15:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ekyMw-0000Eh-4q for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 15:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2018 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30405 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30405-submit@debbugs.gnu.org id=B30405.1518381419897 (code B ref 30405); Sun, 11 Feb 2018 20:37:02 +0000 Original-Received: (at 30405) by debbugs.gnu.org; 11 Feb 2018 20:36:59 +0000 Original-Received: from localhost ([127.0.0.1]:38634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekyMr-0000EN-EW for submit@debbugs.gnu.org; Sun, 11 Feb 2018 15:36:59 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:54370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekyMp-0000EA-Vb for 30405@debbugs.gnu.org; Sun, 11 Feb 2018 15:36:56 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A6FE5160156; Sun, 11 Feb 2018 12:36:49 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id UsvO9djfMwgl; Sun, 11 Feb 2018 12:36:48 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 96500160186; Sun, 11 Feb 2018 12:36:48 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id H9TcwaJMwOGJ; Sun, 11 Feb 2018 12:36:48 -0800 (PST) Original-Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 6AAF9160156; Sun, 11 Feb 2018 12:36:48 -0800 (PST) In-Reply-To: <83zi4fz91t.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143168 Archived-At: This is a multi-part message in MIME format. --------------88729A014A09AAC29442035A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Eli Zaretskii wrote: > emacs -Q > M-x set-variable RET unibyte-display-via-language-environment RET t = RET > M-: (set-buffer-multibyte nil) RET > C-q 0242 SPC >=20 > This should display =C2=A2. >=20 > So I think we can get rid of making echo-area buffers unibyte, as long > as we make sure that variable is nil (which it is by default). Getting rid of it sounds good, but why do we need to worry about=20 unibyte-display-via-language-environment? For me, the attached patch does= =20 display that test as =C2=A2, and it fixes the other test cases reported s= o far in=20 Bug#30405. And yet this patch works without worrying about=20 unibyte-display-via-language-environment, even if I run Emacs in a unibyt= e=20 locale like en_US.iso885915 (a practice that's no longer common). For what it's worth, I'm testing on Ubuntu 16.04 and on Fedora 27, built=20 --without-imagicmagick so that I can reproduce the original problem. --------------88729A014A09AAC29442035A Content-Type: text/x-patch; name="0001-Echo-area-multibyteness-is-independent-of-buffer.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-Echo-area-multibyteness-is-independent-of-buffer.patch" =46rom 1ba9c7c8a0fe8c2ec6866a1dfb6b8c340d7d2139 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 11 Feb 2018 12:26:43 -0800 Subject: [PATCH] Echo area multibyteness is independent of buffer This fixes a problem where ImageMagick-related diagnostics were mangled (Bug#30405). * src/print.c (PRINTPREPARE, printchar, strout): * src/xdisp.c (setup_echo_area_for_printing, set_message_1): Don't mess with the multibyteness of the echo buffer. * src/xdisp.c (message_enable_multibyte): Remove. All uses removed. --- src/lisp.h | 2 +- src/print.c | 17 +++++------------ src/xdisp.c | 22 ++-------------------- 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/src/lisp.h b/src/lisp.h index a7f0a1d..2c5aaa0 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3613,7 +3613,7 @@ extern Lisp_Object echo_area_buffer[2]; extern void add_to_log (char const *, ...); extern void vadd_to_log (char const *, va_list); extern void check_message_stack (void); -extern void setup_echo_area_for_printing (bool); +extern void setup_echo_area_for_printing (void); extern bool push_message (void); extern void pop_message_unwind (void); extern Lisp_Object restore_message_unwind (Lisp_Object); diff --git a/src/print.c b/src/print.c index b3c0f6f..fbf51aa 100644 --- a/src/print.c +++ b/src/print.c @@ -98,8 +98,6 @@ bool print_output_debug_flag EXTERNALLY_VISIBLE =3D 1; ptrdiff_t old_point_byte =3D -1, start_point_byte =3D -1; \ ptrdiff_t specpdl_count =3D SPECPDL_INDEX (); \ bool free_print_buffer =3D 0; \ - bool multibyte \ - =3D !NILP (BVAR (current_buffer, enable_multibyte_characters)); \ Lisp_Object original =3D printcharfun; \ if (NILP (printcharfun)) printcharfun =3D Qt; \ if (BUFFERP (printcharfun)) \ @@ -154,7 +152,7 @@ bool print_output_debug_flag EXTERNALLY_VISIBLE =3D 1= ; print_buffer_pos_byte =3D 0; \ } \ if (EQ (printcharfun, Qt) && ! noninteractive) \ - setup_echo_area_for_printing (multibyte); + setup_echo_area_for_printing (); =20 #define PRINTFINISH \ if (NILP (printcharfun)) \ @@ -303,12 +301,9 @@ printchar (unsigned int ch, Lisp_Object fun) } else { - bool multibyte_p - =3D !NILP (BVAR (current_buffer, enable_multibyte_characters)); - - setup_echo_area_for_printing (multibyte_p); + setup_echo_area_for_printing (); insert_char (ch); - message_dolog ((char *) str, len, 0, multibyte_p); + message_dolog ((char *) str, len, 0, true); } } } @@ -360,11 +355,9 @@ strout (const char *ptr, ptrdiff_t size, ptrdiff_t s= ize_byte, here, that's the reason we don't call printchar to do the job. */ int i; - bool multibyte_p - =3D !NILP (BVAR (current_buffer, enable_multibyte_characters)); =20 - setup_echo_area_for_printing (multibyte_p); - message_dolog (ptr, size_byte, 0, multibyte_p); + setup_echo_area_for_printing (); + message_dolog (ptr, size_byte, 0, true); =20 if (size =3D=3D size_byte) { diff --git a/src/xdisp.c b/src/xdisp.c index 7c90d32..236a4ae 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -445,11 +445,6 @@ Lisp_Object echo_area_window; =20 static Lisp_Object Vmessage_stack; =20 -/* True means multibyte characters were enabled when the echo area - message was specified. */ - -static bool message_enable_multibyte; - /* At each redisplay cycle, we should refresh everything there is to ref= resh. To do that efficiently, we use many optimizations that try to make su= re we don't waste too much time updating things that haven't changed. @@ -10947,11 +10942,10 @@ unwind_with_echo_area_buffer (Lisp_Object vecto= r) } =20 =20 -/* Set up the echo area for use by print functions. MULTIBYTE_P - means we will print multibyte. */ +/* Set up the echo area for use by print functions. */ =20 void -setup_echo_area_for_printing (bool multibyte_p) +setup_echo_area_for_printing (void) { /* If we can't find an echo area any more, exit. */ if (! FRAME_LIVE_P (XFRAME (selected_frame))) @@ -10982,11 +10976,6 @@ setup_echo_area_for_printing (bool multibyte_p) } TEMP_SET_PT_BOTH (BEG, BEG_BYTE); =20 - /* Set up the buffer for the multibyteness we need. */ - if (multibyte_p - !=3D !NILP (BVAR (current_buffer, enable_multibyte_characters))) - Fset_buffer_multibyte (multibyte_p ? Qt : Qnil); - /* Raise the frame containing the echo area. */ if (minibuffer_auto_raise) { @@ -11409,8 +11398,6 @@ set_message (Lisp_Object string) { eassert (STRINGP (string)); =20 - message_enable_multibyte =3D STRING_MULTIBYTE (string); - with_echo_area_buffer (0, -1, set_message_1, 0, string); message_buf_print =3D false; help_echo_showing_p =3D false; @@ -11431,11 +11418,6 @@ set_message_1 (ptrdiff_t a1, Lisp_Object string)= { eassert (STRINGP (string)); =20 - /* Change multibyteness of the echo buffer appropriately. */ - if (message_enable_multibyte - !=3D !NILP (BVAR (current_buffer, enable_multibyte_characters))) - Fset_buffer_multibyte (message_enable_multibyte ? Qt : Qnil); - bset_truncate_lines (current_buffer, message_truncate_lines ? Qt : Qni= l); if (!NILP (BVAR (current_buffer, bidi_display_reordering))) bset_bidi_paragraph_direction (current_buffer, Qleft_to_right); --=20 2.7.4 --------------88729A014A09AAC29442035A--