From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/41013 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-correct-length vs. string-width Date: Fri, 28 Dec 2001 18:22:50 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035176479 3963 80.91.224.250 (21 Oct 2002 05:01:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:01:19 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: (qmail 7173 invoked from network); 28 Dec 2001 17:29:07 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 28 Dec 2001 17:29:07 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16K0l5-0000em-00; Fri, 28 Dec 2001 11:25:27 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 28 Dec 2001 11:25:18 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id LAA21272 for ; Fri, 28 Dec 2001 11:25:07 -0600 (CST) Original-Received: (qmail 7086 invoked by alias); 28 Dec 2001 17:25:11 -0000 Original-Received: (qmail 7081 invoked from network); 28 Dec 2001 17:25:10 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by gnus.org with SMTP; 28 Dec 2001 17:25:10 -0000 Original-Received: from localhost.localdomain ([195.42.214.241]) (authenticated bits=0) by yxa.extundo.com (8.12.1/8.12.1) with ESMTP id fBSHP8Sr013980; Fri, 28 Dec 2001 18:25:11 +0100 Original-To: Jesper Harder In-Reply-To: (Jesper Harder's message of "Fri, 28 Dec 2001 15:26:49 +0100") Mail-Copies-To: nobody Original-Lines: 31 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:41013 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:41013 Jesper Harder writes: > Is the built-in function `string-width' known to be broken? When I try the examples from the original thread (<87itf461hj.fsf@inanna.rimspace.net> etc) `string-width' works fine. (format "%-10s" ...) with wide characters still behaves differently between Emacs and XEmacs though, but that shouldn't matter. > I'm asking because the Gnus substitute `gnus-correct-length' seems to be > horribly expensive in comparison -- it really degrades performance when > generating summary buffers. Here's the elp results for entering an NNTP > group with 4000 messages: Could CJK people please try running with the patch below? --- gnus-spec.el.~6.27.~ Tue Dec 18 20:42:52 2001 +++ gnus-spec.el Fri Dec 28 18:21:11 2001 @@ -264,11 +264,7 @@ (insert (make-string (max (- ,(abs column) (current-column)) 0) ? )))))) -(defun gnus-correct-length (string) - "Return the correct width of STRING." - (let ((length 0)) - (mapcar (lambda (char) (incf length (gnus-char-width char))) string) - length)) +(defalias gnus-correct-length 'string-width) (defun gnus-correct-substring (string start &optional end) (let ((wstart 0)