From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/72771 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: shr.el: folding Japanese text Date: Fri, 08 Oct 2010 17:10:17 +0900 Organization: Emacsen advocacy group Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1286525468 14526 80.91.229.12 (8 Oct 2010 08:11:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Oct 2010 08:11:08 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M21143@lists.math.uh.edu Fri Oct 08 10:11:07 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 1P482j-0005kg-MM for ding-account@gmane.org; Fri, 08 Oct 2010 10:11:05 +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 1P482f-0003H5-MV; Fri, 08 Oct 2010 03:11:01 -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 1P482e-0003Gp-As for ding@lists.math.uh.edu; Fri, 08 Oct 2010 03:11:00 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1P482d-0000IE-CR for ding@lists.math.uh.edu; Fri, 08 Oct 2010 03:11:00 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1P482c-0001Gj-00 for ; Fri, 08 Oct 2010 10:10:58 +0200 Original-Received: from localhost ([127.0.0.1]:45332) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1P4825-0000LB-QA for ding@gnus.org; Fri, 08 Oct 2010 03:10:26 -0500 X-Hashcash: 1:20:101008:ding@gnus.org::zBjxtHe+T2iMk+Je:00004IcQ User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:jLpRvhmoBpLehhAyi1hojo+z/AI= 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:72771 Archived-At: Hi, Could you see articles in the gwene.jp.itmedia.news.bursts newsgroup? You may see some aren't folded and some are folded uglily. There's no concept of the word wrapping in Japanese. Normally there's no space between words. A word may be folded in the middle of it. Is it funny? But it's our custom. ;-) I guess that Korean text and Chinese text are similar. The following is a quick hack that satisfies me so-so. For the moment I don't know how we can switch it for Latin text and others, though. (defun shr-insert (text) (when (eq shr-state 'image) (insert "\n") (setq shr-state nil)) (unless (string-equal text "\n") (let ((start (point)) nls) (insert text) (fill-region start (point)) (goto-char start) (skip-chars-forward "\n") (setq nls (skip-chars-backward "\n")) (cond ((bobp) (delete-char (- nls))) ((< nls -2) (delete-char (- -2 nls))))) (goto-char (point-max)))) Regards,