]> git.eshelyaron.com Git - emacs.git/commitdiff
(eshell-ls-dir): Call eshell-directory-files-and-attributes with additional
authorEli Zaretskii <eliz@gnu.org>
Sat, 21 Mar 2009 14:03:06 +0000 (14:03 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 21 Mar 2009 14:03:06 +0000 (14:03 +0000)
argument 'integer or 'string, according to numeric-uid-gid.
(eshell-ls-file): Don't convert UID and GID to strings, as eshell-ls-dir
already did.  Enlarge max user-name string length to 14 characters.
(eshell-do-ls): Fix the long name of the -L option.
(eshell-ls-file): Enlarge default size-width to 8.
(eshell-ls-dir): Under -l, call eshell-ls-printable-size with last
argument nil.

lisp/ChangeLog
lisp/eshell/em-ls.el

index bcb7243169edf147df9252aceb09f71be86f6434..014ed32c26fb79f5488f38c5f331bca5c341969d 100644 (file)
@@ -1,3 +1,22 @@
+2009-03-21  Eli Zaretskii  <eliz@gnu.org>
+
+       * eshell/em-ls.el (eshell-ls-dir): Call
+       eshell-directory-files-and-attributes with additional argument
+       'integer or 'string, according to numeric-uid-gid.
+       (eshell-ls-file): Don't convert UID and GID to strings, as
+       eshell-ls-dir already did.  Enlarge max user-name string length to
+       14 characters.
+       (eshell-do-ls): Fix the long name of the -L option.
+
+       * eshell/esh-util.el (directory-files-and-attributes): Accept and
+       ignore additional optional argument id-format.
+       (eshell-directory-files-and-attributes): Call
+       directory-files-and-attributes with additional argument id-format.
+
+       * eshell/em-ls.el (eshell-ls-file): Enlarge default size-width to 8.
+       (eshell-ls-dir): Under -l, call eshell-ls-printable-size with last
+       argument nil.
+
 2009-03-21  David Reitter <david.reitter@gmail.com>
 
        * cus-start.el (all): Use existing `ns' rather than new `nextstep'
index ddf335254118a1e961b01eab387dfa59d5853528..e346806679ecaab99ac31ee5b9c87a0f7a2f834d 100644 (file)
@@ -361,7 +361,7 @@ instead."
         "list entries by lines instead of by columns")
      (?C nil by-columns listing-style
         "list entries by columns")
-     (?L "deference" nil dereference-links
+     (?L "dereference" nil dereference-links
         "list entries pointed to by symbolic links")
      (?R "recursive" nil show-recursive
         "list subdirectories recursively")
@@ -483,25 +483,19 @@ whose cdr is the list of file attributes."
                (if show-size
                    (concat (eshell-ls-size-string attrs size-width) " "))
                (format
-                "%s%4d %-8s %-8s "
+                (if numeric-uid-gid
+                    "%s%4d %-8s %-8s "
+                  "%s%4d %-14s %-8s ")
                 (or (nth 8 attrs) "??????????")
                 (or (nth 1 attrs) 0)
                 (or (let ((user (nth 2 attrs)))
-                      (and (not numeric-uid-gid)
-                           user
-                           (eshell-substring
-                            (if (numberp user)
-                                (user-login-name user)
-                              user) 8)))
+                      (and (stringp user)
+                           (eshell-substring user 14)))
                     (nth 2 attrs)
                     "")
                 (or (let ((group (nth 3 attrs)))
-                      (and (not numeric-uid-gid)
-                           group
-                           (eshell-substring
-                            (if (numberp group)
-                                (eshell-group-name group)
-                              group) 8)))
+                      (and (stringp group)
+                           (eshell-substring group 8)))
                     (nth 3 attrs)
                     ""))
                (let* ((str (eshell-ls-printable-size (nth 7 attrs)))
@@ -547,7 +541,12 @@ relative to that directory."
        (let ((entries (eshell-directory-files-and-attributes
                        dir nil (and (not show-all)
                                     eshell-ls-exclude-hidden
-                                    "\\`[^.]") t)))
+                                    "\\`[^.]") t
+                                    ;; Asking for UID and GID as
+                                    ;; strings saves another syscall
+                                    ;; later when we are going to
+                                    ;; display user and group names.
+                                    (if numeric-uid-gid 'integer 'string))))
          (when (and (not show-all) eshell-ls-exclude-regexp)
            (while (and entries (string-match eshell-ls-exclude-regexp
                                              (caar entries)))