From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: thai + M-q + cut'n'paste problem Date: Thu, 31 Mar 2005 13:51:23 +0900 (JST) Message-ID: <200503310451.NAA04620@etlken.m17n.org> References: <20050331.011639.85691665.wl@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1112244708 32603 80.91.229.2 (31 Mar 2005 04:51:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2005 04:51:48 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 31 06:51:42 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DGreZ-0006yr-Fs for ged-emacs-devel@m.gmane.org; Thu, 31 Mar 2005 06:51:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DGrvC-0007ql-HY for ged-emacs-devel@m.gmane.org; Thu, 31 Mar 2005 00:08:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DGruB-0007VJ-5r for emacs-devel@gnu.org; Thu, 31 Mar 2005 00:07:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DGru2-0007Qk-CZ for emacs-devel@gnu.org; Thu, 31 Mar 2005 00:07:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DGru2-0007Qa-AR for emacs-devel@gnu.org; Thu, 31 Mar 2005 00:07:34 -0500 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1DGreP-0003Da-Lt; Wed, 30 Mar 2005 23:51:26 -0500 Original-Received: from nfs.m17n.org (nfs.m17n.org [192.47.44.7]) by tsukuba.m17n.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j2V4pNdY019239; Thu, 31 Mar 2005 13:51:23 +0900 Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) by nfs.m17n.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j2V4pNDI018155; Thu, 31 Mar 2005 13:51:23 +0900 Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id NAA04620; Thu, 31 Mar 2005 13:51:23 +0900 (JST) Original-To: Werner LEMBERG In-reply-to: <20050331.011639.85691665.wl@gnu.org> (message from Werner LEMBERG on Thu, 31 Mar 2005 01:16:39 +0200 (CEST)) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:35404 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:35404 In article <20050331.011639.85691665.wl@gnu.org>, Werner LEMBERG writes: > I see two bugs with the current Thai support, but I suspect that both > are symptoms of the same problem. > 1. Open the attached file in an `emacs -Q' (using thai-tis620 > encoding), mark the paragraph as a region paste to another `emacs > -Q' (under X11), and you can see that all composite glyphs are > displayed decomposed. This is an old propblem. If Thai text is decoded from ctext, it isn't composed automatically. I'll try to find a solution. > 2. Start `emacs -Q', set language environment to `Thai' and load the > attached file. Then set the right margin to 60 characters and do > M-q. In the fourth line, the first character appears decomposed. > If you do another call to M-q, the character is composed. This is because fill-newline does this: ;; Give newline the properties of the space(s) it replaces (set-text-properties (1- (point)) (point) (text-properties-at (point))) As we should never copy `composition' property, I've just installed the attached change. But, aren't there any other text properties that shouldn't be copied here? --- Ken'ichi HANDA handa@m17n.org Index: fill.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/textmodes/fill.el,v retrieving revision 1.174 retrieving revision 1.175 diff -u -c -r1.174 -r1.175 cvs diff: conflicting specifications of output style *** fill.el 11 Mar 2005 02:04:05 -0000 1.174 --- fill.el 31 Mar 2005 04:44:46 -0000 1.175 *************** *** 539,544 **** --- 539,555 ---- ;; Make sure we take SOMETHING after the fill prefix if any. (fill-find-break-point linebeg))))) + ;; Like text-properties-at but don't include `composition' property. + (defun fill-text-properties-at (pos) + (let ((l (text-properties-at pos)) + prop-list) + (while l + (unless (eq (car l) 'composition) + (setq prop-list + (cons (car l) (cons (cadr l) prop-list)))) + (setq l (cddr l))) + prop-list)) + (defun fill-newline () ;; Replace whitespace here with one newline, then ;; indent to left margin. *************** *** 546,552 **** (insert ?\n) ;; Give newline the properties of the space(s) it replaces (set-text-properties (1- (point)) (point) ! (text-properties-at (point))) (and (looking-at "\\( [ \t]*\\)\\(\\c|\\)?") (or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|) (match-end 2)) --- 557,563 ---- (insert ?\n) ;; Give newline the properties of the space(s) it replaces (set-text-properties (1- (point)) (point) ! (fill-text-properties-at (point))) (and (looking-at "\\( [ \t]*\\)\\(\\c|\\)?") (or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|) (match-end 2))