(paragraph-start, paragraph-separate): Default values no longer start
[bpt/emacs.git] / lisp / ls-lisp.el
index aa97960..48a7616 100644 (file)
@@ -3,7 +3,7 @@
 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
 ;; Keywords: unix
 
-;; Copyright (C) 1992 by Sebastian Kremer <sk@thp.uni-koeln.de>
+;; Copyright (C) 1992, 1994 by Sebastian Kremer <sk@thp.uni-koeln.de>
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
 ;; INSTALLATION =======================================================
 ;; 
 ;; Put this file into your load-path.  To use it, load it
-;; with (load "directory").
+;; with (load "ls-lisp").
 
 ;; OVERVIEW ===========================================================
 
@@ -57,12 +57,12 @@ Optional third arg WILDCARD means treat FILE as shell wildcard.
 Optional fourth arg FULL-DIRECTORY-P means file is a directory and
 switches do not contain `d', so that a full listing is expected.
 
-This version of the function comes from `directory.el'.
+This version of the function comes from `ls-lisp.el'.
 It does not support ordinary shell wildcards; instead, it allows
 regular expressions to match file names.
 
 The switches that work are: A a c i r S s t u"
-  (let ((handler (find-file-name-handler file)))
+  (let ((handler (find-file-name-handler file 'insert-directory)))
     (if handler
        (funcall handler 'insert-directory file switches
                 wildcard full-directory-p)
@@ -105,12 +105,12 @@ The switches that work are: A a c i r S s t u"
                  (ls-lisp-handle-switches file-alist switches))
            (while file-alist
              (setq elt (car file-alist)
-                   short (car elt)
-                   attr  (cdr elt)
                    file-alist (cdr file-alist)
-                   fil (concat dir short)
-                   sum (+ sum (nth 7 attr)))
-             (insert (ls-lisp-format short attr switches)))
+                   short (car elt)
+                   attr (cdr elt))
+             (and attr
+                  (setq sum (+ sum (nth 7 attr)))
+                  (insert (ls-lisp-format short attr switches))))
            ;; Fill in total size of all files:
            (save-excursion
              (search-backward "total \007")
@@ -185,10 +185,14 @@ The switches that work are: A a c i r S s t u"
            ;; Emacs should be able to make strings of them.
            ;; user-login-name and user-full-name could take an
            ;; optional arg.
-           (format " %3d %-8d %-8d %8d "
+           (format " %3d %8s %8s %8d "
                    (nth 1 file-attr)   ; no. of links
-                   (nth 2 file-attr)   ; uid
-                   (nth 3 file-attr)   ; gid
+                   (if (= (user-uid) (nth 2 file-attr))
+                       (user-login-name)
+                     (int-to-string (nth 2 file-attr)))        ; uid
+                   (if (eq system-type 'ms-dos)
+                       "root"          ; everything is root on MSDOS.
+                     (int-to-string (nth 3 file-attr)))        ; gid
                    (nth 7 file-attr)   ; size in bytes
                    )
            (ls-lisp-format-time file-attr switches)