diff options
| author | Eli Zaretskii | 2025-05-11 14:42:51 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2025-05-11 14:42:51 +0300 |
| commit | e32bb816adbbd070bbb2bf42b06feb4b6d917b5b (patch) | |
| tree | 8e2e43c0334092196fea01ccd949346fd8d49c46 | |
| parent | 2d5f2434706a17055325432d6eb2b711ac785220 (diff) | |
| download | emacs-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.el | 19 |
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. |
| 211 | These specs are used ONLY if a valid locale can not be determined. | 211 | These specs are used ONLY if a valid locale can not be determined, |
| 212 | or if the locale is \"C\" or \"POSIX\". If a valid non-\"C\" locale | ||
| 213 | can be determined, file time stamps are displayed using hardcoded | ||
| 214 | formats \"%m-%d %H:%M\" for new files and \"%Y-%m-%d\" for old files. | ||
| 212 | 215 | ||
| 213 | If `ls-lisp-use-localized-time-format' is non-nil, these specs are used | 216 | If `ls-lisp-use-localized-time-format' is non-nil, the specs specified |
| 214 | regardless of whether the locale can be determined. | 217 | by this option are used regardless of whether the locale can be determined. |
| 218 | |||
| 219 | The locale is determined by `ls-lisp-format-time', which see. | ||
| 215 | 220 | ||
| 216 | Syntax: (EARLY-TIME-FORMAT OLD-TIME-FORMAT) | 221 | Syntax: (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. |
| 231 | This applies even if a valid locale is specified. | 236 | This applies even if a valid locale is determined by `ls-lisp-format-time'. |
| 232 | 237 | ||
| 233 | WARNING: Using localized date/time format might cause Dired columns | 238 | WARNING: Using localized date/time format might cause Dired columns |
| 234 | to fail to line up, e.g. if month names are not all of the same length." | 239 | to 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. |
| 828 | Use the same method as ls to decide whether to show time-of-day or year, | 833 | Use the same method as ls to decide whether to show time-of-day or year, |
| 829 | depending on distance between file date and the current time. | 834 | depending on distance between file date and the current time. |
| 830 | All ls time options, namely c, t and u, are handled." | 835 | All ls time options, namely c, t and u, are handled. |
| 836 | |||
| 837 | This function determines as side effect the locale relevant for | ||
| 838 | displaying times, by using `system-time-locale' if non-nil, and | ||
| 839 | falling 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 |