diff options
| author | F. Jason Park | 2024-03-10 06:08:30 -0700 |
|---|---|---|
| committer | F. Jason Park | 2024-03-10 06:11:29 -0700 |
| commit | f3da3d1c68bef60ef28d67c6d8fa5d0cba8c9f08 (patch) | |
| tree | e38bcbd4d4daf8eea2a6bd19b42e1e6e154b3f5b | |
| parent | 166c8a989491c21ea3baf96e4730a4ad9b78308f (diff) | |
| download | emacs-f3da3d1c68bef60ef28d67c6d8fa5d0cba8c9f08.tar.gz emacs-f3da3d1c68bef60ef28d67c6d8fa5d0cba8c9f08.zip | |
Fix faulty decoded-time adjustment in erc-stamp
* lisp/erc/erc-stamp.el (erc-stamp--lr-date-on-pre-modify): Remove
disruptive assertion for now.
(erc-stamp--time-as-day): Attempt to fix date being rewound by a whole
day when daylight saving time is in effect. Do this by forcing the
`dst' slot of the `decoded-time' object to -1 and the `zone' to nil.
| -rw-r--r-- | lisp/erc/erc-stamp.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index a8190a2c94a..44f92c5a7e2 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el | |||
| @@ -723,9 +723,6 @@ inserted is a date stamp." | |||
| 723 | 'hash-table)) | 723 | 'hash-table)) |
| 724 | (erc-timestamp-last-inserted-left rendered) | 724 | (erc-timestamp-last-inserted-left rendered) |
| 725 | erc-timestamp-format erc-away-timestamp-format) | 725 | erc-timestamp-format erc-away-timestamp-format) |
| 726 | ;; FIXME delete once convinced adjustment correct. | ||
| 727 | (cl-assert (string= rendered | ||
| 728 | (erc-stamp--format-date-stamp aligned))) | ||
| 729 | (erc-add-timestamp)) | 726 | (erc-add-timestamp)) |
| 730 | (setq erc-timestamp-last-inserted-left rendered))))) | 727 | (setq erc-timestamp-last-inserted-left rendered))))) |
| 731 | 728 | ||
| @@ -833,7 +830,11 @@ left-sided stamps and date stamps inserted by this function." | |||
| 833 | (decoded (decode-time current-time erc-stamp--tz))) | 830 | (decoded (decode-time current-time erc-stamp--tz))) |
| 834 | (setf (decoded-time-second decoded) 0 | 831 | (setf (decoded-time-second decoded) 0 |
| 835 | (decoded-time-minute decoded) 0 | 832 | (decoded-time-minute decoded) 0 |
| 836 | (decoded-time-hour decoded) 0) | 833 | (decoded-time-hour decoded) 0 |
| 834 | (decoded-time-dst decoded) -1 | ||
| 835 | (decoded-time-weekday decoded) nil | ||
| 836 | (decoded-time-zone decoded) | ||
| 837 | (and erc-stamp--tz (car (current-time-zone nil erc-stamp--tz)))) | ||
| 837 | (encode-time decoded))) ; may return an integer | 838 | (encode-time decoded))) ; may return an integer |
| 838 | 839 | ||
| 839 | (defun erc-format-timestamp (time format) | 840 | (defun erc-format-timestamp (time format) |