From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#1808: 23.0.60; picture-mode not considering double-width characters alignment Date: Sun, 10 Jan 2016 17:41:14 +0200 Message-ID: <83io31moh1.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1452440540 6364 80.91.229.3 (10 Jan 2016 15:42:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2016 15:42:20 +0000 (UTC) Cc: poppyer@gmail.com, 1808@debbugs.gnu.org To: Alan J Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 10 16:42:10 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aII88-0001oh-Vt for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jan 2016 16:42:09 +0100 Original-Received: from localhost ([::1]:47393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aII88-0003pS-A0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jan 2016 10:42:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aII85-0003oZ-2v for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2016 10:42:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aII81-0002pa-RZ for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2016 10:42:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aII81-0002pU-OI for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2016 10:42:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aII81-0004JI-Ix for bug-gnu-emacs@gnu.org; Sun, 10 Jan 2016 10:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Jan 2016 15:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1808 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 1808-submit@debbugs.gnu.org id=B1808.145244048116516 (code B ref 1808); Sun, 10 Jan 2016 15:42:01 +0000 Original-Received: (at 1808) by debbugs.gnu.org; 10 Jan 2016 15:41:21 +0000 Original-Received: from localhost ([127.0.0.1]:45670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aII7N-0004IJ-64 for submit@debbugs.gnu.org; Sun, 10 Jan 2016 10:41:21 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34105) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aII7L-0004I7-G6 for 1808@debbugs.gnu.org; Sun, 10 Jan 2016 10:41:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aII7C-0002Zm-QB for 1808@debbugs.gnu.org; Sun, 10 Jan 2016 10:41:14 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aII7C-0002Zi-N7; Sun, 10 Jan 2016 10:41:10 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3095 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aII7C-0005ip-0U; Sun, 10 Jan 2016 10:41:10 -0500 In-reply-to: (message from Alan J Third on Sat, 09 Jan 2016 22:43:36 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:111465 Archived-At: > From: Alan J Third > Date: Sat, 09 Jan 2016 22:43:36 +0000 > Cc: 1808@debbugs.gnu.org > > > This is not a new bug of EMACS 23; but it is there in EMACS22 for a > > long time. In M-x picture-mode, emacs acts in a "replace" typing > > mode, i.e. when you type a char, it replace the old one such that the > > alignment is maintained. > > > > But when mixing with double-width characters (e.g. CJK chars), one to > > one char replacing become problematic, e.g. if we replace a > > single-width char with a double-wdith char, the alignment will be > > destroyed. > > Sorry it's taken this long for someone to get back to you. > > First, do you know if this is still a problem for you? I think I still see it in the current Emacs-25 branch. > If so, how are you entering the CJK characters? The point is double-width characters, not necessarily CJK character, AFAIU. There's a list of such characters in lisp/international/character.el (search for "full-width"). Typing any of the characters for which the char-width-table entry holds 2 should exhibit the problem. > I find in Emacs 25 that if I try entering a greek alpha by typing: > > C-x 8 RET GREEK SMALL LETTER ALPHA > > It inserts the character, however when I bind the same character to a > key, eg.: > > (global-set-key (kbd "C-c a") "α") > > and enter it that way it works as expected. Yes, binding it to a key is the way to go. And when inserting such a character, it looks like picture-mode does TRT: you will see in picture-insert that it looks at the character width. But I think the bug report is not about inserting double-width characters, it's about replacing them with a single-width character. If I type a double-width character, the alignment is kept reasonably well ("reasonably" because the double-width characters don't always take up exactly twice the number of pixels of a single-width character, the exact ration depends on the font being used for the double-width character). To keep the alignment, picture-insert replaces 2 single-width characters with the double-width one. However, if I then replace it with a single-width character, the alignment is destroyed. And I think this bug report is about that latter use case. Thanks for working on this.