diff options
| author | Eli Zaretskii | 2022-04-13 17:00:59 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-04-13 17:00:59 +0300 |
| commit | e14e5dff2c5d8113b06e2aafa0d920120bdb68e9 (patch) | |
| tree | 5a8a754bcc7e0e75b7fa7f299d3b51dac2c84048 | |
| parent | 131ac4d20997f813f5e3f869fe944950ca5c5bc9 (diff) | |
| parent | 0ef9f6d07b5abe60005bea3eb2bb6d9c3aafbb98 (diff) | |
| download | emacs-e14e5dff2c5d8113b06e2aafa0d920120bdb68e9.tar.gz emacs-e14e5dff2c5d8113b06e2aafa0d920120bdb68e9.zip | |
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
| -rw-r--r-- | lisp/calendar/time-date.el | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 0db973ea161..ba7c48b290d 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el | |||
| @@ -343,15 +343,18 @@ right of \"%x\", trailing zero units are not output." | |||
| 343 | ;; Cf article-make-date-line in gnus-art. | 343 | ;; Cf article-make-date-line in gnus-art. |
| 344 | (setq num (floor seconds unit) | 344 | (setq num (floor seconds unit) |
| 345 | seconds (- seconds (* num unit))) | 345 | seconds (- seconds (* num unit))) |
| 346 | ;; Start position of the first non-zero unit. | 346 | (let ((is-zero (zerop (if (= unit 1) |
| 347 | (when (and (not leading-zeropos) | 347 | (+ num fraction) |
| 348 | (not (zerop num))) | 348 | num)))) |
| 349 | (setq leading-zeropos (match-beginning 0))) | 349 | ;; Start position of the first non-zero unit. |
| 350 | (unless (zerop num) | 350 | (when (and (not leading-zeropos) |
| 351 | (setq trailing-zeropos nil)) | 351 | (not is-zero)) |
| 352 | (when (and (not trailing-zeropos) | 352 | (setq leading-zeropos (match-beginning 0))) |
| 353 | (zerop num)) | 353 | (unless is-zero |
| 354 | (setq trailing-zeropos (match-beginning 0))) | 354 | (setq trailing-zeropos nil)) |
| 355 | (when (and (not trailing-zeropos) | ||
| 356 | is-zero) | ||
| 357 | (setq trailing-zeropos (match-beginning 0)))) | ||
| 355 | (setq string | 358 | (setq string |
| 356 | (replace-match | 359 | (replace-match |
| 357 | (format (if (match-string 2 string) | 360 | (format (if (match-string 2 string) |