diff options
| author | Eli Zaretskii | 2009-03-21 14:03:06 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2009-03-21 14:03:06 +0000 |
| commit | ce343c43c835b98abe2b4f43b8ebbab624b9dcb3 (patch) | |
| tree | 1d46d659e0451402aee141f807a10ddafb89197e /lisp/eshell | |
| parent | 8e9b25831feecd9b0732a5c10f6b1ad56d6b5d4e (diff) | |
| download | emacs-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.
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/em-ls.el | 29 |
1 files changed, 14 insertions, 15 deletions
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))) |