From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#27693: 26.0.50; ls-lisp: Wrong file size format Date: Sat, 15 Jul 2017 00:31:37 +0900 Message-ID: <87pod3vxuu.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500046342 27876 195.159.176.226 (14 Jul 2017 15:32:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 14 Jul 2017 15:32:22 +0000 (UTC) To: 27693@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 14 17:32:16 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dW2Ze-0006bt-DW for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jul 2017 17:32:10 +0200 Original-Received: from localhost ([::1]:38565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dW2Zj-00022z-VT for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jul 2017 11:32:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dW2Zb-00022f-PP for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 11:32:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dW2ZW-0002Pe-3l for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 11:32:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36525) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dW2ZV-0002Pa-Vz for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 11:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dW2ZV-0007H2-Nq for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 11:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jul 2017 15:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27693 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.150004631927950 (code B ref -1); Fri, 14 Jul 2017 15:32:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Jul 2017 15:31:59 +0000 Original-Received: from localhost ([127.0.0.1]:39202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dW2ZT-0007Gi-0R for submit@debbugs.gnu.org; Fri, 14 Jul 2017 11:31:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dW2ZR-0007GW-Es for submit@debbugs.gnu.org; Fri, 14 Jul 2017 11:31:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dW2ZL-0002OO-6g for submit@debbugs.gnu.org; Fri, 14 Jul 2017 11:31:52 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:55117) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dW2ZL-0002OK-3g for submit@debbugs.gnu.org; Fri, 14 Jul 2017 11:31:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dW2ZJ-0001v2-Qw for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 11:31:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dW2ZE-0002Kh-RT for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 11:31:49 -0400 Original-Received: from mail-pg0-x22a.google.com ([2607:f8b0:400e:c05::22a]:33924) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dW2ZE-0002Jg-Kx for bug-gnu-emacs@gnu.org; Fri, 14 Jul 2017 11:31:44 -0400 Original-Received: by mail-pg0-x22a.google.com with SMTP id t186so47516849pgb.1 for ; Fri, 14 Jul 2017 08:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=6TXyi6wvS8V0z1NWFBmYrybhHuHoG5xx3SSEHjx9ppQ=; b=OkSCXZUJrlETbCjNhjoRzyC+coIP0BnJ7i9Dw7FLEucrIxgRrbYGm516GR9e9vOWrk L4W2+2vP+1mwkv4Kzfg+1ZsSWzkXX988p7A8QQ7FdaBnFB6ECRroIOA2ib8lOlSaujQb r9/DzP6f6t0DN+C++vxie3oM0XFw+ExHJWzlKH/lX7DzUCJvKM0z7pif/EcqvX7sDK4A iLppCO8iBq1Re2behzZcHNbXn+KGceHrMO6hBR5MB45/TGwuHJrxC2ItWOd8FUY4OAkj pUl8UR7pTGqwAOBdczSGUJOpgAJQoapNHkI4wMfgjtJMSp+NgTZiD9yX9v+OCiYl1p6k dCtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=6TXyi6wvS8V0z1NWFBmYrybhHuHoG5xx3SSEHjx9ppQ=; b=FGyx8rXIx5nPRsKvSg5EPNBHyB4smbndb1i/BTeGGCUwnkDyOEegmx3JXvtRKAFIS8 7iBPy4aHZJfQALFK8mc8hkEN5YxMe/fAV2sNejaNjtmEM+SL36+FR/C5MSpYyJI5n8CW BjLx2zDjD97znKrqq+2aKbkCBU4QadKCDD3IZ+VBVNy6rG16M7tVOS+WyNrmaPr6VLwL VVWJSlF+9q1YcLkx2zOUHL3oFAaWVp356SjTTJlTQu5HB7aaNMmGgQq7Qor6bz5G0po3 JiE/qG/z/9oaWQ7QCF6b+Hb9Ll7Z1fCHppjgn4EbauGiw5VzpXcgkyvjiH99wDLzbiVk 8dOA== X-Gm-Message-State: AIVw112A2xhc4RrGmMFw5+IkfRIMTMO1EzT5kcuUYiR2i2pexZ7r9GXY Ci+Zj8DLgNyCc99r X-Received: by 10.98.8.93 with SMTP id c90mr5963468pfd.213.1500046302045; Fri, 14 Jul 2017 08:31:42 -0700 (PDT) Original-Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id y11sm24398438pfi.42.2017.07.14.08.31.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jul 2017 08:31:41 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:134566 Archived-At: emacs -Q -l dired -l ls-lisp -eval '(setq ls-lisp-use-insert-directory-program nil)' M-: (dired (list (expand-file-name "lisp" source-directory) "simple.el" "subr.el")) RET ;; No space between the group name and the file size. --8<-----------------------------cut here---------------start------------->8--- commit f2bb26b2e028e69d0d9ca77a37c5d29c1a071b4f Author: Tino Calancha Date: Sat Jul 15 00:28:12 2017 +0900 ls-lisp: Fix file size format * lisp/ls-lisp.el (ls-lisp-filesize-d-fmt, ls-lisp-filesize-f-fmt) (ls-lisp-filesize-b-fmt): Add space in front (Bug#27693). * test/lisp/dired-tests.el (dired-test-bug27693): Add test. diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 7ae2343441..b368efbbc9 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -245,11 +245,11 @@ ls-lisp-gid-d-fmt "Format to display integer GIDs.") (defvar ls-lisp-gid-s-fmt " %s" "Format to display user group names.") -(defvar ls-lisp-filesize-d-fmt "%d" +(defvar ls-lisp-filesize-d-fmt " %d" "Format to display integer file sizes.") -(defvar ls-lisp-filesize-f-fmt "%.0f" +(defvar ls-lisp-filesize-f-fmt " %.0f" "Format to display float file sizes.") -(defvar ls-lisp-filesize-b-fmt "%.0f" +(defvar ls-lisp-filesize-b-fmt " %.0f" "Format to display file sizes in blocks (for the -s switch).") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index 1b814baac5..208e1c2509 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -84,5 +84,17 @@ (advice-remove 'dired-query "advice-dired-query") (advice-remove 'completing-read "advice-completing-read")))) +(ert-deftest dired-test-bug27693 () + "Test for http://debbugs.gnu.org/27693 ." + (require 'ls-lisp) + (let ((size "") + ls-lisp-use-insert-directory-program) + (dired (list (expand-file-name "lisp" source-directory) "simple.el" "subr.el")) + (setq size (number-to-string + (file-attribute-size + (file-attributes (dired-get-filename))))) + (search-backward-regexp size nil t) + (should (looking-back "[[:space:]]" (1- (point)))))) + (provide 'dired-tests) ;; dired-tests.el ends here --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-07-14 Repository revision: 6e2d6d54e1236216462c13655ea1fe573d9672e7