comparison lisp/eshell/esh-util.el @ 107103:f2353518b994

Fix to uid/gid format in eshell's ls (Bug#5528). * eshell/esh-util.el (eshell-file-attributes): New optional arg ID-FORMAT. Pass it to `file-attributes'. * eshell/em-ls.el (eshell-do-ls): Use it (Bug#5528).
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 07 Feb 2010 01:23:10 -0500
parents 1d1d5d9bd884
children 5fabe7db5188 376148b31b5e
comparison
equal deleted inserted replaced
107102:3554839df1fc 107103:f2353518b994
699 nil mtime nil 699 nil mtime nil
700 size perms nil nil)) entry))) 700 size perms nil nil)) entry)))
701 (forward-line))) 701 (forward-line)))
702 entry)) 702 entry))
703 703
704 (defun eshell-file-attributes (file) 704 (defun eshell-file-attributes (file &optional id-format)
705 "Return the attributes of FILE, playing tricks if it's over ange-ftp." 705 "Return the attributes of FILE, playing tricks if it's over ange-ftp.
706 The optional argument ID-FORMAT specifies the preferred uid and
707 gid format. Valid values are 'string and 'integer, defaulting to
708 'integer. See `file-attributes'."
706 (let* ((file (expand-file-name file)) 709 (let* ((file (expand-file-name file))
707 entry) 710 entry)
708 (if (string-equal (file-remote-p file 'method) "ftp") 711 (if (string-equal (file-remote-p file 'method) "ftp")
709 (let ((base (file-name-nondirectory file)) 712 (let ((base (file-name-nondirectory file))
710 (dir (file-name-directory file))) 713 (dir (file-name-directory file)))
721 (let ((fentry (assoc base (cdr entry)))) 724 (let ((fentry (assoc base (cdr entry))))
722 (if fentry 725 (if fentry
723 (setq entry (cdr fentry)) 726 (setq entry (cdr fentry))
724 (setq entry nil))))) 727 (setq entry nil)))))
725 entry) 728 entry)
726 (file-attributes file)))) 729 (file-attributes file id-format))))
727 730
728 (defalias 'eshell-copy-tree 'copy-tree) 731 (defalias 'eshell-copy-tree 'copy-tree)
729 732
730 (defsubst eshell-processp (proc) 733 (defsubst eshell-processp (proc)
731 "If the `processp' function does not exist, PROC is not a process." 734 "If the `processp' function does not exist, PROC is not a process."