unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* thai + M-q + cut'n'paste problem
@ 2005-03-30 23:16 Werner LEMBERG
  2005-03-30 23:40 ` Werner LEMBERG
  2005-03-31  4:51 ` Kenichi Handa
  0 siblings, 2 replies; 3+ messages in thread
From: Werner LEMBERG @ 2005-03-30 23:16 UTC (permalink / raw)


[-- Attachment #1: Type: Text/Plain, Size: 648 bytes --]


[emacs 2005-03-29]

Ken'ichi-san,


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.

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.


      Werner

[-- Attachment #2: thai.test --]
[-- Type: Text/Plain, Size: 284 bytes --]

????????????? NT4 ????????????????????? OpenNT ???? ??????????? demo ??????
?????????? Microsoft ?????????????????????????? ????????????? VirtualPC
????????????????????? Microsoft Service for Unix ?????????????????????????? ????????
??????????? cygwin ????? ?????????????????????

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: thai + M-q + cut'n'paste problem
  2005-03-30 23:16 thai + M-q + cut'n'paste problem Werner LEMBERG
@ 2005-03-30 23:40 ` Werner LEMBERG
  2005-03-31  4:51 ` Kenichi Handa
  1 sibling, 0 replies; 3+ messages in thread
From: Werner LEMBERG @ 2005-03-30 23:40 UTC (permalink / raw)



> I see two bugs with the current Thai support, but I suspect that
> both are symptoms of the same problem.  [...]

Here another try in sending the test file.  This time it is uuencoded.


    Werner


======================================================================


begin 644 thai.test
MX,'7Z,VAZ,VYRL'1PB!.5#0@P=&YX*3"X+OGN>*[P^&AP\&JU^C-($]P96Y.
M5""DP]&Z(+S!X*3"Y+3IM=''(&1E;6\@P=+@Q>BY"N'%Z<?*T:&^T:$@36EC
M<F]S;V9T(*'GJ]?IS<'2X+OGN:+-I[71Q^#-IZO0X,7"(+?3N<VGX+35PL>A
MT;H@5FER='5A;%!#"N'%Z<>AY^"[Q=7HPKFJU^C-X+OGN2!-:6-R;W-O9G0@
M4V5R=FEC92!F;W(@56YI>""BTL+ANKKDP>BDZ,W"J-"VV:'@M^C2Y,O#Z"#A
MM>C+Q=&GY@K@R\'7S;FAP]#ARB!C>6=W:6X@P=+APZ<@H>?@Q<+@S=+-S:'!
*TN&HH:O0X,7""@``
`
end

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: thai + M-q + cut'n'paste problem
  2005-03-30 23:16 thai + M-q + cut'n'paste problem Werner LEMBERG
  2005-03-30 23:40 ` Werner LEMBERG
@ 2005-03-31  4:51 ` Kenichi Handa
  1 sibling, 0 replies; 3+ messages in thread
From: Kenichi Handa @ 2005-03-31  4:51 UTC (permalink / raw)
  Cc: emacs-devel

In article <20050331.011639.85691665.wl@gnu.org>, Werner LEMBERG <wl@gnu.org> 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))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-31  4:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-30 23:16 thai + M-q + cut'n'paste problem Werner LEMBERG
2005-03-30 23:40 ` Werner LEMBERG
2005-03-31  4:51 ` Kenichi Handa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).