aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2009-03-21 14:03:06 +0000
committerEli Zaretskii2009-03-21 14:03:06 +0000
commitce343c43c835b98abe2b4f43b8ebbab624b9dcb3 (patch)
tree1d46d659e0451402aee141f807a10ddafb89197e
parent8e9b25831feecd9b0732a5c10f6b1ad56d6b5d4e (diff)
downloademacs-ce343c43c835b98abe2b4f43b8ebbab624b9dcb3.tar.gz
emacs-ce343c43c835b98abe2b4f43b8ebbab624b9dcb3.zip
(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-ls-file): Enlarge default size-width to 8. (eshell-ls-dir): Under -l, call eshell-ls-printable-size with last argument nil.
-rw-r--r--lisp/ChangeLog19
-rw-r--r--lisp/eshell/em-ls.el29
2 files changed, 33 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bcb7243169e..014ed32c26f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,22 @@
12009-03-21 Eli Zaretskii <eliz@gnu.org>
2
3 * eshell/em-ls.el (eshell-ls-dir): Call
4 eshell-directory-files-and-attributes with additional argument
5 'integer or 'string, according to numeric-uid-gid.
6 (eshell-ls-file): Don't convert UID and GID to strings, as
7 eshell-ls-dir already did. Enlarge max user-name string length to
8 14 characters.
9 (eshell-do-ls): Fix the long name of the -L option.
10
11 * eshell/esh-util.el (directory-files-and-attributes): Accept and
12 ignore additional optional argument id-format.
13 (eshell-directory-files-and-attributes): Call
14 directory-files-and-attributes with additional argument id-format.
15
16 * eshell/em-ls.el (eshell-ls-file): Enlarge default size-width to 8.
17 (eshell-ls-dir): Under -l, call eshell-ls-printable-size with last
18 argument nil.
19
12009-03-21 David Reitter <david.reitter@gmail.com> 202009-03-21 David Reitter <david.reitter@gmail.com>
2 21
3 * cus-start.el (all): Use existing `ns' rather than new `nextstep' 22 * cus-start.el (all): Use existing `ns' rather than new `nextstep'
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index ddf33525411..e346806679e 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -361,7 +361,7 @@ instead."
361 "list entries by lines instead of by columns") 361 "list entries by lines instead of by columns")
362 (?C nil by-columns listing-style 362 (?C nil by-columns listing-style
363 "list entries by columns") 363 "list entries by columns")
364 (?L "deference" nil dereference-links 364 (?L "dereference" nil dereference-links
365 "list entries pointed to by symbolic links") 365 "list entries pointed to by symbolic links")
366 (?R "recursive" nil show-recursive 366 (?R "recursive" nil show-recursive
367 "list subdirectories recursively") 367 "list subdirectories recursively")
@@ -483,25 +483,19 @@ whose cdr is the list of file attributes."
483 (if show-size 483 (if show-size
484 (concat (eshell-ls-size-string attrs size-width) " ")) 484 (concat (eshell-ls-size-string attrs size-width) " "))
485 (format 485 (format
486 "%s%4d %-8s %-8s " 486 (if numeric-uid-gid
487 "%s%4d %-8s %-8s "
488 "%s%4d %-14s %-8s ")
487 (or (nth 8 attrs) "??????????") 489 (or (nth 8 attrs) "??????????")
488 (or (nth 1 attrs) 0) 490 (or (nth 1 attrs) 0)
489 (or (let ((user (nth 2 attrs))) 491 (or (let ((user (nth 2 attrs)))
490 (and (not numeric-uid-gid) 492 (and (stringp user)
491 user 493 (eshell-substring user 14)))
492 (eshell-substring
493 (if (numberp user)
494 (user-login-name user)
495 user) 8)))
496 (nth 2 attrs) 494 (nth 2 attrs)
497 "") 495 "")
498 (or (let ((group (nth 3 attrs))) 496 (or (let ((group (nth 3 attrs)))
499 (and (not numeric-uid-gid) 497 (and (stringp group)
500 group 498 (eshell-substring group 8)))
501 (eshell-substring
502 (if (numberp group)
503 (eshell-group-name group)
504 group) 8)))
505 (nth 3 attrs) 499 (nth 3 attrs)
506 "")) 500 ""))
507 (let* ((str (eshell-ls-printable-size (nth 7 attrs))) 501 (let* ((str (eshell-ls-printable-size (nth 7 attrs)))
@@ -547,7 +541,12 @@ relative to that directory."
547 (let ((entries (eshell-directory-files-and-attributes 541 (let ((entries (eshell-directory-files-and-attributes
548 dir nil (and (not show-all) 542 dir nil (and (not show-all)
549 eshell-ls-exclude-hidden 543 eshell-ls-exclude-hidden
550 "\\`[^.]") t))) 544 "\\`[^.]") t
545 ;; Asking for UID and GID as
546 ;; strings saves another syscall
547 ;; later when we are going to
548 ;; display user and group names.
549 (if numeric-uid-gid 'integer 'string))))
551 (when (and (not show-all) eshell-ls-exclude-regexp) 550 (when (and (not show-all) eshell-ls-exclude-regexp)
552 (while (and entries (string-match eshell-ls-exclude-regexp 551 (while (and entries (string-match eshell-ls-exclude-regexp
553 (caar entries))) 552 (caar entries)))