From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/73161 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: shr.el: folding Japanese text Date: Fri, 15 Oct 2010 17:08:02 +0900 Organization: Emacsen advocacy group Message-ID: References: <8762xcvbsp.fsf@lifelogs.com> <87eibxkxa3.fsf@anar.kanru.info> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1287130142 29793 80.91.229.12 (15 Oct 2010 08:09:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 15 Oct 2010 08:09:02 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M21533@lists.math.uh.edu Fri Oct 15 10:09:01 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P6fLU-0003Jy-8A for ding-account@gmane.org; Fri, 15 Oct 2010 10:08:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1P6fLJ-0005Qb-PQ; Fri, 15 Oct 2010 03:08:45 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1P6fLI-0005QM-AR for ding@lists.math.uh.edu; Fri, 15 Oct 2010 03:08:44 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1P6fLH-0004F0-61 for ding@lists.math.uh.edu; Fri, 15 Oct 2010 03:08:44 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1P6fLG-00005F-00 for ; Fri, 15 Oct 2010 10:08:42 +0200 Original-Received: from localhost ([127.0.0.1]:49532) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1P6fKj-0003th-Nn for ding@gnus.org; Fri, 15 Oct 2010 03:08:10 -0500 X-Hashcash: 1:20:101015:ding@gnus.org::Ys0Sg1LHFRjiMKcv:000016mb X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:7DA4Kq39gF/ba76BCHWtG4XEaqY= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:73161 Archived-At: Lars Magne Ingebrigtsen wrote: > Katsumi Yamaoka writes: >> BTW, the present shr.el code deletes CJK characters that are at >> the end of lines, inserts useless SPC between wide characters, >> and doesn't seem to do kinsoku. So, I tried improving them. A >> patch follows. I think it is near completion. WDYT? > Looks good; please apply. Done. But I noticed this change breaks rendering of some kind of table. It seems that `shr-render-td' was designed assuming the length of a line should be less than `shr-width'. But it will be less than *or equal to* `shr-width' now (kinsoku may lengthen it more). I'm not sure it's ok for all the cases but here's a workaround. --- shr.el~ 2010-10-15 08:04:53 +0000 +++ shr.el 2010-10-15 08:05:28 +0000 @@ -687,7 +687,7 @@ (let ((cache (cdr (assoc (cons width cont) shr-content-cache)))) (if cache (insert cache) - (let ((shr-width width) + (let ((shr-width (1- width)) (shr-indentation 0)) (shr-generic cont)) (delete-region In addition, I tried removing trailing space inserted to each line. It's incomplete yet though.