[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27693: 26.0.50; ls-lisp: Wrong file size format

From: Tino Calancha
Subject: bug#27693: 26.0.50; ls-lisp: Wrong file size format
Date: Sat, 15 Jul 2017 00:31:37 +0900

emacs -Q -l dired -l ls-lisp -eval '(setq ls-lisp-use-insert-directory-program 
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 <address@hidden>
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" 
+    (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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]