diff options
| author | Eli Zaretskii | 2007-01-27 13:21:19 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2007-01-27 13:21:19 +0000 |
| commit | ea88e7752ecf1222f9950181b8fd7b447b06a243 (patch) | |
| tree | a9f6e30025700b869e55d11b02c5286ad374301a | |
| parent | bfe6997213af49b618bed3ec0f7ffa7d45f699da (diff) | |
| download | emacs-ea88e7752ecf1222f9950181b8fd7b447b06a243.tar.gz emacs-ea88e7752ecf1222f9950181b8fd7b447b06a243.zip | |
(ls-lisp-use-localized-time-format): New defcustom.
(ls-lisp-format-time-list): Doc fix. Mention ls-lisp-use-localized-time-format.
(ls-lisp-format-time): Use ls-lisp-format-time-list if
ls-lisp-use-localized-time-format is non-nil, even if a valid locale is defined.
| -rw-r--r-- | lisp/ls-lisp.el | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 2b778db2387..20da227b010 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el | |||
| @@ -151,7 +151,10 @@ Otherwise they are treated as Emacs regexps (for backward compatibility)." | |||
| 151 | '("%b %e %H:%M" | 151 | '("%b %e %H:%M" |
| 152 | "%b %e %Y") | 152 | "%b %e %Y") |
| 153 | "*List of `format-time-string' specs to display file time stamps. | 153 | "*List of `format-time-string' specs to display file time stamps. |
| 154 | They are used whenever a locale is not specified to use instead. | 154 | These specs are used ONLY if a valid locale can not be determined. |
| 155 | |||
| 156 | If `ls-lisp-use-localized-time-format' is non-nil, these specs are used | ||
| 157 | regardless of whether the locale can be determined. | ||
| 155 | 158 | ||
| 156 | Syntax: (EARLY-TIME-FORMAT OLD-TIME-FORMAT) | 159 | Syntax: (EARLY-TIME-FORMAT OLD-TIME-FORMAT) |
| 157 | 160 | ||
| @@ -166,6 +169,15 @@ current year. The OLD-TIME-FORMAT is used for older files. To use ISO | |||
| 166 | (string :tag "Old time format")) | 169 | (string :tag "Old time format")) |
| 167 | :group 'ls-lisp) | 170 | :group 'ls-lisp) |
| 168 | 171 | ||
| 172 | (defcustom ls-lisp-use-localized-time-format nil | ||
| 173 | "*Non-nil causes ls-lisp to use `ls-lisp-format-time-list' even if | ||
| 174 | a valid locale is specified. | ||
| 175 | |||
| 176 | WARNING: Using localized date/time format might cause Dired columns | ||
| 177 | to fail to lign up, e.g. if month names are not all of the same length." | ||
| 178 | :type 'boolean | ||
| 179 | :group 'ls-lisp) | ||
| 180 | |||
| 169 | (defvar original-insert-directory nil | 181 | (defvar original-insert-directory nil |
| 170 | "This holds the original function definition of `insert-directory'.") | 182 | "This holds the original function definition of `insert-directory'.") |
| 171 | 183 | ||
| @@ -567,8 +579,12 @@ All ls time options, namely c, t and u, are handled." | |||
| 567 | (setq locale nil)) | 579 | (setq locale nil)) |
| 568 | (format-time-string | 580 | (format-time-string |
| 569 | (if (and (<= past-cutoff diff) (<= diff 0)) | 581 | (if (and (<= past-cutoff diff) (<= diff 0)) |
| 570 | (if locale "%m-%d %H:%M" (nth 0 ls-lisp-format-time-list)) | 582 | (if (and locale (not ls-lisp-use-localized-time-format)) |
| 571 | (if locale "%Y-%m-%d " (nth 1 ls-lisp-format-time-list))) | 583 | "%m-%d %H:%M" |
| 584 | (nth 0 ls-lisp-format-time-list)) | ||
| 585 | (if (and locale (not ls-lisp-use-localized-time-format)) | ||
| 586 | "%Y-%m-%d " | ||
| 587 | (nth 1 ls-lisp-format-time-list))) | ||
| 572 | time)) | 588 | time)) |
| 573 | (error "Unk 0 0000")))) | 589 | (error "Unk 0 0000")))) |
| 574 | 590 | ||