There are no file modes on windows and dos

* lisp/ls-lisp.el (ls-lisp-verbosity): Add `modes` on GNU & Unix
  (ls-lisp-format): When `modes` is not in `ls-lisp-verbosity',
   keep just the 1st character of `drwxrwxrwx`.
This commit is contained in:
Sam Steingold 2023-09-27 22:33:26 -04:00
parent 7b43d70c73
commit 83e0442139
2 changed files with 7 additions and 5 deletions

View file

@ -412,10 +412,10 @@ this option can be one of the following symbols:
@itemx nil
Emulate @sc{gnu} systems; this is the default. This sets
@code{ls-lisp-ignore-case} and @code{ls-lisp-dirs-first} to
@code{nil}, and @code{ls-lisp-verbosity} to @code{(links uid gid)}.
@code{nil}, and @code{ls-lisp-verbosity} to @code{(links uid gid modes)}.
@item UNIX
Emulate Unix systems. Like @code{GNU}, but sets
@code{ls-lisp-verbosity} to @code{(links uid)}.
@code{ls-lisp-verbosity} to @code{(links uid modes)}.
@item MacOS
Emulate macOS@. Sets @code{ls-lisp-ignore-case} to @code{t}, and
@code{ls-lisp-dirs-first} and @code{ls-lisp-verbosity} to @code{nil}.

View file

@ -161,8 +161,8 @@ systems, set your locale instead."
((eq ls-lisp-emulation 'MS-Windows)
(if (and (fboundp 'w32-using-nt) (w32-using-nt))
'(links))) ; distinguish NT/2K from 9x
((eq ls-lisp-emulation 'UNIX) '(links uid)) ; UNIX ls
(t '(links uid gid))) ; GNU ls
((eq ls-lisp-emulation 'UNIX) '(links uid modes)) ; UNIX ls
(t '(links uid gid modes))) ; GNU ls
"A list of optional file attributes that ls-lisp should display.
It should contain none or more of the symbols: links, uid, gid.
A value of nil (or an empty list) means display none of them.
@ -808,7 +808,9 @@ SWITCHES and TIME-INDEX give the full switch list and time data."
(* 1024.0 (fceiling (/ file-size 1024.0)))))
(format ls-lisp-filesize-b-fmt
(fceiling (/ file-size 1024.0)))))
drwxrwxrwx ; attribute string
(if (memq 'modes ls-lisp-verbosity)
drwxrwxrwx ; modes string
(substring drwxrwxrwx 0 1)) ; "d" or "-" for directory vs file
(if (memq 'links ls-lisp-verbosity)
(format "%3d" (file-attribute-link-number file-attr)))
;; Numeric uid/gid are more confusing than helpful;