diff options
author | F. Jason Park <jp@neverwas.me> | 2023-11-02 17:05:48 -0700 |
---|---|---|
committer | F. Jason Park <jp@neverwas.me> | 2023-11-04 15:41:55 -0700 |
commit | f99a0dae7ca1c5fe5232dafd7b1290b3435ad526 (patch) | |
tree | 922d67b10f39b669d5151da9d6b9b9e865f69b55 /lisp/emacs-lisp/lisp-mnt.el | |
parent | 4c8510857693812ff7ff635cd0d70f97022792db (diff) | |
download | emacs-f99a0dae7ca1c5fe5232dafd7b1290b3435ad526.tar.gz emacs-f99a0dae7ca1c5fe5232dafd7b1290b3435ad526.tar.bz2 emacs-f99a0dae7ca1c5fe5232dafd7b1290b3435ad526.zip |
Align date stamps to whole days in ERC
* lisp/erc/erc-stamp.el (erc-stamp--current-time): Ditch overriding
precedence of the `erc--ts' property in `:around' method because the
variable `erc-stamp--current-time' fills that role well enough.
(erc-stamp--current-datestamp-left): Remove unused variable.
(erc-stamp--insert-date-stamp-as-phony-message): Assume
`erc-timestamp-last-inserted-left' has already been assigned the
updated rendered stamp for the current time.
(erc-stamp--lr-date-on-pre-modify): Use the variable
`erc-stamp--current-time' instead of the `erc-ts' property to convey
an overriding time value for `erc-add-timestamp'. Set
`erc-timestamp-last-inserted-left' instead of fiddling with another
temporary variable to hack around these ill-fitting interfaces. Use
day-aligned time value for the `erc-ts' property assigned to date
stamps.
(erc-stamp--date-mode): New internal minor mode.
(erc-insert-timestamp-left-and-right): Defer to `erc-stamp--date-mode'
for setting up date-stamp specific hooks.
(erc-stamp--time-as-day): New function to "round" a date stamp to
start of local day.
(erc-stamp--setup): Defer to `erc-stamp--date-mode' for date-stamp
specific teardown. (Bug#60936)
* test/lisp/erc/erc-fill-tests.el
(erc-fill-tests--current-time-value): Change default value to nil.
(erc-stamp--current-time): New method for test cases.
(erc-fill-tests--insert-privmsg): Use realistic value for `unparsed'
slot.
(erc-fill-tests--wrap-populate): Bind
`erc-fill-tests--current-time-value' to 0. Don't mock the function
`erc-stamp--current-time' because doing so inhibits normal polymorphic
dispatch, which test cases rely on for delivering correct timestamp
values in varied contexts.
; * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update.
; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mnt.el')
0 files changed, 0 insertions, 0 deletions