From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: double-width characters in tables Date: Tue, 12 Feb 2013 18:56:17 +0800 Message-ID: <878v6tdcmm.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5DSH-00061D-T5 for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 05:51:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5DSF-0004Fv-Er for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 05:51:17 -0500 Received: from plane.gmane.org ([80.91.229.3]:55537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5DSF-0004Fm-7w for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 05:51:15 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U5DSW-0000h4-TG for emacs-orgmode@gnu.org; Tue, 12 Feb 2013 11:51:32 +0100 Received: from 114.222.155.240 ([114.222.155.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Feb 2013 11:51:32 +0100 Received: from eric by 114.222.155.240 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Feb 2013 11:51:32 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This problem has been flagged up before: http://orgmode.org/worg/org-issues.html#mid-87pqt04qg1-2Efsf-40gmail-2Ecom It's causing me headaches at the moment, so I'm trying to see if I can find a solution. The proximate cause of issues with double-width characters in table fields (they also mess with justification) is that the contents of the fields are propertized with a length based on `length', and not `string-width'. So you get this: #("《蛙》" 0 3 (fontified t line-prefix #(" " 0 4 (face org-indent)) wrap-prefix #(" " 0 4 (face org-indent)) face org-table)) 3 is the number of characters in the string, but it takes up 6 columns of screen width. That messes up justification. I can't for the life of me figure out where that number is getting added to the string! I tried changing `length' to `string-width' in all manner of org functions, such as `org-add-props', but could never get that number changed during the fontification of the org tables. I wouldn't be surprised if this is something outside of org, or if "fixing" it would lead to more troubles, but does anyone have any ideas about this? Fixable, or not? Thanks! Eric