Dired: how to get really user-friendly output (find-ls-option)

I'm looking for human readable output for M-x find-dired

/ M-x find-gred-dired

. I tried using the following:

(setq find-ls-option '("-print0 | xargs -0 ls -alhd" . "-alhd"))

      

However, due to the -h

found output is no longer right-aligned and therefore not readable on humans (see screenshot below [dired +]). Is there a (not too intrusive) solution for this?

enter image description here

As Artscan pointed out, -i

is an option. Then I found this "counterexample":

enter image description here

+3


source to share


2 answers


I played a little. The indentation stopped abruptly, except for files whose file size is given in bytes (so no one). Then I was wondering what the "second" set of options in find-ls-option

. While C-h v find-ls-option

not explaining it in a clear way (IMHO), I found that just leaving the second set of options blank is indented correctly:



(setq find-ls-option '("-print0 | xargs -0 ls -alhd" . ""))

      

+1


source


EDIT: The problem is with regex. You need to fix the function find-dired-filter

:



diff -u -L /usr/share/emacs/24.2/lisp/find-dired.el.gz -L \#\<buffer\ find-dired.el.gz\> /tmp/jka-com8644f_j /tmp/buffer-content-86445Tw
--- /usr/share/emacs/24.2/lisp/find-dired.el.gz
+++ #<buffer find-dired.el.gz>
@@ -289,7 +289,7 @@
            (l-opt (and (consp find-ls-option)
                (string-match "l" (cdr find-ls-option))))
            (ls-regexp (concat "^ +[^ \t\r\n]+\\( +[^ \t\r\n]+\\) +"
-                      "[^ \t\r\n]+ +[^ \t\r\n]+\\( +[0-9]+\\)")))
+                      "[^ \t\r\n]+ +[^ \t\r\n]+\\( +[0-9,.]+\\)")))
        (goto-char beg)
        (insert string)
        (goto-char beg)

      

0


source







All Articles