aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTino Calancha2017-07-16 00:30:56 +0900
committerTino Calancha2017-07-16 00:30:56 +0900
commit66683f46b877a8c2baa5fdedfb332618a1973db5 (patch)
tree205ae6265f5af316c89d5f05602c06c10678c553
parentb30ee0c9225bad6e3fd0b511a6c5d9a64b8fd66a (diff)
downloademacs-66683f46b877a8c2baa5fdedfb332618a1973db5.tar.gz
emacs-66683f46b877a8c2baa5fdedfb332618a1973db5.zip
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.
-rw-r--r--lisp/ls-lisp.el6
-rw-r--r--test/lisp/dired-tests.el12
2 files changed, 15 insertions, 3 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 7ae23434415..b368efbbc95 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -245,11 +245,11 @@ to fail to line up, e.g. if month names are not all of the same length."
245 "Format to display integer GIDs.") 245 "Format to display integer GIDs.")
246(defvar ls-lisp-gid-s-fmt " %s" 246(defvar ls-lisp-gid-s-fmt " %s"
247 "Format to display user group names.") 247 "Format to display user group names.")
248(defvar ls-lisp-filesize-d-fmt "%d" 248(defvar ls-lisp-filesize-d-fmt " %d"
249 "Format to display integer file sizes.") 249 "Format to display integer file sizes.")
250(defvar ls-lisp-filesize-f-fmt "%.0f" 250(defvar ls-lisp-filesize-f-fmt " %.0f"
251 "Format to display float file sizes.") 251 "Format to display float file sizes.")
252(defvar ls-lisp-filesize-b-fmt "%.0f" 252(defvar ls-lisp-filesize-b-fmt " %.0f"
253 "Format to display file sizes in blocks (for the -s switch).") 253 "Format to display file sizes in blocks (for the -s switch).")
254 254
255;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 255;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index 1b814baac58..208e1c25091 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -84,5 +84,17 @@
84 (advice-remove 'dired-query "advice-dired-query") 84 (advice-remove 'dired-query "advice-dired-query")
85 (advice-remove 'completing-read "advice-completing-read")))) 85 (advice-remove 'completing-read "advice-completing-read"))))
86 86
87(ert-deftest dired-test-bug27693 ()
88 "Test for http://debbugs.gnu.org/27693 ."
89 (require 'ls-lisp)
90 (let ((size "")
91 ls-lisp-use-insert-directory-program)
92 (dired (list (expand-file-name "lisp" source-directory) "simple.el" "subr.el"))
93 (setq size (number-to-string
94 (file-attribute-size
95 (file-attributes (dired-get-filename)))))
96 (search-backward-regexp size nil t)
97 (should (looking-back "[[:space:]]" (1- (point))))))
98
87(provide 'dired-tests) 99(provide 'dired-tests)
88;; dired-tests.el ends here 100;; dired-tests.el ends here