From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#10978: `calendar-string-spread' loses with double-width characters Date: Fri, 09 Mar 2012 21:27:08 -0500 Message-ID: <8pipidtclf.fsf@fencepost.gnu.org> References: <87vcme6l79.fsf@gmail.com> <83r4x2ymwu.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1331346457 19545 80.91.229.3 (10 Mar 2012 02:27:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Mar 2012 02:27:37 +0000 (UTC) Cc: 10978@debbugs.gnu.org, =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 10 03:27:36 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 1S6C1q-0007tu-Tx for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Mar 2012 03:27:31 +0100 Original-Received: from localhost ([::1]:41924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6C1q-0007uH-7B for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Mar 2012 21:27:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6C1n-0007u9-Fp for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2012 21:27:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6C1l-0000xi-RZ for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2012 21:27:27 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6C1l-0000xd-O9 for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2012 21:27:25 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S6CUP-0000dA-S8 for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2012 21:57:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Mar 2012 02:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10978 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10978-submit@debbugs.gnu.org id=B10978.13313482102405 (code B ref 10978); Sat, 10 Mar 2012 02:57:01 +0000 Original-Received: (at 10978) by debbugs.gnu.org; 10 Mar 2012 02:56:50 +0000 Original-Received: from localhost ([127.0.0.1]:41463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6CUD-0000cj-G2 for submit@debbugs.gnu.org; Fri, 09 Mar 2012 21:56:50 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:37192) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6CUA-0000cb-V2 for 10978@debbugs.gnu.org; Fri, 09 Mar 2012 21:56:47 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1S6C1U-0008BB-Nc; Fri, 09 Mar 2012 21:27:08 -0500 X-Spook: Semtex JSOFC3IP fissionable import bullion lock picking X-Ran: i[EkNUI-]szL*uwp[]3?o"yI6)w#:4{sQW{Ek&U>k|{ewI}Lo4zY~N.A4]>G=,/j\lV@&, X-Hue: red X-Attribution: GM In-Reply-To: <83r4x2ymwu.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Mar 2012 14:33:05 +0200") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) 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 (newer, 2) 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:57614 Archived-At: Eli Zaretskii wrote: > It should use `string-width' instead of `length'. Like so? *** lisp/calendar/calendar.el 2012-03-06 02:18:29 +0000 --- lisp/calendar/calendar.el 2012-03-10 02:16:16 +0000 *************** *** 1756,1762 **** (if (< (length strings) 2) (append (list "") strings (list "")) strings))) ! (n (- length (length (apply 'concat strings)))) (m (1- (length strings))) (s (car strings)) (strings (cdr strings)) --- 1756,1762 ---- (if (< (length strings) 2) (append (list "") strings (list "")) strings))) ! (n (- length (string-width (apply 'concat strings)))) (m (1- (length strings))) (s (car strings)) (strings (cdr strings)) *************** *** 1766,1772 **** (make-string (max 0 (/ (+ n i) m)) char) string) i (1+ i))) ! (substring s 0 length))) (defun calendar-update-mode-line () "Update the calendar mode line with the current date and date style." --- 1766,1772 ---- (make-string (max 0 (/ (+ n i) m)) char) string) i (1+ i))) ! (truncate-string-to-width s length))) (defun calendar-update-mode-line () "Update the calendar mode line with the current date and date style."