aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2025-05-11 14:42:51 +0300
committerEli Zaretskii2025-05-11 14:42:51 +0300
commite32bb816adbbd070bbb2bf42b06feb4b6d917b5b (patch)
tree8e2e43c0334092196fea01ccd949346fd8d49c46
parent2d5f2434706a17055325432d6eb2b711ac785220 (diff)
downloademacs-e32bb816adbbd070bbb2bf42b06feb4b6d917b5b.tar.gz
emacs-e32bb816adbbd070bbb2bf42b06feb4b6d917b5b.zip
; Improve documentation of ls-lisp.el
* lisp/ls-lisp.el (ls-lisp-format-time-list) (ls-lisp-use-localized-time-format, ls-lisp-format-time): Doc fixes.
-rw-r--r--lisp/ls-lisp.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 5c723d4ef4d..3a1385dffa8 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -208,10 +208,15 @@ Otherwise they are treated as Emacs regexps (for backward compatibility)."
208 '("%b %e %H:%M" 208 '("%b %e %H:%M"
209 "%b %e %Y") 209 "%b %e %Y")
210 "List of `format-time-string' specs to display file time stamps. 210 "List of `format-time-string' specs to display file time stamps.
211These specs are used ONLY if a valid locale can not be determined. 211These specs are used ONLY if a valid locale can not be determined,
212or if the locale is \"C\" or \"POSIX\". If a valid non-\"C\" locale
213can be determined, file time stamps are displayed using hardcoded
214formats \"%m-%d %H:%M\" for new files and \"%Y-%m-%d\" for old files.
212 215
213If `ls-lisp-use-localized-time-format' is non-nil, these specs are used 216If `ls-lisp-use-localized-time-format' is non-nil, the specs specified
214regardless of whether the locale can be determined. 217by this option are used regardless of whether the locale can be determined.
218
219The locale is determined by `ls-lisp-format-time', which see.
215 220
216Syntax: (EARLY-TIME-FORMAT OLD-TIME-FORMAT) 221Syntax: (EARLY-TIME-FORMAT OLD-TIME-FORMAT)
217 222
@@ -228,7 +233,7 @@ current year. The OLD-TIME-FORMAT is used for older files. To use ISO
228 233
229(defcustom ls-lisp-use-localized-time-format nil 234(defcustom ls-lisp-use-localized-time-format nil
230 "Non-nil means to always use `ls-lisp-format-time-list' for time stamps. 235 "Non-nil means to always use `ls-lisp-format-time-list' for time stamps.
231This applies even if a valid locale is specified. 236This applies even if a valid locale is determined by `ls-lisp-format-time'.
232 237
233WARNING: Using localized date/time format might cause Dired columns 238WARNING: Using localized date/time format might cause Dired columns
234to fail to line up, e.g. if month names are not all of the same length." 239to fail to line up, e.g. if month names are not all of the same length."
@@ -827,7 +832,11 @@ Return nil if no time switch found."
827 "Format time for file with attributes FILE-ATTR according to TIME-INDEX. 832 "Format time for file with attributes FILE-ATTR according to TIME-INDEX.
828Use the same method as ls to decide whether to show time-of-day or year, 833Use the same method as ls to decide whether to show time-of-day or year,
829depending on distance between file date and the current time. 834depending on distance between file date and the current time.
830All ls time options, namely c, t and u, are handled." 835All ls time options, namely c, t and u, are handled.
836
837This function determines as side effect the locale relevant for
838displaying times, by using `system-time-locale' if non-nil, and
839falling back to environment variables LC_ALL, LC_TIME, and LANG."
831 (let* ((time (nth (or time-index 5) file-attr)) ; default is last modtime 840 (let* ((time (nth (or time-index 5) file-attr)) ; default is last modtime
832 (diff (time-subtract time nil)) 841 (diff (time-subtract time nil))
833 ;; Consider a time to be recent if it is within the past six 842 ;; Consider a time to be recent if it is within the past six