From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David =?UTF-8?Q?Cad=C3=A9?= Newsgroups: gmane.emacs.bugs Subject: bug#13143: 24.2; mpc.el: mpc-songs-refresh: Args out of range Date: Wed, 12 Dec 2012 13:55:50 +0100 (CET) Message-ID: References: <87hanszl48.fsf@alfheim.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-674994260-1355314277=:11192" X-Trace: ger.gmane.org 1355317004 5716 80.91.229.3 (12 Dec 2012 12:56:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Dec 2012 12:56:44 +0000 (UTC) Cc: 13143@debbugs.gnu.org, David =?UTF-8?Q?Cad=C3=A9?= To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 12 13:56:57 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tilrq-0001bc-Sk for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Dec 2012 13:56:55 +0100 Original-Received: from localhost ([::1]:55080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tilre-0003ki-52 for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Dec 2012 07:56:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TilrP-0003iv-VB for bug-gnu-emacs@gnu.org; Wed, 12 Dec 2012 07:56:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TilrE-0006uj-1N for bug-gnu-emacs@gnu.org; Wed, 12 Dec 2012 07:56:27 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TilrD-0006uX-Tu for bug-gnu-emacs@gnu.org; Wed, 12 Dec 2012 07:56:15 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tilrx-0000x8-TQ for bug-gnu-emacs@gnu.org; Wed, 12 Dec 2012 07:57:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: David =?UTF-8?Q?Cad=C3=A9?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Dec 2012 12:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13143 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13143-submit@debbugs.gnu.org id=B13143.13553170023628 (code B ref 13143); Wed, 12 Dec 2012 12:57:01 +0000 Original-Received: (at 13143) by debbugs.gnu.org; 12 Dec 2012 12:56:42 +0000 Original-Received: from localhost ([127.0.0.1]:38368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tilrd-0000wR-VE for submit@debbugs.gnu.org; Wed, 12 Dec 2012 07:56:42 -0500 Original-Received: from mail-wi0-f181.google.com ([209.85.212.181]:37252) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tilrb-0000wH-W7 for 13143@debbugs.gnu.org; Wed, 12 Dec 2012 07:56:41 -0500 Original-Received: by mail-wi0-f181.google.com with SMTP id hm9so505617wib.8 for <13143@debbugs.gnu.org>; Wed, 12 Dec 2012 04:55:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type:content-id; bh=nPepplyhm8joJoEvyUY0B5YZgIAMXR669YWzXmoyYYI=; b=A9BGWnCVAF0EsEFIrlk6YkFmJhHX4G6RZzreXSV5z12eYgsrwbq2eoKD/9/PCnDqN9 Gum7S3URcwmHjKXAvUB1x8S+nsF55bcWtzoe/rawNshfUl8F9LKD35uMN6bc5Y+iAAnE EvHKllxSDy4qYqziebMNLB2dtuYH+r1FMJI5UhFLaMiXPodX55m9IPpj7Pp8ibdMeV18 X79hr2MjwokbEAxfOCRmwmmlp9wTo4/yE6E+Mpz/QrIGa4GLt89qd1QOxMC98m7Z5HHB S22eSF1nGcSIkLg9pN23RUYx7YdszsnovdFtg2ZWzhxzPN/dYtB6Z2cUh5gkc9fK+XVt cLsQ== Original-Received: by 10.180.86.233 with SMTP id s9mr2936787wiz.8.1355316952625; Wed, 12 Dec 2012 04:55:52 -0800 (PST) Original-Received: from alfheim ([2a01:e34:ec06:4e20:52e5:49ff:fe37:f26e]) by mx.google.com with ESMTPS id t17sm21136759wiv.6.2012.12.12.04.55.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 04:55:51 -0800 (PST) Original-Received: from david (helo=localhost) by alfheim with local-esmtp (Exim 4.80) (envelope-from ) id 1Tilqo-0006Pq-44; Wed, 12 Dec 2012 13:55:50 +0100 X-X-Sender: david@alfheim In-Reply-To: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) Content-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:68387 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-674994260-1355314277=:11192 Content-Type: TEXT/PLAIN; CHARSET=ISO-2022-JP; format=flowed Content-ID: Hello, On Tue, 11 Dec 2012, Stefan Monnier wrote: >> I first launched the mpc interface by typing M-x mpc. I did not touch >> any configuration parameter for this mode. >> I then chose an album in the Albums | Playlists window by typing RET on >> it. This triggered the following error: >> mpc-songs-refresh: Args out of range: "..." 0, -21 > > I can't reproduce this here; I don't have any albums with japanese > characters, but I when I tried with albums with non-ASCII chars, it > worked fine. > > Could you select "Options => Enter debugger on error" and reproduce this bug? > Hopefully this will give us a backtrace that gives us some clue of > what's going on. Here you go: Debugger entered--Lisp error: (args-out-of-range "魔法少女リリカルなのは サウンドステージ01 第2.5話「ドキ!水着でプールで大ピンチなの」" 0 -21) mpc-format("%2{Disc--}%3{Track} %-5{Time} %25{Title} %20{Album} %20{Artist} %10{Date}" ((file . "田村ゆかり・他 - 魔法少女リリカルなのは サウンドステージ01 第2.5話「ドキ!水着でプールで大ピンチなの」/01 - 「なのは魔法の練習中」.flac") (Last-Modified . "2010-10-26T01:22:26Z") (Time . "295") (Title . "「なのは魔法の練習中」") (Artist . "田村ゆかり・他") (Album . "魔法少女リリカルなのは サウンドステージ01 第2.5話「ドキ!水着でプールで大ピンチなの」") (Genre . "Anime") (Track . "1") (Date . "2004-01-01T00:00:00"))) mpc-songs-refresh() mpc-selection-refresh() mpc-select(13) call-interactively(mpc-select nil nil) >> Another maybe related bug: when there are japanese characters in the >> album name and it is too long to be displayed without ellipsis (…), the >> longer the less characters are present before the ellipsis. > > You mean that if the real title is longer, then it gets > truncated earlier? As in "toto" would be truncated to "tot…" but > "wonderful" would be truncated to just "w…" rather than "won…"? Exactly. > Hmm... that might be a clue, indeed, tho it might be > completely unrelated. My take on the bug: I looked at the code of this function, and from what I can gather, the bug seems to be in: (substring text 0 (- size postwidth textwidth 1)) postwidth and textwidth are widths obtained with string-width, that is to say in number of columns, and may not have any relation with the number of characters present in the string text. This seems wrong to me. It seems to me that truncate-string-to-width seems to be the function one would want to use in this case. Greetings, -- David --8323329-674994260-1355314277=:11192--