[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 83e0442139f: There are no file modes on windows and dos
From: |
Sam Steingold |
Subject: |
master 83e0442139f: There are no file modes on windows and dos |
Date: |
Wed, 27 Sep 2023 22:33:58 -0400 (EDT) |
branch: master
commit 83e0442139f8dbe5b9b3f19e0d1850ab43cf034f
Author: Sam Steingold <sds@gnu.org>
Commit: Sam Steingold <sds@gnu.org>
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`.
---
doc/emacs/msdos.texi | 4 ++--
lisp/ls-lisp.el | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/doc/emacs/msdos.texi b/doc/emacs/msdos.texi
index 52561ec9a33..8401a2aa596 100644
--- a/doc/emacs/msdos.texi
+++ b/doc/emacs/msdos.texi
@@ -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}.
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index b0f86839740..efc06ffbbf8 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 83e0442139f: There are no file modes on windows and dos,
Sam Steingold <=